Download x - Wiserd

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Degrees of freedom (statistics) wikipedia , lookup

Psychometrics wikipedia , lookup

History of statistics wikipedia , lookup

Bootstrapping (statistics) wikipedia , lookup

Taylor's law wikipedia , lookup

Foundations of statistics wikipedia , lookup

Regression toward the mean wikipedia , lookup

Resampling (statistics) wikipedia , lookup

Student's t-test wikipedia , lookup

Misuse of statistics wikipedia , lookup

Transcript
Week 9
Confidence Intervals and Tests
About One Mean
Using sampling distributions to
make inferences


Now we are ready to begin learning how to
apply probability theory and sampling
distributions in order to make inferences
about populations based on samples.
This week we will learn two techniques for
doing so:


Using a single sample to estimate a “confidence
interval” in which a population mean falls.
Testing a statistical hypothesis about a mean in a
single population using a single sample.
Confidence intervals

Say we are interested in using our sample data to estimate the mean
on some variable in a population. There are many examples of
situations where the mean in a population is of interest:







The mean GPA of the students at a university, based on a sample of
students
The actual proportion of registered voters who plan to vote for Obama in
the next election, based on a national survey
The mean earnings of African American males, based on a national survey
The mean SAT score of applicants to the UW, based on a randomly drawn
sample of 250 applications
The average mpg of a production run of 10,000 autos of a particular make
produced during 2003, based on a sample of 150 autos
The average number of times residents in poor urban neighborhoods are
victimized by crimes in the course of a year, based on a survey of residents
in poor neighborhoods
The average length of criminal sentences handed down to those convicted
of white collar crimes, based on a sample of sentencing decisions
Confidence intervals

Remember:



The mean from a particular sample is only an estimate of the population
mean.
If we were to draw repeated samples of the same size from the population,
we would obtain multiple sample means that have a distribution, i.e., the
sampling distribution of sample means.
The sampling distribution of sample means is approximately normal, with:
1.  x   x
2 . x 

x
N
We can use these properties of the sampling distribution of sample means
to determine what interval the population mean probably falls in, based on
the sample mean and sample standard deviation.
Confidence intervals

What do we mean by “probably falls”?


We can specify very precisely what mean
by “probably.” This is the level of
confidence we have in our interval.
For example, we can determine the
interval in which we can be 95% confident
that the population mean falls.

We call such an interval the “95% confidence
interval”
Confidence intervals

What does “95% confidence” mean?



Intuitive interpretation: we are 95% confident
that x falls in that range
Statistical interpretation: if we apply 95%
confidence intervals consistently, then we will
(over the long run) reach the correct conclusion
about x in 95 out of 100 cases
By adopting a 95% confidence level, we are
recognizing that in about 5 out of 100 cases our
conclusion about x will be incorrect – that is, it
will outside of the confidence interval.
Confidence intervals

How do we compute a confidence interval?


We begin by applying the t-distribution to answer
the question: what is the range of values of t
such that 5% of the observations will fall outside
that range, i.e., what is ta= t.05?
We look that up in Statistical Table C in the “twotailed test” column.



For example, for a  .05 and df > 120, ta= 1.96.
For a  .05 and df = 18, ta= 2.10.
For a  .01 and df = 18, ta= 2.88.
Confidence intervals




The critical value of t for a  .05 and df > 120 of 1.96
tells us that 5% of the observations will fall 1.96 or
more from the mean (either above or below) on the
t-scale, which means that 95% of the observations
will fall within 1.96 of the mean (above or below).
In one sense, all 95% confidence intervals for sample
sizes greater than 120 are ±1.96 on the t-scale.
But what does “on the t-scale” mean? We need to
convert the t-value of ±1.96 into values in the
original scale of the variable in question.
To do this, think of how you convert a raw score to a
t-score:
xx
tx 
sx
Confidence intervals

Keeping in mind that the standard
deviation of a sampling distribution is
what we call the standard error, the ttransformation of a single-sample mean
deviation is obtained by dividing it by
the standard error:s  s x
x

Thus:
xx
xx
tx 

sx
sx
n 1
n 1
Confidence intervals

If
xx
xx
ta 

  1.96 , then
sx
sx
n 1
sx
x  x   1.96 *
n 1
and
sx
x  x  1.96 *
n 1
Confidence intervals

How do we compute a confidence interval?
100 * (1  a )% Confidence interval of x  x  (ta )( sx )

So, we have to determine:




