STA258 Lecture 10
Estimator
Confidence Intervals
Example:
σ 1 2 = σ 2 2 = σ 2
S p 2 = ( n 1 − 1 ) S 2 + ( n 2 − 1 ) S 2 2 n 1 + n 2 − 2
C I = ( Y ¯ 1 − Y ¯ 2 ) ± t ( α 2 , ? ) S p 1 n 1 + 1 n 2
Mutual funds purchases.
Can investors do better by buying mutual funds directly rather than through brokers?
We have a random sample of net annual returns through brokers and directly.
Find a 95 % CI for μ 1 − μ 2
μ 1 is direct
μ 2 is broker
Assume σ 1 2 = σ 2 2 and annual returns are normal.
We get that n 1 = 50 = n 2
x ¯ 1 = 6.63
x ¯ 2 = 3.72
s 1 2 = 37.49
s 2 2 = 43.34
Pooled Variance
S p 2 = ( 49 ) ( 37.49 ) + ( 49 ) ( 43.34 ) 50 + 50 − 2
ν = 50 + 50 − 2 = 98
t ( α 2 ; 98 ) = 1.984
C I = ( 6.63 − 3.72 ) ± 1.984 40.42 ( 50 − 1 + 50 − 1 )
C I = 2.91 ± 2.52
μ 1 = μ d = direct
μ 2 = μ b = broker
Since 0 is not included, this means the difference is not negligible.
Because our difference is positive, it means that μ d > μ b . So direct is better.
If μ d = μ b ⟹ μ d − μ b = 0
Since μ d − μ b > 0 ⟹ μ d > μ b so that's why it's better.
How sure can we be sure that direct is better than broker?
95 100 times we will have a better return directly. But how strongly can we be confident in this? #tk something about hypothesis testing.
Since our interval is almost including 0 . We need to worry about it:
If we have ( 0.00000001 , 5.43 ) , it's almost 0
If we have ( 3 , 5.43 ) , it's pretty far away from 0
( 0.39 , 5.43 ) isn't as close to 0 as the first example, but it's almost there.
Suppose σ 1 ≠ σ 2
C I = ( Y ¯ 1 − Y ¯ 2 ) ± t ( α 2 ; ν ) S 1 2 n 1 + S 2 2 n 2
We don't pool it because we need to account for different variance.
ν = ( S 1 2 n 1 + S 2 2 n 2 ) 2 ( 1 n 1 − 1 ) ( S 1 2 n 1 ) 2 + ( 1 n 2 − 1 ) ( S 2 2 n 2 ) 2
This is the Welch method. Easier to do with R .
Otherwise, you can do:
min ( n 1 − 1 , n 2 − 1 )
This will widen the T Distribution , and will give a conservative answer for your CI.
Example:
A company sells edu materials.
A consultant has a 3 rd grade glass of n = 21 for 8 weeks.
This is a treatment group
We need a control group, so we have m = 23 3 rd grade students without the materials.
At the end, both groups are given a DRP test to measure.
Treatment Control 24 61 59 46 | 42 44 46 37 …
Find a 95 % CI for the mean improvement.
C I = ( Y ¯ T − Y ¯ C ) ± t ⋆ S T 2 n T + S C 2 n C
Conservative approach ⟹ ν = 20
1 − α = 0.95 ⟹ α 2 = 0.025
t ( 0.025 ; 20 ) = 2.086
C I = ( 51.48 − 41.52 ) ± 2.086 ( 4.31 )
The lower bound of mean improvement is barely anything. The higher bound is really effective.
But otherwise, 0 ∉ C I , so it is effective.
Since 0.87 is pretty close to 0 , how strongly can we know if it would include it or not?
We also need to know what the test is, does 0.87 mean 0.87 marks, or percent? Could it be rounded down?
Not caring about domain knowledge is very dangerous:
You could end up with a case like the memes about "What they did in the study showing red meat causes cancer" and it's just a video of someone launching cannonballs in a catapult.
Outcomes are valid, but interpretations matters in application of it.
Assumption in the above 3 rd grader thing is important too. That the population is normal. We'd need to do a Normal Q-Q Plot . To see if it's normal.
We don't have evidence for normality by the chart, but we don't have evidence against it.
Example:
Conservationsist example
12 unlogged forests
9 , 8
Unlogged: 22 18 22 20 15 21 13 13 19 13 19 15
Logged: 17 4 18 13 18 15 15 10 12
Create a 99 % CI on difference in mean
C I = ( Y ¯ U − Y ¯ L ) ± t ( α 2 ; ν ) S 1 2 n + S 2 2 m
Y ¯ 1 − Y ¯ 2 = 3.83
S 1 = 3.52
S 2 = 4.5
n = n 1 = 12
m = n 2 = 9
S 1 2 n + S 2 2 m = 1.81
ν = min ( 12 − 1 , 9 − 1 ) = 8
C I = 3.83 ± t ( α 2 ; ν ) ( 1.81 )
t ⋆ = 3.35
C I = 3.83 ± ( 3.35 ) ( 1.81 )
= 3.83 − ( 3.35 ) ( 1.81 ) = − 2.2335
= 3.83 + ( 3.35 ) ( 1.81 ) = 9.8935
Does logging have an impact?
Paired Samples
Compare two tires
Auto 1 2 3 4 5 A 10.6 9.8 12.3 9.7 8.8 B 10.2 9.4 11.8 9.1 8.3
Do the data provide evidence in mean wear for tire types A and B
Mounted on the same car, but when we get the difference, it's independent.
First find the difference.
Auto 1 2 3 4 5 A 10.6 9.8 12.3 9.7 8.8 B 10.2 9.4 11.8 9.1 8.3 0.4 0.4 0.5 0.6 0.5 X ¯ = 0.48
d ¯ = 0.48
S d = 0.0837
C I = 0.48 ± ( 2.776 ) 0.0837 5
0.48 ± 0.1039
The interval is positive and doesn't contain 0 so there is a difference between these two tires.
Comparing two proportions
C I
n = 1178
Notes whether mother has epidural, do the babies still nurse after 6 months
p 1 = those who had an epidural and are nursing at 6 months
p 2 = those who didn't who are nursing at 6 months
Nursing at 6 months Epidural Y N Y 206 190 N 498 284
First find the Point Estimator s for two proportions.
P ^ 1 =
= 206 206 + 190 = 103 198 = 0.52020202020202
P ^ 2 =
= 498 498 + 284 = 249 391 = 0.636828644501279
Without doing a confidence interval , it seems we already have a pretty big difference.
SE [ X ] = ( 0.52 ) ( 1 − 0.52 ) 396 + ( 0.64 ) ( 1 − 0.64 ) 782 = 0.0304126977809148
C I = ( 0.52 − 0.64 ) ± ( 1.96 ) ( 0.0304126977809148 )
Since 0 is not in the interval, and we have a negative difference. It means that epidural means the baby will nurse likelier than another.
There's an abundance of women who haven't had an epidural. Why are there different sample sizes, make one sample size match the other.
The impact is n 2
The numbers aren't balanced. They're getting weighed by the sample sizes.
Extreme sample:
Control group is 1000 people
What would happen to the Confidence Intervals ?
It would be smaller, but we don't have balance in the dataset regarding those who had an epidural.
We are 95 % confident that percent of nursing is mothers at 6 months for those who had an epidural are between 0 % and 17 % less than those who didn't.
Example:
Smoking
We have 244 smokers who want to stop to receive nicotine patches
245 receive both a path and the anti-depressant
After a year 40 in the nicotine group had abstained
87 in the patch plus drug group have.
Give a 99 % CI for the difference, t − c in the proportion of smokers who quit.
Find the Point Estimator for proportions
P ^ 1 =
P ^ 2 =
= 87 245 = 87 245 = 0.355102040816327
Already we see that there are a lot more who quit in the treatment group.
1 − α = 0.99
α = 0.01
α 2 = 0.01 2 = 0.005
SE [ X ] = ( 0.16 ) ( 1 − 0.16 ) 244 + ( 0.36 ) ( 1 − 0.36 ) 245 = 0.0386164192461763
Z α 2 = 2.575829
( 0.36 − 0.16 ) + ( 2.575829 ) ( 0.0386164192461763 ) = 0.299469292570459
( 0.36 − 0.16 ) − ( 2.575829 ) ( 0.0386164192461763 ) = 0.100530707429541
There is a benefit. Because 0 ∉ C , if 0 ∈ C then the difference is 0 and there aren't benefits.
You don't remove someone from another group if someone withdrew from the first.
If you remove someone, then you need to start the experiment again from day 0.
You don't extend it to day 60 for the initial
You don't have the effects through 10 days with the new guy if you add one.
Comparing two population variances
S 1 2 σ 1 2 S 2 2 σ 2 2 ∼ F ( n 1 − 1 , n 2 − 2 )
P ( F ( n 1 − 1 , n 2 − 1 ; 1 − α 2 ) ≤ σ 1 2 S 1 2 σ 2 2 S 2 2 ≤ F ( n 1 − 1 , n 2 − 2 ; α ) ) = 1 − α
Compare the ratio of σ 1 2 σ 2 2
P ( S 1 2 S 2 2 1 F ( n 1 − 1 , n 2 − 1 ; α 2 ) ≤ σ 1 2 σ 2 2 ≤ S 1 2 S 2 2 1 F ( n 1 − 1 , n 2 − 1 ; 1 − α 2 ) )
We know that F ( n 1 , n 2 ) = 1 F ( n 2 , n 1 )
P ( S 1 2 S 2 2 1 F ( n 2 − 1 , n 1 − 1 ; 1 − α 2 ) ≤ σ 1 2 σ 2 2 ≤ S 1 2 S 2 2 F ( n 2 − 1 , n 1 − 1 ; α 2 ) ) = 1 − α
Example:
Managerial success
Index based on length of time in the org, and level within the term.
Compare group 1, high volume of interactions with people.
Group 2, rarely interact with people outside their work unit.
μ G 1 = 65.3
μ G 2 = 49.5
Is there a significant difference?
Already, yes.
However, we don't know about the index, so we don't know if 15 points is or isn't really significant.
( 6.61 2 9.33 2 ( 3.09 ) , 6.61 2 9.33 2 ( 3.29 ) )
( 0.16 , 1.68 )
There is not a significant variance based on our C I . Because 1 ∈ C I
No evidence to show that the population variances of managerial success index is different.
σ 1 2 σ 2 2 = 1 ⟺ σ 1 2 = σ 2 2