Docsity

Interval Estimation, Exercises of Statistics

Partial preview of the text

Download Interval Estimation and more Exercises Statistics in PDF only on Docsity!

Topic 16

Interval Estimation

Confidence Intervals for Means

Outline

Overview

Means

z intervals

t intervals

Two Sample t intervals

Overview

The random set ˆC (X ) is chosen to have a prescribed high probability, γ, of containing the true parameter value θ. Pθ{θ ∈ Cˆ (X )} = γ.

C^ ˆ (x) is called a γ-level confidence set. For a single parameter, the typical choice of confidence set is a confidence interval

Cˆ (x) = (ˆθ`(x), θˆu (x)).

Often this interval takes the form (ˆθ(x) − m(x), θˆ(x) + m(x)) = ˆθ(x) ± m(x) where the two statistics,

  • (^) θˆ(x) is a point estimate, and m(x) is the margin of error.

Means

For X 1 .X 2.... Xn normal random variables, unknown mean μ, known variance σ 02 ,

Z = X¯ − μ σ 0 / √ n is a standard normal. For any α between 0 and 1, let zα satisfy P{Z > zα} = α or equivalently

P{Z ≤ zα} = 1 − α.

The value is known as the upper tail prob- ability with critical value zα. We compute this in R with qnorm(0.975) for α = 0.025.^0 − 3 − 2 − 1 0 1 2 3

zα

area α

Means

For X 1 .X 2.... Xn normal random variables, unknown mean μ, unknown variance σ^2. If, in the z statistic, we replace the variance σ^2 with its unbiased estimate s^2 , then the statistic is known as t: t = ¯x − μ s/

n

The expression s/

n which estimates the standard deviation of the sample mean is called the standard error.

  • Let S^2 be the unbiased sample variance. The distribution of ( ¯X − μ)/(S/

n) is known exactly and depends on n, the number of observations.

  • We typically give the distribution in terms of the degrees of freedom, which, in this case is n − 1.

t Intervals

This give a confidence interval

¯x ± tn− 1 ,(1−γ)/ 2 s √ n

(top) The density of the standard normal (black) and t (blue) random variable with 4 degrees of freedom.

(bottom) The distribution function of the standard normal (black) and t (blue) random variable with 4 degrees of freedom.

Exercise. The additional uncertainty arising from the need to estimate the standard deviation results in the t distribution having a larger variance. Explain how this can be seen in the two pairs of plots.

-3 -2 -1 0 1 2 3

x

density

-3 -2 -1 0 1 2 3

x

density

-3 -2 -1 0 1 2 3

x

probability

-3 -2 -1 0 1 2 3

x

probability

t Intervals

morley is the classical data set of Michelson on measurements done in 1879 on the speed of light. The data consist of five experiments, each consisting of 20 consecutive runs. The response is the speed of light measurement, suitably coded in km/sec, with 299000 subtracted.

mean(morley$Speed) [1] 852. sd(morley$Speed) [1] 79. qt(0.975,99) [1] 1.

Based on these data, the 95% confidence interval is

299 , 852. 4 ± 1. 9842

the interval (299836. 7 , 299868 .1). This interval does not in- clude 299,792.458 km/sec, the presently accepted value. Exercise. Find the 90% and 98% confidence interval.

t Intervals

Often, confidence intervals are determined by

  • finding the variance of the point estimator
  • (^) and using the normal approximation as given via the central limit theorem.
  • In the cases in which the variance is unknown, the distribution variance is replaced with the variance estimated from the observations. In this case, the procedure that is analogous to the standardized score is called the studentized score.

A level γ confidence interval has the form

estimate ± t∗^ × standard error

where t∗^ is the upper 1 − 2 γcritical value for the t distribution with the appropriate number of degrees of freedom.

Two Sample t Intervals

  • (^) Two samples. For independent samples,

E [ ¯X 1 − X¯ 2 ] = μ 1 − μ 2 and Var( ¯X 1 − X¯ 2 ) = σ 12 n 1

σ 22 n 2

Let s 1 and s 2 be, respectively, the standard deviation of the first and second samples. Then, the confidence interval for μ 1 − μ 2 is

x¯ 1 − x¯ 2 ± tν,(1−γ)/ 2

s 12 n 1

s 22 n 2

In this case, the the corresponding studentized random variable does not have a t distribution. However, Welch and Satterthwaite have provided an approximation to the t distribution with effective degrees of freedom ν.

Two Sample t Intervals

Malaria is a mosquito-borne infectious disease caused by parasitic protozoans. A transgenic line of mosquitoes was developed to interfere with the ability of mosquitoes to metabolize a blood meal. Let’s use R to create a 95% confidence interval for the difference in mean lifetimes of wildtype and transgenic mosquitoes.

t.test(wildtype,transgenic) Welch Two Sample t-test data: wildtype and transgenic t = 2.4106, df = 169. 95 percent confidence interval: 0.7676486 7. sample estimates: mean of x mean of y 20.78409 16.

Exercise. Use the given number of de- grees of freedom and the means from the output to give the 95% confidence interval in the output. The standard de- viations are 12.99 for the wildtype data and 10.78 for the transgenic data. The number of observations are 88 for the wildtype data and 99 for the transgenic data.