a (level of significance, or 1-confidence, or
probability of being outside the interval)
x (sample mean)
ta (critical value of t for a given a and degrees-offreedom)
s x (standard error, estimated using the sample
standard deviation)
Confidence intervals
100 * (1  a )% Confidence interval of x  x  (ta )( sx )

Example: A random sample of 61 Sociology majors has a mean GPA of
3.2, with a standard deviation of .35. Compute and interpret the 95%
confidence interval of the mean GPA for Sociology majors.
1)
2)
3)
Determine that a is .05.
Determine that ta is 2.00 (what are the degrees of freedom?)
Plug the numbers into the formula and solve:
95 % CI of  x  3.2  2.00 * (.35 / 60 )  3.12 to 3.28

Interpret: we are 95% confident that the mean GPA for Sociology
majors is between 3.12 and 3.28.
Confidence intervals
100 * (1  a )% Confidence interval of x  x  (ta )( sx )

Another example: A random sample of 10
“Guzzler” SUV‟s produced at Factory K has a mean
mpg of 5, with a standard deviation of .18.
Compute and interpret the 95% confidence
interval of the mean mpg of the Guzzlers
manufactured at that plant.
Confidence intervals
100 * (1  a )% Confidence interval of x  x  (ta )( sx )

Another example: A random sample of 10
“Guzzler” SUV‟s produced at Factory K has a mean
mpg of 5, with a standard deviation of .18.
Compute and interpret the 95% confidence
interval of the mean mpg of the Guzzlers
manufactured at that plant.
1)
What is a?
Confidence intervals
100 * (1  a )% Confidence interval of x  x  (ta )( sx )

Another example: A random sample of 10
“Guzzler” SUV‟s produced at Factory K has a mean
mpg of 5, with a standard deviation of .18.
Compute and interpret the 95% confidence
interval of the mean mpg of the Guzzlers
manufactured at that plant.
1)
What is a? .05
Confidence intervals
100 * (1  a )% Confidence interval of x  x  (ta )( sx )

Another example: A random sample of 10 “Guzzler” SUV‟s
produced at Factory K has a mean mpg of 5, with a
standard deviation of .18. Compute and interpret the 95%
confidence interval of the mean mpg of the Guzzlers
manufactured at that plant.
1)
2)
What is a? .05
What is ta ? (What are the degrees of freedom?)
Confidence intervals
100 * (1  a )% Confidence interval of x  x  (ta )( sx )

Another example: A random sample of 10 “Guzzler” SUV‟s
produced at Factory K has a mean mpg of 5, with a
standard deviation of .18. Compute and interpret the 95%
confidence interval of the mean mpg of the Guzzlers
manufactured at that plant.
1)
2)
What is a? .05
What is ta? 2.26 (df= 9)
Confidence intervals
100 * (1  a )% Confidence interval of x  x  (ta )( sx )

Another example: A random sample of 10 “Guzzler” SUV‟s
produced at Factory K has a mean mpg of 5, with a
standard deviation of .18. Compute and interpret the 95%
confidence interval of the mean mpg of the Guzzlers
manufactured at that plant.
1)
2)
3)
What is a? .05
What is ta ? 2.26 (df=9)
What numbers do we plug into the formula?
Confidence intervals
100 * (1  a )% Confidence interval of x  x  (ta )( sx )

Another example: A random sample of 10 “Guzzler” SUV‟s
produced at Factory K has a mean mpg of 5, with a
standard deviation of .18. Compute and interpret the 95%
confidence interval of the mean mpg of the Guzzlers
manufactured at that plant.
1)
2)
3)
What is a? .05
What is ta ? 2.26 (df=9)
What numbers do we plug into the formula?
95 % CI of  x  5  2.26 * (.18 / 9 )  4.86 to 5.14
Confidence intervals
100 * (1  a )% Confidence interval of x  x  (ta )( sx )

Another example: A random sample of 10 “Guzzler” SUV‟s produced at Factory
K has a mean mpg of 5, with a standard deviation of .18. Compute and
interpret the 95% confidence interval of the mean mpg of the Guzzlers
manufactured at that plant.
1)
2)
3)
What is a? .05
What is ta ? 2.26 (What are the degrees of freedom?)
Plug the numbers into the formula and solve:
95 % CI of  x  5  2.26 * (.18 / 9 )  4.86 to 5.14

Interpret: we are 95% confident that the mean mpg of the Guzzlers produced
at Factory K is between 4.85 and 5.15.
Confidence intervals around
proportions


