CS计算机代考程序代写 1

1

Introduction, 1 sample t-test and t-interval

87 individuals were given a flu vaccination. After 28 days, blood samples were taken to assess the
concentration of antibody (X) in their serum.

Some summary statistics for the sample are as follows.

n = 87, X̄ = 1.689, s = 1.549.

Assume that the sample is from a normal population with mean µ and variance σ2.

2

Confidence interval for the mean of a normal population

The form of the 100(1− α) % confidence interval for µ is

x̄± tα/2,n−1
s

n

where tα/2,n−1 is the upper α/2 percentage point of the t distribution with n− 1 degrees of freedom.

• To find a 99% CI, α = .01, so α/2 = .005

• n = 87, so there are 86 degrees of freedom

• t.005,86 ≈ t.005,75 = 2.643
(using 75 degrees of freedom, which is the df nearest 86 from t table in Deveaux et al). If you
are using Devore, the closest df is 60, which gives t.005,60 = 2.660.

• lower confidence limit = 1.689− 2.643(1.549)/

(87) = 1.25.

• upper confidence limit = 1.689 + 2.643(1.549)/

(87) = 2.13.

• The 99% CI for µ is (1.25,2.13).

The confidence coefficient is the number 1− α (or the percentage 100(1− α)).

The statement that “the probability that µ lies in (1.25,2.13)” is .99 is INCORRECT

The only interpretation of the confidence coefficient is that among the collection of all such
intervals, 100(1− α) % of them will contain the true but unknown mean µ.

3

Hypothesis test for the mean of a normal population

In general, we test the null hypothesis H0 : µ = µ0, where µ0 is some specified value.

The test statistic used is a standardized form of X̄,

t =
X̄ − µ0
s/

n

This has a t-distribution with n − 1 degrees of freedom if the population sampled is normal with
mean µ0 and unknown variance.

Let tobs be the observed value of t. The p-value calculations for the test of H0 : µ = µ0 against
the three possible alternative hypotheses HA are given in the following table.

HA p-value

µ > µ0 P (tn−1 > tobs)
µ < µ0 P (tn−1 < tobs) µ 6= µ0 2P (tn−1 > |tobs|)

where tn−1 denotes a t random variable with n− 1 degrees of freedom. The probabilities are approx-
imated using the t-table.

eg. test H0 : µ1 = 2 against the alternative HA : µ1 < 2. Find the p-value and report your conclusion when testing at level of significance α = .05. (Recall that the level of significance is the probability that the test will lead to a type 1 error - that the null hypothesis is incorrectly rejected). n = 87, X̄ = 1.689, s = 1.549, so tobs = (1.689− 2)/(1.549/ √ 87) = −1.87 The p-value is the probability that a t variable with 86 degrees of freedom is less than -1.87. • Go to the t-table. Approximate using 75 degrees of freedom, which is the df closest to 86. • The t-distribution is symmetric about 0. Therefore the probability that t < −1.87 is the same as the probability that t > 1.87.

• From the table P (t75 > 1.665) = .05 and P (t75 > 1.992) = .025. Therefore the p-value is
between .025 and .05.

• If p-value < α, reject the null hypothesis in favour of HA at level of significance α, otherwise do not reject H0. Conclusion: reject H0 at level .05. 4 What is the p-value if we test H0 : µ1 = 2 against the two sided alternative HA : µ1 6= 2? tobs = −1.87 as before. The p-value for the two sided alternative is 2P (t86 > | − 1.87|) ≈ 2P (t90 > 1.87).

We just saw that .025 < P (t90 > 1.87) < .05, so .05 < p− value < .1. Do not reject H0 in favour of the two sided alternative at level .05. Recall that in general, the p-value is the probability of obtaining a sample presenting at least as much evidence against the null hypothesis as does the observed data, when in fact, the null hypothesis is true. Thus a small p-value is taken as evidence against the null hypothesis. bsmith Highlight bsmith Highlight bsmith Highlight 5 Here’s a minitab computer output. The 87 observations are in column C9. MTB > onet c9;

SUBC> confidence .99;

SUBC> test 2.

One-Sample T: C9

Test of mu = 2 vs not = 2

Variable N Mean StDev SE Mean 99% CI T P

C9 87 1.689 1.549 0.166 (1.252, 2.126) -1.87 0.065

Relationship of p-values to significance tests: The null hypothesis is rejected in favour of
the alternative at level α if and only if the p-value is less than α.

6

Another confidence interval example: Suppose we evaluate vitamin C levels (mg/100 gm) in 8
batches of corn soy blend (CSB) from a production run and get:

26 31 23 22 11 22 14 31

Find a 95% confidence interval for the mean vitamin C content of CSB produced during this run.

X̄ ± tα/2,n−1
s

n

Summary statistics are:
n = 8
x̄ =


xi

n
= 22.50

s2 =

(xi−x̄)2
n−1 = 51.714, so s = 7.19

• (1− α) = .95, α/2 = .025, ν = n− 1 = 7 and
tα/2,ν = t.025,7 = 2.365 from the table.

• U = 22.50 + 2.365(7.19√
8
) = 22.50 + 6.012 = 28.5

• L = 22.50− 2.365(7.19√
8
) = 22.50− 6.012 = 16.5

• 95% Confidence Interval for µ: (L, U) = (16.5, 28.5)