Confidence intervals using the t distribution

Download Report

Transcript Confidence intervals using the t distribution

Confidence intervals using the t
distribution
Chapter 6
t scores as estimates of z scores;
t curves as approximations of z curves
Estimated standard errors
CIs using the t distribution
Testing the no effect (null) hypothesis)
t scores indicate the distance and
direction of a score from the sample
mean.
• t scores are computed like Z scores.
• Simply substitute X for mu and s for sigma.
That is, substitute estimates for parameters.

X  mu 
Z
sigma

X X
t
s
More t scores
• As long as the raw scores are obtained from a
random sample, then t scores are least squares,
unbiased, consistent estimators of what the Z
scores would be if we had all the scores in the
population.
Any score can be translated to a t scores as long as
you can estimate mu and sigma with X-bar and s.
Body and tails of the curve
• The body of a curve is the area enclosed in a
symmetrical interval around the mean.
• The tails of a curve are the two regions of the curve
outside of the body.
• The critical values of the t curves are the number of
estimated standard deviations one must go from the
mean to reach the point where 95% or 99% of the
curve is in the body and 5% or 1% is in the two tails
combined.
• The critical values of the t curve change depending on
how many df there are for MSW and s.
We can define a curve by stating
its critical values
• The Z curve can be defined as one of the family of
t curves in which 95.00% of the curve falls within
1.960 standard deviations from the mean and
99.00% falls within 2.576 standard deviations
from the mean.
• We can define t curves in terms of how many
estimated standard deviations you must go from
the mean before the body of the curve contains
95% and 99% of the curve and the combined
upper and lower tails contain 5% and 1%
respectively.
t curves
• t curves are used instead of the Z curve when you are
using samples to estimate sigma2.
• Since we are estimating sigma instead of knowing it,
t curves are based on less information than the z
curve.
• Therefore, t curves partake somewhat of the
rectangular (“I know nothing”) distribution and tend
to be flatter than the Z curve.
• The more degrees of freedom for MSW, the better our
estimate of sigma2.
• The better our estimate, the more t curves resemble Z
curves.
t curves and degrees of freedom
F
r
e
q
u
e
n
c
y
Standard
deviations
5 df
1 df
score
3
2
1
0
1
2
To get 95% of the population in the body of the curve when
there are 5 df of freedom, you go out over 3 standard deviations.
To get 95% of the population in the body of the curve when there
is 1 df of freedom, you go out over 12 standard deviations.
3
Critical values of the t curves
• The following table defines t curves with
1 through 10,000 degrees of freedom
• Each curve is defined by how many estimated
standard deviations you must go from the mean to
define a symmetrical interval that contains a
proportions of .9500 and .9900 of the curve, leaving
proportions of .0500 and .0100 in the two tails of the
curve (combined).
• Values for .9500/.0500 are shown in plain print.
Values for .9900/.0900 and the degrees of freedom
for each curve are shown in bold print.
df
.05
.01
1
12.706
63.657
2
4.303
9.925
3
3.182
5.841
4
2.776
4.604
5
2.571
4.032
6
2.447
3.707
7
2.365
3.499
8
2.306
3.355
df
.05
.01
9
2.262
3.250
10
2.228
3.169
11
2.201
3.106
12
2.179
3.055
13
2.160
3.012
14
2.145
2.997
15
2.131
2.947
16
2.120
2.921
df
.05
.01
17
2.110
2.898
18
2.101
2.878
19
2.093
2.861
20
2.086
2.845
21
2.080
2.831
22
2.074
2.819
23
2.069
2.807
24
2.064
2.797
df
.05
.01
25
2.060
2.787
26
2.056
2.779
27
2.052
2.771
28
2.048
2.763
29
2.045
2.756
30
2.042
2.750
40
2.021
2.704
60
2.000
2.660
df
.05
.01
100
1.984
2.626
200
1.972
2.601
500
1.965
2.586
1000
1.962
2.581
2000
1.961
2.578
10000
1.960
2.576
Using the t table
You can answer things like:
• If we have 13 degrees of freedom then how far do we have to
go above the mean in order to have only 5% of the curve left
in the tails? Out to a t score of 2.160
• How many estimated standard deviations do we have to go out
in order to leave 1% of the scores in the tails with 3 degrees of
freedom?
5.841
• With 10 degrees of freedom and a critical value of .05, is a t
score of -2.222 inside the body or the tail of the t curve? How
about with 11 df.
With 10 df, inside the body. With
11 df outside the body in the tail.
• What are the critical values of a t curve with 20 df? 2.086 at
.95/.05 and 2.845 at .99/.01.
Estimated distance of sample means from mu:
estimated standard errors of the mean
• We can compute the standard error of the mean
when we know sigma.
– We just have to divide sigma by the square root of n,
the size of the sample
• Similarly, we can estimate the standard error of
the mean, the estimated average unsquared
distance of sample means from mu.
– We just have to divide s by the square root of n, the size
of the sample in which we are interested
Note that the estimated standard error is
determined by only two factors: the estimated
average unsquared distance of scores from mu
(s) and the size of the sample (n).
sX  s / n
•
•
•
•
•
•
•
•
•
s
n
sX  s / n
A 2.83
B 12.00
C 20.00
8
8
8
1.00 = 2.83/2.83
4.24 = 12.00/2.83
7.07 = 20.00/2.83
D
E
F
G
1
2
8
40
2.83
2.00
1.00
0.45
2.83
2.83
2.83
2.83
=
=
=
=
2.83/1.00
2.83/1.41
2.83/2.83
2.83/6.32
Confidence intervals using the
t distribution
There are two reasons to create confidence
intervals with the t distribution
• 1. To test a theory about what mu is. (We
call the theoretical population means muT).
• THAT’S THE IMPORTANT REASON
AND WE WILL LEARN ABOUT IT
FIRST
• 2. The other reason is to define an interval
in which we are confident mu would fall if
we knew it.
Confidence intervals around muT
Confidence intervals and hypothetical means
• We frequently have a theory about what the
mean of a distribution should be.
• To be scientific, that theory about mu must
be able to be proved wrong (falsified).
• One way to test a theory about a mean is to
state a range where sample means should
fall if the theory is correct.
• We usually state that range as a 95%
confidence interval.
• To test our theory, we take a random sample from
the appropriate population and see if the sample
mean falls where the theory says it should, inside
the confidence interval.
• If the sample mean falls outside the 95%
confidence interval established by the theory, the
evidence suggests that our theoretical population
mean and the theory that led to its prediction is
wrong.
• When that happens our theory has been falsified.
We must discard it and look for an alternative
explanation of our data.
For example:
• For example, let’s say that we had a new
antidepressant drug we wanted to peddle.
Before we can do that we must show that
the drug is safe.
• Drugs like ours can cause problems with
body temperature. People can get chills or
fever.
• We want to show that body temperature is
not effected by our new drug.
Testing a theory
• “Everyone” knows that normal body temperature
for healthy adults is 98.6oF.
• Therefore, it would be nice if we could show that
after taking our drug, healthy adults still had an
average body temperature of 98.6oF.
• So we might test a sample of 16 healthy adults,
first giving them a standard dose of our drug and,
when enough time had passed, taking their
temperature to see whether it was 98.6oF on the
average.
Testing a theory - 2
• Of course, even if we are right and our drug has no
effect on body temperature, we wouldn’t expect a
sample mean to be precisely 98.600000…
• We would expect some sampling fluctuation
around a population mean of 98.6oF.
• So, if our drug does not cause change in body
temperature, the sample mean should be close to
98.6. It should, in fact, be within the 95%
confidence interval around muT, 98.6.
• SO WE MUST CONSTRUCT A 95%
CONFIDENCE INTERVAL AROUND 98.6o
AND SEE WHETHER OUR SAMPLE MEAN
FALLS INSIDE OR OUTSIDE THE CI.
To create a confidence interval around muT,
we must estimate sigma from a sample.
• We randomly select a group of 16 healthy
individuals from the population.
• We administer a standard clinical dose of our new
drug for 3 days.
• We carefully measure body temperature.
• RESULTS: We find that the average body
temperature in our sample is 99.5oF with an
estimated standard deviation of 1.40o (s=1.40).
• IS 99.5oF. IN THE 95% CI AROUND MUT???
Knowing s and n we can easily compute
the estimated standard error of the mean.
• Let’s say that s=1.40o and n = 16:
• sX  s / n
= 1.40/4.00 = 0.35
• Using this estimated standard error we can
construct a 95% confidence interval for the
body temperature of a sample of 16 healthy
adults.
We learned how to create confidence intervals with
the Z distribution in Chapter 4.
95% of sample means will fall in a symmetrical
interval around mu that goes from 1.960 standard
errors below mu to 1.960 standard errors above mu
• A way to write that fact in statistical language is:
CI.95: mu + ZCRIT* sigmaX-bar
or
CI.95: mu - ZCRIT* sigmaX-bar < X-bar < mu + ZCRIT* sigmaX-bar
For a 95% CI, ZCRIT = 1.960
But when we must estimate sigma with s, we must
use the t distribution to define critical intervals
around mu or muT.
Here is how we would write the formulae
substituting t for Z and s for sigma
CI95: muT + tCRIT* sX-bar
or
CI.95: muT - tCRIT* sX-bar < X-bar < muT + tCRIT* sX-bar
Notice that the critical value of t that includes 95%
of the sample means changes with the number of
degrees of freedom for s, our estimate of sigma,
and must be taken from the t table.
If n= 16 in a single sample, dfW=n-k=15.
df
.05
.01
1
12.706
63.657
2
4.303
9.925
3
3.182
5.841
4
2.776
4.604
5
2.571
4.032
6
2.447
3.707
7
2.365
3.499
8
2.306
3.355
df
.05
.01
9
2.262
3.250
10
2.228
3.169
11
2.201
3.106
12
2.179
3.055
13
2.160
3.012
14
2.145
2.997
15
df
.05
.01
17
2.110
2.898
18
2.101
2.878
19
2.093
2.861
20
2.086
2.845
21
2.080
2.831
22
2.074
2.819
23
2.069
2.807
24
2.064
2.797
df
.05
.01
25
2.060
2.787
26
2.056
2.779
27
2.052
2.771
28
2.048
2.763
29
2.045
2.756
30
2.042
2.750
40
2.021
2.704
60
2.000
2.660
df
.05
.01
100
1.984
2.626
200
1.972
2.601
500
1.965
2.586
1000
1.962
2.581
2000
1.961
2.578
10000
1.960
2.576
16
2.131 2.120
2.947 2.921
So, muT=98.6, tCRIT=2.131, s=1.40, n=16
Here is the confidence interval
CI.95: muT + tCRIT* sX-bar =
= 98.6 + (2.131)*(1.40/ 61 ) =
= 98.6 + (2.131)*(1.40/4)
= 98.6 + (2.131)(0.35) = 98.60+ 0.75
CI.95: 97.85 < X-bar < 99.35
Our sample mean was 99.5o F. It falls outside the
CI.95 and falsifies the theory that our drug has no
effect on body temperature. Our drug may cause a
slight fever.
Testing the no-effect (null) hypothesis
• Specify what you believe the value of a statistic will be if
your idea of the situation is correct. In this case, you
specified muT=98.6o F.
• Define a 95% Confidence Interval around that value of
your test statistic.
• See if the test statistic falls inside the CI.95
• If it falls within the CI.95, you retain the no-effect
hypothesis
• If it falls outside the CI.95, you reject the no effect
hypothesis.Further, if you then have to guess what the true
value of the test statistic is in the population as a whole,
you chose the value that was found in the random sample.
You try one
• Instead of the results we just got, lets say we
studied a sample of 9 randomly selected
participants under the same conditions as in the
example above and again found that the sample
mean (X-bar) was 99.5oF and s=1.40. Compute
the 95% confidence interval around 98.6?
• Can you falsify the hypothesis that your new drug
has no effect on body temperature now?
df
.05
.01
1
12.706
63.657
2
4.303
9.925
3
3.182
5.841
4
2.776
4.604
5
2.571
4.032
6
2.447
3.707
7
2.365
3.499
8
df
.05
.01
9
2.262
3.250
10
2.228
3.169
11
2.201
3.106
12
2.179
3.055
13
2.160
3.012
14
2.145
2.997
15
2.131
2.947
16
2.120
2.921
df
.05
.01
17
2.110
2.898
18
2.101
2.878
19
2.093
2.861
20
2.086
2.845
21
2.080
2.831
22
2.074
2.819
23
2.069
2.807
24
2.064
2.797
df
.05
.01
25
2.060
2.787
26
2.056
2.779
27
2.052
2.771
28
2.048
2.763
29
2.045
2.756
30
2.042
2.750
40
2.021
2.704
60
2.000
2.660
df
.05
.01
100
1.984
2.626
200
1.972
2.601
500
1.965
2.586
1000
1.962
2.581
2000
1.961
2.578
10000
1.960
2.576
2.306
3.355
muT=98.6, tCRIT=2.306, s=1.40, n=16
Here is the confidence interval
CI.95: muT + tCRIT* sX-bar =
98.6 + (2.306)*(1.40/ 9
)=
98.6 + (2.306)(1.40/3)
=98.6+ (2.306)(0.47) = 98.60+ 1.08
CI.95: 97.52 < X-bar < 99.68
This time, the mean of our smaller sample (99.5oF)
falls inside the CI.95. These data are consistent
with the hypothesis that our drug has no effect on
body temperature.
Notice what happened
• When decreased from 16 to 9, both the critical
value for t and the size of the standard error
increased. The confidence interval therefore
became wider (less precise) and we failed to
falsify the “no effect” hypothesis.
• That’s fine for us in this case. But the FDA would
probably not accept the smaller study because it is
not sensitive enough (lacks sufficient power to
reject a fale “no effect” hypothesis
• The general rule is”the bigger the n, the more
sensitive the study.” That is, larger studies give
you greater power to reject false hypotheses.
In fact, we usually want to falsify the “no
effect” hypothesis
• Let’s say we were studying our drug’s ability to
cause positive benefits (e.g., make depressed
peoples’ moods better).
• We would want to be able to falsify the hypothesis
of “no effect.”
• The “no effect” hypothesis is formally called “the
null hypothesis.”
• So usually, having a more sensitive, more
powerful study that forces the null hypothesis to
be more precise, would be desirable.
• We’ll see the null hypothesis again and again from
Chapter 8 on.
• THE FOLLOWING MATERIAL IS LESS
IMPORTANT AND WILL ONLY BE
GONE OVER IF THERE IS EXTRA
TIME. MAKE SURE YOU
UNDERSTAND TESTING THE NO
EFFECT HYPOTHESIS BEFORE GOING
ON.
Interval estimates for mu based
on a random sample
Since Chapter 1 you have been making
least squared, unbiased estimates
• You have learned to predict that everyone
would score at a specific point. This is
called “making point estimates.”
• The point estimates have been wrong in a
least squared, consistent, unbiased way.
• If you want to be right, not wrong, you can’t
make point estimates, you must make
interval estimates.
Interval estimates of mu
• As you know, X-bar is our least squared,
unbiased, consistent estimate of mu.
• To create an interval estimate of mu, we
create a symmetrical interval around X-bar.
• We usually create 95% and/or 99% CIs to
define that interval.
The generic formula for
confidence intervals for mu
CI: X-bar + tCRIT* sX-bar
or
CI: X-bar - tCRIT* sX-bar < mu< X-bar+ tCRIT* sX-bar
If we use the critical values of t at .95 we will have
an interval that includes mu if our sample is one
of the 95% that falls within a 95% CI around mu.
If we use the critical values of t at .99 we will have
an interval that includes mu if our sample is one
of the 95% that falls within a 99% CI around mu.
Here is an example
• Let’s say (because professors know everything)
that I knew that the average height of all male
Rutgers Juniors is 70.0 inches (5’10”)
• I assign you, the student to take a sample of 16
male Rutgers Juniors and measure their height.
• Then you must define an interval in which mu
should be found.
• You find that X-bar = 69.3” and s = 2.00 inches.
df
.05
.01
1
12.706
63.657
2
4.303
9.925
3
3.182
5.841
4
2.776
4.604
5
2.571
4.032
6
2.447
3.707
7
2.365
3.499
8
2.306
3.355
df
.05
.01
9
2.262
3.250
10
2.228
3.169
11
2.201
3.106
12
2.179
3.055
13
2.160
3.012
14
2.145
2.997
15
df
.05
.01
17
2.110
2.898
18
2.101
2.878
19
2.093
2.861
20
2.086
2.845
21
2.080
2.831
22
2.074
2.819
23
2.069
2.807
24
2.064
2.797
df
.05
.01
25
2.060
2.787
26
2.056
2.779
27
2.052
2.771
28
2.048
2.763
29
2.045
2.756
30
2.042
2.750
40
2.021
2.704
60
2.000
2.660
df
.05
.01
100
1.984
2.626
200
1.972
2.601
500
1.965
2.586
1000
1.962
2.581
2000
1.961
2.578
10000
1.960
2.576
16
2.131 2.120
2.947 2.921
So, X-bar=69.3, tCRIT=2.131, s=2.00, n=16
Here is the 95% confidence interval
CI.95: X-bar + tCRIT* sX-bar =
= 69.3 + (2.131)*(2.00/ 61 ) =
= 69.3 + (2.131)*(2.00/4)
= 69.3 + (2.131)(0.50) = 69.30+ 1.16
CI.95: 68.14 < mu< 70.46
In this example, we knew mu ahead of time (70.0)
and the computations were just an exercise. But
exercise or not, our interval does include mu.
Here is a 99% CI with the same data
X-bar=69.3, tCRIT=2.947, s=2.00, n=16
CI.99: X-bar + tCRIT* sX-bar =
= 69.3 + (2.947)*(2.00/4)
= 69.3 + (2.947)(0.50) = 69.30+ 1.47
CI.99: 67.83 < mu< 70.77
Of course, since we have to go further out into the
tails of the curve to include 99% of the sample
means, the interval for the CI99 is wider (less
precise) that the interval for the CI.95 .
You try these
• Instead of the results we just got, lets say we
studied a sample of 25 randomly selected male
Rutgers Juniors and again found that the sample
mean (X-bar) was 69.3 inches and s=2.00.
Compute the 95% confidence and 99% confidence
intervals for mu given these data.
• Would you expect the intervals to be wider or
narrower that those you found for n=16?
df
.05
.01
1
12.706
63.657
2
4.303
9.925
3
3.182
5.841
4
2.776
4.604
5
2.571
4.032
6
2.447
3.707
7
2.365
3.499
8
2.306
3.355
df
.05
.01
9
2.262
3.250
10
2.228
3.169
11
2.201
3.106
12
2.179
3.055
13
2.160
3.012
14
2.145
2.997
15
2.131
16
2.120
2.921
df
.05
.01
17
2.110
2.898
18
2.101
2.878
19
2.093
2.861
20
2.086
2.845
21
2.080
2.831
22
2.074
2.819
23
2.069
2.807
24
df
.05
.01
25
2.060
2.787
26
2.056
2.779
27
2.052
2.771
28
2.048
2.763
29
2.045
2.756
30
2.042
2.750
40
2.021
2.704
60
2.000
2.660
df
.05
.01
100
1.984
2.626
200
1.972
2.601
500
1.965
2.586
1000
1.962
2.581
2000
1.961
2.578
10000
1.960
2.576
2.947
2.064
2.797
So, X-bar=69.3, tCRIT=2.064, s=2.00, n=25
Here is the 95% confidence interval
CI.95: X-bar + tCRIT* sX-bar =
= 69.3 + (2.064)*(2.00/ 52 ) =
= 69.3 + (2.064)*(2.00/5)
= 69.3 + (2.064)(0.40) = 69.30+ 0.83
CI.95: 68.47 < mu< 70.13
The interval is getting narrower isn’t it.
Here is a 99% CI with the same data
X-bar=69.3, tCRIT=2.947, s=2.00, n=16
CI.99: X-bar + tCRIT* sX-bar =
= 69.3 + (2.797)*(2.00/5)
= 69.3 + (2.797)(0.40) = 69.30+ 1.12
CI.99: 68.18 < mu< 70.748
Notice that the CI .99 with n=25 is almost
exactly as wide as the CI .95 with n=16.