The same procedures can be used to
compute a confidence interval for a
proportion, so long as the N is greater
than 5/p(smaller).
Just remember that
PQ
P(1  P)
sP 

N
N
Confidence intervals around
proportions

Example: based on a random sample of 600 voters, 56% say
they plan to vote for Obama in the next election. Compute
and interpret the 95% confidence interval for the proportion
of voters who will vote for Obama.
1)
2)
a  .05
ta = 1.96
3)
95% CI of  x  .56  1.96 * (

.56 * .44
)  .52 to .60
600
Interpretation: we can be 95% sure that between 52% and
60% of the vote will go to Obama. (In other words, the poll
has a 95% “margin of error” of ±4 percentage points.)
Confidence intervals around
proportions
Another example: in a random sample of 200 Super Bowl viewers, 88% say they
agree with the statement: “The halftime show should be abolished altogether, I
want to see football, not lame pop stars.” Compute and interpret a 95% confidence
interval for the percentage of Super Bowl viewers who agree with the statement.

First, check to make sure that the sample size is large enough relative to p(smaller):

Is (.12)*200 greater than or equal to 5? Yes! (it equals 24) Therefore, we can use the t
distribution to derive a confidence interval.

1)
2)
a  .05
ta = 1.96
3)
95% CI of  x  .88  1.96 * (

.88 * .12
)  .835 to .925
600
Interpretation: we can be 95% sure that between 83.5% and 9.25% of Super Bowl
viewers want the halftime show to be abolished. (In other words, the poll has a
95% margin of error of ±4.5 percentage points.)
Confidence Intervals:
Wrapping Up



Remember: a confidence interval tells you the precise interval in which the
population mean falls with a precise degree of probability.
We obtain confidence intervals when we are interested in the true population
mean on a particular variable and we only have sample data available.
Adopting a given level of confidence, we are always taking a risk of reaching an
incorrect conclusion.



Make sure you know how to compute a confidence interval, given the sample
mean, sample standard deviation, sample size, and a.
Make sure you know that to apply the formula to a population proportion (rather
than a mean on an interval variable) you only need to know P, the sample size,
and a.


For example, for a  .05 we will identify “correct” confidence intervals 95 times out of
100 (on average) and incorrect ones 5 times out of 100.
And that in order to this, it must be true that P(smaller)*N≥5.
Let‟s do a few sample problems…
Hypothesis testing



Another type of inference involves testing
explicit hypotheses about some parameter in
a population using sample data.
We also use the logic of partitioning areas
under a sampling distribution to test
hypotheses in this fashion.
To see how this is done, we‟ll learn how to
test hypotheses about the mean in a
population. Then we‟ll extract some general
steps in hypothesis testing that will apply
when we test other types of hypotheses.
Hypothesis tests about one
mean

We begin with a research hypothesis that involves a
claim about a mean. We should be able to express
that hypothesis in terms of the mean‟s relationship to
some target value. Some examples:

We know that the mean on variable x in group A equals z and
we hypothesize, based on our theory, that the mean in group
B differs from the mean in group A.


Hypothesis: xB @ z.
We know that mean on x in the population from some past
time period P equals k and we hypothesize, based on our
theory, that the mean has increased (or decreased) since
then.


Hypothesis: xB > k.
Hypothesis: xB < k.
Hypothesis tests about one
mean

Some more examples:

We want to test whether the mean in the
population exceeds some “ideal” target value, i.
(For example, in quality control procedures).


Hypothesis: x > i.
We know that the population mean on x is r and
we want to test whether our sample is
representative with respect to x.

Hypothesis: x @ r.
Hypothesis tests about one
mean


We can tests hypotheses about whether a
population mean equals a specific value using
the t-distribution.
Essentially, we ask the question: if the
population mean equals the target value, x0 ,
then what is the probability of obtaining a
sample mean that differs from x0 by x  x0 or
more?


IF that probability is very small, we can reject the
hypothesis that x = x0.
IF that probability is substantial, we cannot reject
the hypothesis that x = x0.
Hypothesis tests about one
mean

Remember:



IF that probability is very small, we can reject the hypothesis that
x = x0.
IF that probability is substantial, we cannot reject the hypothesis
that x = x0.
How small is “very small”? How large is “substantial”?
Here we rely on convention and tradition. For example, in
the social sciences it is customary to treat the threshold
probability as .05. That is, we adopt a significance level
of .05 by convention.


IF that probability < .05, we reject the hypothesis that x = x0.
IF that probability > .05 do not reject the hypothesis that x = x0.
Hypothesis tests about one
mean

