Download P201 Lecture Notes13 One Population t

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

Sufficient statistic wikipedia , lookup

History of statistics wikipedia , lookup

Psychometrics wikipedia , lookup

Confidence interval wikipedia , lookup

Eigenstate thermalization hypothesis wikipedia , lookup

Bootstrapping (statistics) wikipedia , lookup

Foundations of statistics wikipedia , lookup

Taylor's law wikipedia , lookup

Omnibus test wikipedia , lookup

Misuse of statistics wikipedia , lookup

Resampling (statistics) wikipedia , lookup

Student's t-test wikipedia , lookup

Transcript
PSY 201 Lecture Notes
Test of a hypothesis about µ when the value of sigma is unknown
Module 17
Problem: Suppose a car dealership wishes to discover ways to improve customer satisfaction with its
service department. Over the past five years, surveys have been distributed to randomly selected service
department customers who rated their “overall satisfaction” with the service department. The mean of those
five years worth of ratings is 70.4 on a 0 – 100 scale. Unfortunately, a fire at the dealership destroyed
records of the previous past years, so no information on the five-year population characteristics remains
except that the manager of service remembers that the mean was 70.4. The dealership wishes to devise
ways to increase the mean rating. It hires a psychologist who implements a strategy to improve satisfaction.
The strategy includes training the “service writers”, the persons who interact with the customers, in
interpersonal skills, training the persons who accept payment in such skills, improving the physical
appearance of the service waiting area, and streamlining and clarifying the invoice for service given to
customers. After implementation of the plan, the dealership sent out 25 surveys to randomly selected
customers. The question here is: Is the mean satisfaction of the population of service customers equal to
70.4, the value of the population mean before the plan was implemented, or is it not? The mean of the
sample of 25 customers was 79.52. The sample standard deviation was 15.382. (Note – for pedagogical
reasons, the sample size for this example problem has been set at a value that is too small.
This problem starts out like a typical Z-test problem.
Here are the Hypothesis testing steps
Step 1: Null hypothesis______Population mean = 70.4__________µ=70.4____________
Alternative Hypothesis______Population mean ≠ 70.4____ µ≠70.4________
Step 2 Test Statistic:
Sample mean – Hypothesized value of population mean
Hmm. The Z statistic is Z = --------------------------------------------------------------------Population standard deviation
-----------------------------------Square root of sample size
Symbolically, that’s
X-bar - µH
X-bar– 70.4
Z = --------------------------- = -----------------------------------------σ
?????
------N
5
The problem is: We’re missing a quantity. Specifically, we’re missing the value of sigma (σ), the
population standard deviation. For the statistic to be a real Z, the population standard deviation must be
plugged into the formula.
What should we do?
Biderman’s P201Handouts
Topic 12: One Pop Tests Without Sigma - 1
5/4/2017
The test statistic problem
This problem was faced by statisticians of old (who would now be very old statisticians.)
They wanted to compute a Z statistic but did not know the value of the population standard deviation.
In fact, this is the situation we’ll most likely face.
That is, if we’re so ignorant of the characteristics of a population that we don’t know its mean, how in earth
could we know its standard deviation?
The answer is: We couldn’t. We need to find a way of testing such hypotheses without having to know the
value of the population standard deviation.
Why do we even care?
We care because we can’t determine the p-value necessary for making a decision. The determination of
the p-value depends on the use of the Normal Distribution tables. But if we don’t have a Z statistic, we
can’t use the Normal Distribution tables.
Two possible solutions
Solution 1: Take a large sample and use the sample standard deviation as a substitute for the population
standard deviation.
This is what statisticians of old did in the early 1900s. They took samples of 100-200, used the sample
standard deviation in place of the population standard deviation in the formula, and pretended that they had
a Z statistic. They then used the Normal distribution tables to determine p-values.
This procedure was technically incorrect, since the number they put in the Z-statistic formula was NOT the
actual population standard deviation but a sample quantity. But since the sample sizes they used were very
large, the value they substituted was probably quite close to the true value, and they probably computed pvalues that were very close to the correct ones.
So why not just keep on doing this – taking huge samples and pretending the statistic is a Z.
a. Huge samples cost a lot in terms of $ and time.
b. It just isn’t right.
Biderman’s P201Handouts
Topic 12: One Pop Tests Without Sigma - 2
5/4/2017
Solution 2. Figure out the correct sampling distribution of the statistic
X-bar - µH
? = ---------------------------------------S
--N
Note that the formula has S, rather than σ in the denominator. Note also that it’s not called Z, it’s called ?
because we don’t know what it is.
The computations necessary for Solution 2 were provided by a mathematician named William Gosset in the
early 1900s. He figured out what the sampling distribution of the above quantity was.
Gosset called the distribution the T distribution. He called the statistic the t statistic.
The Z and the T distributions are pictured below. Note first that they’re pretty similar. But careful
inspection shows a difference: The T distribution is more variable than the Z. The probability of a Z close
to 5, for example is essentially 0. But the probability of a t of 5 is substantial, as can be seen from the height
of the curve near 5.
Z
T
-5
Biderman’s P201Handouts
0
5
Topic 12: One Pop Tests Without Sigma - 3
5/4/2017
Degrees of freedom and variability of the T distribution
The T distribution is different from the Normal distribution in one other respect. Its variability decreases as
sample size gets larger.
Part of the formula for T distribution is the quantity, N-1. This value is called degrees of freedom. It is a
parameter in the T distribution, just as п and e are parameters of the Normal distribution.
In general, degrees of freedom, symbolized as df, equals N-1 for a single sample.
Getting back to the T distribution, as degrees of freedom increases, the variability of the T distribution gets
smaller. When degrees of freedom is very large, the T distribution looks more and more like, you
guessed it, the Normal Distribution. This validates the practice of the statisticians of old in using large
samples to estimate σ.
From Steinberg, p. 201
N=5
Gosset’s publication of his result.
The article describing the results concerning the t statistic was published under the pseudonym, Student.
The statistic has since been known as Student’s t.
Biderman’s P201Handouts
Topic 12: One Pop Tests Without Sigma - 4
5/4/2017
Critical t values
Since the T distribution is more variable than Z, we would expect t values to be farther from 0 than Z values
when the null hypothesis is true. Recall that a Z of 1.96 or larger would be unusual if the null were true.
But a t of 1.96 would not necessarily be so unusual.
Gosset’s calculations allowed statisticians to compute the true p-values associated with various values of t.
The formula he derived or one like it is used by all computer programs to compute p-values when t is used
as the test statistic.
Statistics textbooks publish tables of critical t values – the values of t whose p-values were exactly equal to
.05, .01 and other common significance levels.
A portion of the t Table from Steinberg, p. 201
If sample size
were equal to 41,
a t-value of 2.021
or larger would
be required to
reject the null.
1
If sample size were equal to 121,
a t-value of 1.980 or larger would
be required to reject the null.
This is all nice to know, but in the modern age, it’s only useful if you’re stranded on a deserted island.
In all other instances, our computer program will compute the p-value associated with the t.
Biderman’s P201Handouts
Topic 12: One Pop Tests Without Sigma - 5
5/4/2017
12
Worked Out Example
Data (The 25 survey responses from the problem described above were as follows . . .)
Biderman’s P201Handouts
Topic 12: One Pop Tests Without Sigma - 6
5/4/2017
Menu Sequence
Analyze -> Compare Means -> One-Sample T Test...
Talking to the t-test procedure
You MUST put the
hypothesized value of the
population mean in the [Test
Value] box. If you don’t, the t
value computed by SPSS will
be HORRIBLY wrong.
0
Biderman’s P201Handouts
Topic 12: One Pop Tests Without Sigma - 7
5/4/2017
The Output
T-Test
One-Sa mple Statistics
N
rat ing Rating of New
Se rice P roce dure
Me an
25
Std . Deviatio n Std . Erro r Me an
79 .52
15 .384
3.0 77
One-Sa mple Tes t
Te st Va lue = 70.4
95 % Co nfide nce Interval o f
the Diff erence
t
rat ing Ratin g of New
Se rice P roce dure
df
2.9 64
Sig . (2-tailed ) Me an Differe nce
24
.00 7
9.1 20
Lo wer
Up per
2.7 7
15 .47
SPSS computes a confidence interval for the population mean.
However, the interval is in deviation from the hypothesized mean. To make it more useable, add the Test
Value to each limit. (Yes – the test value.)
Actual lower limit = “Lower” + Test Value = 2.77 + 70.4 = 73.17
Actual upper limit = “Upper” + Test Value = 15.47 + 70.4 = 85.87
Conclusions
Hypothesis test conclusion
The sample mean is larger than the hypothesized mean. The p-value is less than .05, So we reject the null
hypothesis that the mean of the population of ratings of the new service procedure is 70.4 and conclude that
the mean is larger than 70.4.
Confidence interval conclusion
Lower limit = Test value + Lower = 70.4 + 2.77 = 73.17
Upper limit = Test value + Upper = 70.4 + 15.47 = 85.87
The probability is .95 that the population mean falls between 73.17 and 85.87.
Biderman’s P201Handouts
Topic 12: One Pop Tests Without Sigma - 8
5/4/2017
Example problem II
Suppose a manufacturer of radial tires claims that the average mileage of its tires is 40,000 miles. To test
the claim, you purchase 9 of the tires and run them until their tread reaches the minimum legal depth. The
number of miles for each of the tires is 36900, 33300, 35500, 32000, 37800, 40000, 43200, 39500, and
34900. Set up and test the appropriate hypothesis.
The Hypothesis Testing Answer sheet. This is the sheet you’ll be expected to fill out for each hypothesis
testing problem.
Describe the population or populations whose characteristics are being investigated.
Population of mileages of tires made by a particular manufacturer.
Population mean = 40000.
Null Hypothesis:_____________________________________________________________________
Formally state the
Population mean <> 40000.
Alternative Hypothesis:______________________________________________________________
Give the name and the formula of the test statistic that will be employed to test the null hypothesis.
One sample t statistic because we don’t know the value of the population standard deviation. If we did know the value of the
population SD, we’d use the Z statistic.
One sample t = (X-bar – 40000)/(S/sqrt(9))
What significance level will you use to separate "likely" value from "unlikely" values of the test statistic?
.05
Hint: .05 is a popular choice.________________________________________________________________________________
What is the value of the test statistic
computed from your data?
See below
-2.540
___________________________________________________________________
What is the probability of a value as extreme as the
.035
above value if the null hypothesis were true, i.e., the p-value?______________________________________________________
What is your conclusion?
Do you reject or not reject the null hypothesis?
Reject Null Hypothesis
_____________________________________________________________
What are the upper and lower limits of a 95% confidence interval appropriate for the problem? Present them in a sentence, with
standard interpretive language.
The probability is .95 that the interval, 34,298 to 39, 725 contains the population mean.
State the implications of your conclusion for the problem you were asked to solve. That is, relate your statistical conclusion to the
problem.
It appears that the manufacturer’s claim is incorrect. Our evidence suggests that the population mean is less than 40,000,
somewhere between 34,298 and 39,725.
Biderman’s P201Handouts
Topic 12: One Pop Tests Without Sigma - 9
5/4/2017
SPSS Computations for Tire Mileage Example Problem
What’s wrong with this??
THE TEST VALUE
SHOULD HAVE BEEN
40000, NOT 0.
T-Test
One-Sa mple Test
Te st Va lue = 0
95 % Co nfide nce I nterval of
the Diffe rence
mi les
t
31 .454
df
8
Sig . (2-t ailed ) Me an Differe nce
.00 0
37 011.1 1111
Lo wer
34 297.6 899
Up per
39 724.5 323
One-Sam ple Stati stics
N
mil es
9
Me an
Std . Deviatio n Std . Erro r Me an
370 11.1 111
353 0.02 990
117 6.67 663
One-Sa mple Test
Te st Va lue = 4000 0
95 % Co nfide nce I nterval of
the Diffe rence
mi les
t
-2. 540
df
8
Sig . (2-t ailed ) Me an Differe nce
.03 5
-29 88.8 8889
Lo wer
-57 02.3 101
Up per
-27 5.46 77
To form the 95% confidence interval, add the test value to the value under
Lower and to the value under Upper. So the 95% confidence interval is
34,297.69 to 39,724.53.
Biderman’s P201Handouts
Topic 12: One Pop Tests Without Sigma - 10
5/4/2017
Two-tailed vs. One-tailed alternative hypotheses. Module 17
If the null is false, there are actually three possible alternative hypotheses . . .
1:
Population mean does not equal the hypothesized value (e.g. Pop mean ≠ 5000)
2:
Population mean is only less than the hypothesized value (e.g., Pop mean < 5000)
3:
Population mean is only larger than the hypothesized value (e.g., Pop mean > 5000)
We usually have no preconceived notions concerning the direction of difference if the null is not true.
In those cases, we employ #1 above. It is called a two-tailed alternative hypothesis, and we compute the
p-value as the probability of an outcome as extreme as the obtained outcome in the positive or in the
negative direction.
On the other hand, if we know that there is no way that one of the two directions of difference could be
observed if the null were false, then we don't consider that outcome as a possibility, and we employ a onetailed alternative hypothesis. In doing so, we compute the p-value as the probability of an outcome as
extreme as the obtained outcome in only one direction.
Specifically, if the alternative hypothesis is represented only by outcomes which are more
positive than that represented by the null, then the p-value is the probability of an outcome as
extreme as the obtained outcome in the positive direction only.
And, if the alternative hypothesis is represented only by outcomes which are more
negative than that represented by the null, the p-value is the probability of an outcome as
extreme as the obtained outcome in the negative direction only.
Example: An experiment is designed to test the effect of consumption of a newly formulated
alcohol on time to react to complex traffic situations. Since there is a tremendous accumulation of
evidence that alcohol only slows decision times in complex situations, the two hypotheses would
like be:
Null:
Mean new alcohol reaction time = Mean No Alcohol reaction time
Alternative:
Mean new Alcohol reaction time > Mean No Alcohol reaction time.
In this case, the null would be rejected only if the test statistic were positive and p <= .05.
Computing a one-tailed p-value.
Employing such a decision rule requires some minimal hand computations when using standard
statistical packages. The p-value which is routinely printed by almost all common statistical packages,
including SPSS is the two-tailed version. To use it, we do the following . . .
1. Compute the one-tailed p by dividing the p-value displayed by SPSS by 2.
2. Reject if
a) the one-tailed p-value is <= the significance level
AND
b) the observed outcome is in the expected direction.
Otherwise, do not reject.
Biderman’s P201Handouts
Topic 12: One Pop Tests Without Sigma - 11
5/4/2017
Example – from Steinberg, p. 203
Arithmetic scores from Ms. Teachwell’s class.
Null Hypothesis: Mean of Ms. Teachwell’s population = 77.
Alternative Hypothesis: Mean of the population is larger than 77.
The data in SPSS
The One-Sample T Test dialog box
The One-Sample T Test Output
T-Test
One-Sample Statistics
N
Mean
testscor
30
Std. Deviation
79.80
Std. Error Mean
7.341
1.340
One-Sample Test
Test Value = 77
t
df
Sig. (2-tailed)
Mean Difference
95% Confidence Interval of the Difference
Lower
testscor
2.089
29
.046
2.800
Upper
.06
5.54
The one-tailed p-value is .046/2 = .023.
The p-value is <= .05 AND the sample mean is larger than 77, so reject the null hypothesis.
Biderman’s P201Handouts
Topic 12: One Pop Tests Without Sigma - 12
5/4/2017
The Hypothesis Testing Answer Sheet.
From Steinberg, p. 207, problem 2.
Betty, an employee of Shining Sun Daycare Center, read an article in Healthy Child Magazine saying that
the average 3-year-old child is 37 in. tall. She measured the height of each child who had just turned or was
about to turn 3 years old. Their heights in inches are: 41 40 36 42 39 38 33 44 39 41
Psychology 201 Hypothesis Testing Answer Sheet
Name_______________________________________
Assignment_______________________________________________________________
Problem _________
Describe the population or populations whose characteristics are being investigated.
Null Hypothesis:_____________________________________________________________________
Formally state the
Alternative Hypothesis:_______________________________________________________________
Give the name and the formula of the test statistic that will be employed to test the null hypothesis.
What significance level will you use to separate "likely" value from "unlikely" values of the test statistic?
Hint: .05 is a popular choice.________________________________________________________________________________
What is the value of the test statistic
computed from your data?
___________________________________________________________________
What is the probability of a value as extreme as the
above value if the null hypothesis were true, i.e., the p-value?______________________________________________________
What is your conclusion?
Do you reject or not reject the null hypothesis?
_____________________________________________________________
What are the upper and lower limits of a 95% confidence interval appropriate for the problem? Present them in a sentence, with
standard interpretive language. (Not required if the statistical test is chi-square or analysis of variance.)
State the implications of your conclusion for the problem you were asked to solve. That is, relate your statistical conclusion to the
problem.
Biderman’s P201Handouts
Topic 12: One Pop Tests Without Sigma - 13
5/4/2017