Uploaded by deniel21199

isrs Ch1 Lecture2 IntroToData Part2

advertisement
BES220: Introduction to Data (Part 2)
Elias J. Willemse
Swift code: https://swipe.to/8308s
Today’s class
1. Pitfalls of sampling
2. Explanatory and response variables
3. Observational studies
4. Experiments
https://swipe.to/8308s
2
Learning outcomes
1. Identify the explanatory variable in a pair of variables as the
variable suspected of affecting the other.
https://swipe.to/8308s
3
Learning outcomes
1. Identify the explanatory variable in a pair of variables as the
variable suspected of affecting the other.
2. Classify a study as observational or experimental.
https://swipe.to/8308s
4
Learning outcomes
1. Identify the explanatory variable in a pair of variables as the
variable suspected of affecting the other.
2. Classify a study as observational or experimental.
3. Question confounding variables and sources of bias in a given
study.
https://swipe.to/8308s
5
Learning outcomes
1. Identify the explanatory variable in a pair of variables as the
variable suspected of affecting the other.
2. Classify a study as observational or experimental.
3. Question confounding variables and sources of bias in a given
study.
4. Identify the four principles of experimental design and
recognise their purposes.
https://swipe.to/8308s
6
Recap
Recap
1. Basics of data.
2. Relationship between variables.
3. Categorise a relationship as positive or negative association.
4. Briefly looked at sampling.
https://swipe.to/8308s
8
Explanatory and response variables
To identify the explanatory variable in a pair of variables, identify
which of the two is suspected of affecting the other:
might affect
explanatory variable −−−−−−−−→response variable
https://swipe.to/8308s
9
Explanatory and response variables
To identify the explanatory variable in a pair of variables, identify
which of the two is suspected of affecting the other:
might affect
explanatory variable −−−−−−−−→response variable
In the following two case which one is the explanatory variable and
which one is the response variable?
https://swipe.to/8308s
10
Explanatory and response variables
Ice-cream sales and temperature:
(a) Ice-cream sales is the explanatory variable and temperature
the response variable.
(b) Temperature is the explanatory variable and ice-cream sales
the response variable.
https://swipe.to/8308s
11
Explanatory and response variables
Ice-cream sales and temperature:
(a) Ice-cream sales is the explanatory variable and temperature
the response variable.
(b) Temperature is the explanatory variable and ice-cream sales
the response variable.
https://swipe.to/8308s
12
Explanatory and response variables
Country’s investment in higher-education and Gross Domestic
Product (GPD):
(a) Country’s investment in higher-education is the explanatory
variable and Gross Domestic Product (GPD) the response
variable.
(b) Gross Domestic Product (GPD) is the explanatory variable and
country’s investment in higher-education the response variable.
https://swipe.to/8308s
13
Explanatory and response variables
Country’s investment in higher-education and Gross Domestic
Product (GPD):
(a) Country’s investment in higher-education is the explanatory
variable and Gross Domestic Product (GPD) the response
variable.
(b) Gross Domestic Product (GPD) is the explanatory variable and
country’s investment in higher-education the response variable.
We don’t really know.
https://swipe.to/8308s
14
Explanatory and response variables
To identify the explanatory variable in a pair of variables, identify
which of the two is suspected of affecting the other:
might affect
explanatory variable −−−−−−−−→response variable
• Labelling variables as explanatory and response does not
guarantee the relationship between the two is actually causal.
https://swipe.to/8308s
15
Explanatory and response variables
To identify the explanatory variable in a pair of variables, identify
which of the two is suspected of affecting the other:
might affect
explanatory variable −−−−−−−−→response variable
• Labelling variables as explanatory and response does not
guarantee the relationship between the two is actually causal.
• We use these labels only to keep track of which variable we
suspect affects the other.
https://swipe.to/8308s
16
Observational studies and experiments
• Observational study: Researchers collect data in a way that
does not directly interfere with how the data arise.
https://swipe.to/8308s
17
Observational studies and experiments
• Observational study: Researchers collect data in a way that
does not directly interfere with how the data arise.
• Experiment: Researchers randomly assign subjects (or items)
to various treatments in order to establish causal connections
between the explanatory and response variables.
https://swipe.to/8308s
18
Observational studies and
sampling strategies
http:// www.peertrainer.com/ LoungeCommunityThread.aspx?ForumID=1&ThreadID=3118
https://swipe.to/8308s
20
What type of study is this, observational study or an experiment?
“Girls who regularly ate breakfast, particularly one that includes cereal, were
slimmer than those who skipped the morning meal, according to a study that
tracked nearly 2,400 girls for 10 years. [...] As part of the survey, the girls were
asked once a year what they had eaten during the previous three days.”
What is the conclusion of the study?
Who sponsored the study?
https://swipe.to/8308s
21
What type of study is this, observational study or an experiment?
“Girls who regularly ate breakfast, particularly one that includes cereal, were
slimmer than those who skipped the morning meal, according to a study that
tracked nearly 2,400 girls for 10 years. [...] As part of the survey, the girls were
asked once a year what they had eaten during the previous three days.”
This is an observational study since the researchers merely
observed the behavior of the girls (subjects) as opposed to
imposing treatments on them.
What is the conclusion of the study?
Who sponsored the study?
https://swipe.to/8308s
22
What type of study is this, observational study or an experiment?
“Girls who regularly ate breakfast, particularly one that includes cereal, were
slimmer than those who skipped the morning meal, according to a study that
tracked nearly 2,400 girls for 10 years. [...] As part of the survey, the girls were
asked once a year what they had eaten during the previous three days.”
This is an observational study since the researchers merely
observed the behavior of the girls (subjects) as opposed to
imposing treatments on them.
What is the conclusion of the study?
There is an association between girls eating breakfast and being
slimmer.
Who sponsored the study?
https://swipe.to/8308s
23
What type of study is this, observational study or an experiment?
“Girls who regularly ate breakfast, particularly one that includes cereal, were
slimmer than those who skipped the morning meal, according to a study that
tracked nearly 2,400 girls for 10 years. [...] As part of the survey, the girls were
asked once a year what they had eaten during the previous three days.”
This is an observational study since the researchers merely
observed the behavior of the girls (subjects) as opposed to
imposing treatments on them.
What is the conclusion of the study?
There is an association between girls eating breakfast and being
slimmer.
Who sponsored the study?
General Mills.
https://swipe.to/8308s
24
3 possible explanations
https://swipe.to/8308s
25
3 possible explanations
1. Eating breakfast causes girls to be thinner.
https://swipe.to/8308s
26
3 possible explanations
1. Eating breakfast causes girls to be thinner.
2. Being thin causes girls to eat breakfast.
https://swipe.to/8308s
27
3 possible explanations
1. Eating breakfast causes girls to be thinner.
2. Being thin causes girls to eat breakfast.
3. A third confounding variable is responsible for both. What
could it be?
https://swipe.to/8308s
28
Prospective vs. retrospective studies
• A prospective study identifies individuals and collects
information as events unfold.
• Example: The Nurses Health Study has been recruiting
registered nurses and then collecting data from them using
questionnaires since 1976.
https://swipe.to/8308s
29
Prospective vs. retrospective studies
• A prospective study identifies individuals and collects
information as events unfold.
• Example: The Nurses Health Study has been recruiting
registered nurses and then collecting data from them using
questionnaires since 1976.
• Retrospective studies collect data after events have taken
place.
• Example: Researchers reviewing past events in medical
records.
https://swipe.to/8308s
30
Obtaining good samples
https://swipe.to/8308s
31
Obtaining good samples
• Almost all statistical methods are based on the notion of
implied randomness.
https://swipe.to/8308s
32
Obtaining good samples
• Almost all statistical methods are based on the notion of
implied randomness.
• If observational data are not collected in a random framework
from a population, these statistical methods – the estimates
and errors associated with the estimates – are not reliable.
https://swipe.to/8308s
33
Obtaining good samples
• Almost all statistical methods are based on the notion of
implied randomness.
• If observational data are not collected in a random framework
from a population, these statistical methods – the estimates
and errors associated with the estimates – are not reliable.
• Most commonly used random sampling techniques are
simple, stratified, and cluster sampling.
https://swipe.to/8308s
34
Simple random sample
Randomly select cases from the population, where there is no
implied connection between the points that are selected.
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
Stratum 2
Stratum 4
Index
●
https://swipe.to/8308s
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
Stratum 3
Stratum 6
●●
●
●
●
●
●
●●
●
●
●
●
●
●●
●
●
35
Experiments
Principles of experimental design
https://swipe.to/8308s
37
Principles of experimental design
1. Control: Compare treatment of interest to a control group.
https://swipe.to/8308s
38
Principles of experimental design
1. Control: Compare treatment of interest to a control group.
2. Randomise: Randomly assign subjects to treatments, and
randomly sample from the population whenever possible.
https://swipe.to/8308s
39
Principles of experimental design
1. Control: Compare treatment of interest to a control group.
2. Randomise: Randomly assign subjects to treatments, and
randomly sample from the population whenever possible.
3. Replicate: Within a study, replicate by collecting a sufficiently
large sample. Or replicate the entire study.
https://swipe.to/8308s
40
Principles of experimental design
1. Control: Compare treatment of interest to a control group.
2. Randomise: Randomly assign subjects to treatments, and
randomly sample from the population whenever possible.
3. Replicate: Within a study, replicate by collecting a sufficiently
large sample. Or replicate the entire study.
4. Block: If there are variables that are known or suspected to
affect the response variable, first group subjects into blocks
based on these variables, and then randomize cases within
each block to treatment groups.
https://swipe.to/8308s
41
More on blocking
• We would like to design an experiment to
investigate if energy gels makes you run
faster:
https://swipe.to/8308s
42
More on blocking
• We would like to design an experiment to
investigate if energy gels makes you run
faster:
• Treatment: energy gel
• Control: no energy gel
https://swipe.to/8308s
43
More on blocking
• We would like to design an experiment to
investigate if energy gels makes you run
faster:
• Treatment: energy gel
• Control: no energy gel
• It is suspected that energy gels might affect
pro and amateur athletes differently,
therefore we block for pro status:
https://swipe.to/8308s
44
More on blocking
• Divide the sample to pro and amateur
• Randomly assign pro athletes to treatment
and control groups
• Randomly assign amateur athletes to
treatment and control groups
• Pro/amateur status is equally represented in
the resulting treatment and control groups
https://swipe.to/8308s
45
More on blocking
• Divide the sample to pro and amateur
• Randomly assign pro athletes to treatment
and control groups
• Randomly assign amateur athletes to
treatment and control groups
• Pro/amateur status is equally represented in
the resulting treatment and control groups
Why is this important? Can you think of other variables to block for?
https://swipe.to/8308s
46
A study is designed to test the effect of light level and noise level on
exam performance of students. The researcher also believes that
light and noise levels might have different effects on males and females, so wants to make sure both genders are equally represented
in each group. Which of the below is correct?
(a) There are 3 explanatory variables (light, noise, gender) and 1
response variable (exam performance)
(b) There are 2 explanatory variables (light and noise), 1 blocking
variable (gender), and 1 response variable (exam
performance)
(c) There is 1 explanatory variable (gender) and 3 response
variables (light, noise, exam performance)
(d) There are 2 blocking variables (light and noise), 1 explanatory
variable (gender), and 1 response variable (exam
performance)
https://swipe.to/8308s
47
A study is designed to test the effect of light level and noise level on
exam performance of students. The researcher also believes that
light and noise levels might have different effects on males and females, so wants to make sure both genders are equally represented
in each group. Which of the below is correct?
(a) There are 3 explanatory variables (light, noise, gender) and 1
response variable (exam performance)
(b) There are 2 explanatory variables (light and noise), 1 blocking
variable (gender), and 1 response variable (exam
performance)
(c) There is 1 explanatory variable (gender) and 3 response
variables (light, noise, exam performance)
(d) There are 2 blocking variables (light and noise), 1 explanatory
variable (gender), and 1 response variable (exam
performance)
https://swipe.to/8308s
48
Difference between blocking and explanatory variables
• Factors are conditions we can impose on the experimental
units.
• Blocking variables are characteristics that the experimental
units come with, that we would like to control for.
• Blocking is like stratifying, except used in experimental
settings when randomly assigning, as opposed to when
sampling.
https://swipe.to/8308s
49
More experimental design terminology...
• Placebo: fake treatment, often used as the control group for
medical studies
• Placebo effect: experimental units showing improvement
simply because they believe they are receiving a special
treatment
• Blinding: when experimental units do not know whether they
are in the control or treatment group
• Double-blind: when both the experimental units and the
researchers who interact with the patients do not know who is
in the control and who is in the treatment group
https://swipe.to/8308s
50
Practice
What is the main difference between observational studies and experiments?
(a) Experiments take place in a lab while observational studies do
not need to.
(b) In an observational study we only look at what happened in the
past.
(c) Most experiments use random assignment while observational
studies do not.
(d) Observational studies are completely useless since no causal
inference can be made based on their findings.
https://swipe.to/8308s
51
Practice
What is the main difference between observational studies and experiments?
(a) Experiments take place in a lab while observational studies do
not need to.
(b) In an observational study we only look at what happened in the
past.
(c) Most experiments use random assignment while observational
studies do not.
(d) Observational studies are completely useless since no causal
inference can be made based on their findings.
https://swipe.to/8308s
52
Random assignment vs. random sampling
ideal
experiment
Random
assignment
No random
assignment
Random
sampling
Causal conclusion,
generalized to the whole
population.
No causal conclusion,
correlation statement
generalized to the whole
population.
No random
sampling
Causal conclusion,
only for the sample.
most
experiments
Causation
https://swipe.to/8308s
most
observational
studies
Generalizability
No causal conclusion,
No
correlation statement only
generalizability
for the sample.
Correlation
bad
observational
studies
53
Recap
• The explanatory variable is expected of affecting the response
variable.
• Two main ways to collect data:
• Observational studies
• Experiments
• Four principles of experimental design.
• Observational studies, we can claim correlations, but we can’t
assign causation, may be due to confounding variable.
• Experiment, we can assign causation, but not necessarily to
the entire population.
https://swipe.to/8308s
54
Download