We call the hypothesis that the population mean equals a
particular value the statistical hypothesis (more commonly
known as the „null‟ hypothesis).


We always test the statistical hypothesis using our data.



Remember: a statistical hypothesis always involves an equality.
If we reject the statistical hypothesis, we then rule in favor of an
alternative hypothesis, which is usually the hypothesis we get
from our theory.
If we do not reject the statistical hypothesis, we must rule against
the alternative hypothesis (but that does not mean we actually
“accept” the statistical hypothesis – notice the subtle difference!
We test the statistical hypothesis using what we know
about the t-distribution.
Hypothesis tests about one
mean

To see how it works, we have to work with a t
distribution on the board. We can think of the
process of testing a statistical hypothesis about
one mean in several different ways.
1) What is the probability of obtaining the sample mean
we did if the statistical hypothesis is true?



Is it less than .05?
If yes, reject the statistical hypothesis.
If no, then fail to reject the statistical hypothesis.
Hypothesis tests about one
mean

To see how it works, we have to work with a t
distribution on the board. We can think of the
process of testing a statistical hypothesis about
one mean in several different ways.
2) How far from the target mean does our sample mean
have to be in the original scale of x in order to reject
the statistical hypothesis at a = .05?



Is the sample mean that far from the target mean?
If yes, reject the statistical hypothesis.
If no, then fail to reject the statistical hypothesis.
Hypothesis tests about one
mean

To see how it works, we have to work with a t
distribution on the board. We can think of the process
of testing a statistical hypothesis about one mean in
several different ways.
3) How far from the target mean does our sample mean have to be
in units of t in order to reject the statistical hypothesis at a =
.05? (I.e., what is the “critical value” of t, ta, at a = .05?)



Does the absolute value of the sample t statistic (the sample mean
transformed into units of t) exceed |ta|?
If yes, reject the statistical hypothesis.
If no, then fail to reject the statistical hypothesis.
Example: two-tailed test
about one mean

Problem: You are a faculty member in the Statistics
Department at Quantoid State University and your
department chair has assigned you the task of assessing
whether the qualifications of this year's crop of grad
students differ from the qualifications of last year‟s.
Department records show that last year the entering
grad students had a combined score on Statistical
Competence Test (SCT) of 12.0. You have limited time,
so you randomly choose the files of 20 of this year‟s
students and determine that their mean SCT score is
13.4 and the variance is 10.0.
Example: two-tailed test
about one mean
Step 1: State the statistical hypothesis and the
alternative hypothesis.



Statistical Hypothesis:   12.0.
Alternative Hypothesis:  @ 12.0.
Step 2: Describe the sampling distribution.


This is a test about a single mean in a population –
the population of this year‟s graduate students.
Therefore, the sampling distribution is a tdistribution.
Example: two-tailed test
about one mean
Step 3: State the level of significance (a) and
determine the critical value of the test statistic.


We set a  .05 because that is the convention in
social sciences. We determine that |t.05| for 19
degrees of freedom is 2.093.
Step 4: Observe the sample values and
compute the test statistic.


t
x  0
sx
13.4  12.0

 198
.
n1
10 19
Example: two-tailed test
about one mean
Step 5: Compare the test statistic (the sample-based
statistic) to the critical value and make the decision
about the statistical hypothesis.


1.98 < 2.093. Therefore, we fail to reject the statistical
hypothesis. We must reject the alternative hypothesis.
Step 6: Interpret the results in plain English.


The data provide no evidence that the qualifications of this
year‟s graduate students differ from the qualifications of last
year‟s graduate students.
Example: two-tailed test
about one mean

What if the mean in the sample of 20 students
was 10.5 rather than 13.4?
t
x  0
sx
10.5  12.0

  2.12  2.12
n1
10 19
Example: two-tailed test
about one mean

What if the mean in the sample of 20 students
was 13.8 rather than 13.4?
t
x  0
sx
138
.  12.0

 2.55
n1
10 19
Example: one-tailed test
about one mean

Problem: You are a faculty member in the Statistics
Department at Quantoid State University and all your
colleagues say that this year‟s crop of grad students is
clearly better qualified than last years. You decide to
test this rumor statistically. Department records show
that last year the entering grad students had a
combined score on Statistical Competence Test (SCT) of
12.0. You have limited time, so you randomly choose
the files of 20 of this year‟s students and determine that
their mean SCT score is 13.4 and the variance is 10.0.
Example: one-tailed test
about one mean
This is what we call a one-tailed research question. The
research question specifies either that the population
mean is greater than some value (in this case, 12.0) or
that the population mean is less than some value.



