Download Estimation

Document related concepts

Psychometrics wikipedia , lookup

History of statistics wikipedia , lookup

Bootstrapping (statistics) wikipedia , lookup

Taylor's law wikipedia , lookup

Foundations of statistics wikipedia , lookup

Resampling (statistics) wikipedia , lookup

Student's t-test wikipedia , lookup

Misuse of statistics wikipedia , lookup

Transcript
366_8
skipping 7 until Wed.
Estimation: Chapter 8
• Suppose we observe something in a random
sample
• how confident are we in saying our
observation is an accurate reflection of the
population?
Estimation
• Confidence intervals (levels)
– the range in which the population parameter is
estimated to be
– ‘margin of error’
– accounting for sampling error
Estimation
• Confidence intervals
– We need:
• standard error (we calculate this)
• the estimated mean
• a choice of confidence level
–
–
–
–
68%
90%
95%
99%
Estimation
• Confidence intervals
– We need:
• mean
• Z value for confidence level (we pick this)
• standard error of the mean (we calculate this)
– Calculated with standard deviation and sample size
– Larger sample, less error
– Smaller standard deviation, less error
Estimation
• Confidence intervals
– We need:
• standard error of the mean
– s.e. = standard deviation / sqrt of N
– Example 500 students have mean of 7.5 hrs/week of
commute time, std. deviation = 1.5 hrs
s.e. = 1.5 / sqrt of 500
=.067
Estimation
• Confidence intervals
– We need:
• standard error of the mean
– s.e. = standard deviation / sqrt of N
– Changed example 300 students have mean of 7.5 hrs/week
of commute time, std. deviation = 3.5 hrs
s.e. = 3.5 / sqrt of 300
=.20 (was .067 w/ a sample of 500)
Estimation
• Confidence intervals
– We need:
• Select confidence interval (68%, 90%, 95%, 99%)
•
•
•
•
68% CI = mean +/- 1 (s.e)
90% CI = mean +/- 1.64 (s.e)
95% CI = mean +/- 1.96 (s.e)
99% CI = mean +/- 2.58 (s.e)
Normal Distribution
Estimation
• Confidence intervals
– 95% confidence:
• CI=7.5hrs +/- 1.96 (.07)
= 7.5hrs +/- 0.14 hrs
= 7.36 to 7.64 hrs
Or,
• Given our sample of 500
• We are 95% confidence that population mean is between
7.36 and 7.64
• The average for the population is between 7.36 and 7.64
Estimation with less confidence
• Confidence intervals
– 68% confidence:
• CI=7.5hrs +/- 1 (.07)
= 7.5hrs +/- 0.07 hrs
= 7.43 to 7.57 hrs
We are 68% confidence that population mean is
between 7.43 and 7.57
Estimation with greater confidence
• Confidence intervals
– =99% confidence:
• CI=7.5hrs +/- 2.58 (.07)
= 7.5hrs +/- 0.18 hrs
= 7.43 to 7.57 hrs
We are 99% confidence that population mean is
between 7.32 and 7.68
Estimation with 90% confidence
– 90% confidence:
• CI=7.5hrs +/- x.xx (.07)
= x.x hrs +/- x.xx hrs
= x.xx to x.xx hrs
Estimation
• At any level of confidence
– The interval is determined by sample size and the
standard deviation of the estimated mean
– More variation around mean, less confident
– Fewer observations, less confident
– See p. 249
Estimation
• So far, we had interval data (Hours of
commute)
• Works different if nominal / proportional data
– Approve or disapprove of Obama
– A proportion (percent), not a mean
– Different formula
Estimation
• Confidence interval for proportion
– We need
• Standard error of proportion (we calculate, again)
• observed proportion
• select our confidence level
Example: Obama approval
Estimation
• 95% confidence interval for proportion
– We need
• Standard error
s.e.p. = sqrt [of (p)*(1-p) / n]
(p. 253)
CI = p +/- Z (s.e.p)
Obama estimated at .46 approval in Pew Values Survey
CI = .46 +/- 1.96 (s.e.p)
Estimation
• 95 % Confidence interval for proportion
– We need
• Standard error
s.e.p. = sqrt [of (.46)*(1-.46) / n ]
= sqrt of ((.46)*(1-.46) / 1515 ) = sqrt of (.2484 / 1514)
= .013
Obama estimated at .46 approval in Pew Values Survey
CI = .46 +/- 1.96 (.013):
Estimation
• 95% Confidence interval for proportion
– Obama estimated at .46 approval in Pew Values
Survey
CI = .46 +/- 1.96 (.013) = .46 +/- .025
we are 95% confident approval of Obama was the US is
between .435 and .485
or between 43.5% and 48.5% in October 2012 (n=1515)
Estimation
• 95% confident that Obama approval was
between 43.5% and 48.5% in October 2012,
with N = 1515
• What if 90% confident?
• 95% CI = .46 +/- 1.96 (s.e.p = .013) -> .46 +/- .025; OR between 43.5%
and 48.5%
• 90% CI =.46 +/- 1.68 (s.e.p = .013) -> .46 +/- .022; OR between 43.8%
and 48.2%
• What if sample 1000, rather than 1515?
s.e.p = sqrt of ((.46)*(1-.46) / 1515 ) = sqrt of (.2484 / 1514)
= .013: between 43.5% and 48.5% (2.6% M.O.E)
s.e.p = sqrt of ((.46)*(1-.46) / 1000 ) = sqrt of (.2484 / 1000)
= .016: between 44.4 % and 47.6 (3.2% M.O.E)
Estimation: Obama Approval
•
•
•
•
•
WA Post / ABC
Gallup
Fox
CBS
CNN
60%
58%
57%
62%
60%
+/- 3.5%
+/- 3.0%
+/- ??
+ / - ??
+/- 3.0%
n = 1,005
n= 1,500
n= 1,006
n=1,257
n=1,000
• None publish what confidence interval is:
90%?, 95%?
Hypothesis Testing: Chpt 9
• Statistics test a Null Hypothesis
• The mean age for tea party supporters and
non supporters is the same
• There is no difference between tea party
supporters and non supporters
Hypothesis Testing: Chpt 9
• Statistics test a Null Hypothesis
• Support for the Tea Party is independent of
gender
• Gender does not affect support for the Tea
Party
Hypothesis Testing: Chpt 9
• Statistical significance
– Probability that the NULL is wrong
– Probability that nothing is going on
– Probability that an observed relationship is a
sampling fluke
Hypothesis Testing: Chpt 9
• Statistical significance
– We need to decide what is ‘significantly
improbable’
– The level we reject the null hypothesis
• happens just 5% of the time? (.05 alpha)
• just 1% of the time (.01 alpha)
Statistical significance
• Type I vs Type II Errors
decision
Null is true
Null is false
Reject null
Type I error
correct decision
Retain null
Correct decision
Type II error
Significance (alpha) is chance of a Type I error
We want to avoid Type I errors, Type II are less dangerous:
Drug trials, criminal justice
Hypothesis Testing with t-test
Research Hypothesis (H1):
Something is going on.
There is a difference between groups, Men have higher score.
H1: Xm > Xf
Null Hypothesis (H0):
There is no difference
Mean for group 1 = the mean for group 2
H0: X1 = X2
Hypothesis Testing with t
Observe difference between two means:
Magnitude of difference
Variance in measure of X1 and X2
Number of observations
What is the likelihood that such a difference
would occur by chance?
Hypothesis testing with T
• Tests hypotheses about relationship between
a dichotomous nominal variable (gender, an
either / or item) and an interval variable
• Does the average score for one group differ
from a second group?
• Are Obama voters younger than Romney
voters
Hypothesis testing with T
• Does average age depend on which group we
are looking at?
– differences between two independent samples (p.
281)
• Is the average gas price observed in state
more/less than national average?
– comparing one sample to a population
T-test
• Assume
– Random samples, independent of each other
– Variable being compared is interval or ratio
– Distributions are normal
– Roughly equal variance of each group
T-test
• Decision based on what is “sufficiently improbable”
• Decision criteria, or critical t
– Alpha to reject (chance of a Type 1 error)
• t= 1.65 for alpha = .10
• t= 1.96 for alpha = .05 ...
• we observe a difference that could only occur ‘by
chance’ 5 times in 100
t test
– Directional test? p. 271
• do you think value is higher/lower for a specific group?
• Based on H1 (research hypothesis), where might
difference lie?
•
•
•
•
one tailed
right-tailed
left-tailed
two-tailed
two-tailed test: p. = .05
two-tailed test: p. = .05
• a .05 chance of the observed difference /
effect occurring by chance
• a .05 chance of being wrong if reject the null
hypothesis
• “sufficiently improbable”
one-tailed (left) test, p. = .05
one-tailed (right) test, p. = .05
one-tail vs. two-tail tests
• Most of the time, we play it conservative, twotail
• If results of being wrong are low, and research
hypothesis has solid sense of where the
difference lies, maybe use one-tail
one-tail vs two-tail tests
• SPSS spits out “p. values” that are two-tailed
• Range from .000 (highly improbable,
significant) to .999 (nothing there).
• Divide SPSS p. value by 2 to calculate 1-tailed
p-value
t test
• Calculate t
t=
mean1 – mean 2
________________
s x1-x2
----------std. error of the
difference between 2 means
this part is messy, but
includes info about sample sizes
and variances of each mean
T-test formula, ind./ samples
where
t-test
• result is a t-statistic we can use to check if
difference between groups is significant
T-test
• Example:
– Corruption, average levels in southern states vs.
non south
• What research hypothesis? (direction?)
• What null hypothesis?
Projects
• Identify testable hypotheses
– x causes y
– x explains differences in y
– differences in x explain y
– x and y go together in some interesting way
• State null hypothesis
Is mean of group 1 significantly
different than mean of group 2?
Non south, x= .33; s.e. .03
South, x= .43; s.e .05
t-test
• Southern states,
zoomed in....
Results (Stata output)
ttest percap_convic, by(var82)
Two-sample t test with equal variances
-----------------------------------------------------------------------------Group |
Obs
Mean
Std. Err.
Std. Dev.
[95% Conf. Interval]
---------+-------------------------------------------------------------------0 |
39
.3358051
.0313071
.1955129
.2724272
.3991831
1 |
11
.4324917
.0577252
.1914528
.303872
.5611115
---------+-------------------------------------------------------------------combined |
50
.3570762
.0278429
.1968793
.3011237
.4130287
---------+-------------------------------------------------------------------diff |
-.0966866
.0664606
-.2303146
.0369414
-----------------------------------------------------------------------------diff = mean(0) - mean(1)
t = -1.4548
Ho: diff = 0
degrees of freedom =
48
Ha: diff < 0
Pr(T < t) = 0.0761
.
Ha: diff != 0
Pr(|T| > |t|) = 0.1522
Ha: diff > 0
Pr(T > t) = 0.9239
Another example
• In a random sample, what is the relationship
between age and gender?
• Research Hypothesis? (Direction)?
• Null Hypothesis?
SPSS Results: Age * gender
SPSS results
Results
•
•
•
•
•
Note each mean is given
variation around mean is given
confidence intervals
difference between means is given -3.97
std. error of differences btwn means given
• AND t values
Results
• Note different t values are given
• Convert two-tail to one-tail?
Another example
• Female suicide rate, Europe vs. non-euro
countries
• Research H
• Null H
t test results
• Do we accept of reject null hypothesis?