In this case, we are willing to rule out a priori that the
population mean falls in the opposite tail. In our example, we
are willing to rule out the possibility that this year‟s cohort of
grad students is less qualified than last year‟s
When using a one-tailed test, you must keep track of
the signs of the critical value of t and the test statistic,
and you must make sure to look up the one-tailed ta
rather than the two-tailed ta in Statistical Table C.
Example: one-tailed test
about one mean
Step 1: State the statistical hypothesis and the
alternative hypothesis.



Statistical Hypothesis:   12.0.
Alternative Hypothesis:  > 12.0.
Step 2: Describe the sampling distribution.


This is a test about a single mean in a population –
the population of this year‟s graduate students.
Therefore, the sampling distribution is a tdistribution.
Example: one-tailed test
about one mean
Step 3: State the level of significance (a) and
determine the critical value of the test statistic.


We set a  .05 because that is the convention in
social sciences. We determine that t.05 for 19
degrees of freedom using a one-tailed for a positive
mean is +1.729.
Step 4: Observe the sample values and
compute the test statistic.


t
x  0
sx
13.4  12.0

 198
.
n1
10 19
Example: one-tailed test
about one mean
Step 5: Compare the test statistic (the samplebased statistic) to the critical value and make
the decision about the statistical hypothesis.


1.98 > 1.729. Therefore, we reject the statistical
hypothesis. We accept the alternative hypothesis.
Step 6: Interpret the results in plain English.


The data provide evidence that the qualifications of
this year‟s graduate students are better than the
qualifications of last year‟s graduate students.
One-tailed vs. two-tailed tests
Use a two-tailed test when?


When there is no basis to specify in advance whether
μX > μ0 or μX < μ0 .

When the research question specifies an inequality or
a difference between the population mean and some
value without suggesting that the difference is
positive or negative
One-tailed vs. two-tailed tests

Use a one-tailed test when?


When we can rule out in advance either that μx > μ0 or μx
< μ.
For example, say we know the mean population height for
men is 5'10". We measure the height of 100 randomlyselected women, thereby obtaining a sample mean height of
5'6" and standard deviation of 0.4". Should we use a onetailed or two-tailed test to determine whether the average
height of women equals that of men (5'10")?
One-tailed vs. two-tailed tests
Which tail do you look at in a one-tailed test?


Ask: Do we think that μx > μ0 or that μx < μ0 ?


If we think μx > μ0 then the "critical region" or "red zone"
(where we reject the null hypothesis that μx = μ0 ) must
be in the right-hand tail, so take the positive value of tα .
If we think μy < μ0 then the "critical region" or "red zone"
(where we reject the null hypothesis that μx = μ0 ) must
be in the left-hand tail, so take the negative value of tα .
One-tailed vs. two-tailed tests
Remember: You must specify in advance whether you
are using a one-tailed or two-tailed test.


And, if you are using a one-tailed test, you must specify the
appropriate tail in your alternative hypothesis.
The main reason for this is that it is easier to reject a
statistical hypothesis using a one-tailed test (as our
example showed).


If you don‟t specify a one-tailed test in advance, you might be
accused of “cheating”!!
Some basic principles in hypothesis
testing about one mean



The greater the significance level (the
higher a), the smaller ta and the easier it is
to reject the statistical hypothesis.
The greater the difference between the
target mean and the sample mean, the
larger the test value of t and the easier it is
to reject the statistical hypothesis.
The greater the sample size and the smaller
the sample variance, the larger the test
value of t and the easier it is to reject the
statistical hypothesis.
General steps in hypothesis
testing






Step 1: State the statistical hypothesis and the alternative
hypothesis.
Step 2: Describe (and draw)the sampling distribution.
Step 3: State the level of significance (a) and determine
the critical value of the test statistic.
Step 4: Observe the sample values and compute the test
statistic.
Step 5: Compare the test statistic (the sample-based
statistic) to the critical value and make the decision about
the statistical hypothesis.
Step 6: Interpret the results in plain English.
General steps in hypothesis
testing
These same steps are used in a wide range of statistical
tests. So far, we have learned only one statistical test: a
t-test about the mean in one population.

We will learn other tests, including:





A t-test comparing the means in two populations,
A chi-square test evaluating whether two nominal variables are
statistically independent (or statistically related),
A t-test assessing whether a regression coefficient equals zero in a
population.
For now, let‟s go over some sample problems involving
tests about one mean…