Topic 2. Distributions, hypothesis testing, and sample ...



Topic 2. Distributions, hypothesis testing, and sample size determination

The Student - t distribution (ST&D pg 56 and 77)

Consider a repeated drawing of samples of size n = 5 from a normal distribution. For each sample compute [pic] , s, [pic] , and another statistic, t:

t (n-1)= ([pic] - ()/[pic] (Remember Z = ([pic] - ()/[pic])

The t statistics is the number of standard error that separate [pic] and its hypothesized mean µ.

[pic]

Fig. 1. Distribution of t (df=4) compared to Z. The t distribution is symmetric, but wider and flatter than the Z distribution, lying under it at the center and above it in the tails.

[pic]

When N increases the t distribution tend towards the N distribution

2. 2. Confidence limits based on sample statistics (ST&D p.77)

The general formula for any parameter ( is:

Estimated ( ( Critical value * Standard error of the estimated (

So, for a population mean estimated via a sample mean:

[pic]

The statistic [pic] is distributed about μ according to the t distribution so it satisfies

P{[pic]- t (/2, n-1 [pic] ( ( ( [pic]+ t (/2, n-1 [pic]}= 1- (

For a confidence interval of size 1-α, use a t value corresponding to α /2.

Therefore the confidence interval is

[pic]- t (/2, n-1 [pic] ( ( ( [pic]+ t (/2, n-1 [pic]

These two terms represent the lower and upper 1- ( confidence limits of the mean. The interval between these terms is called confidence interval (CI).

Example: Data Set 1 of Hordeum 14 malt extraction values

[pic]= 75.94 [pic] = 1.23 / [pic] = 0.3279 A table gives the t0.025,13 value of 2.16

95% CI for ( = 75.94 ± 2.160 * 0.3279 ( [75.23- 76.65]

If we repeatedly obtained samples of size 14 from the population and constructed these limits for each, we expect 95% of the intervals to contain the true mean.

True mean

Fig. 2 Twenty 95% confidence intervals. One out of 20 intervals does not include the true mean.

2. 3. Hypothesis testing and power of the test (ST&D 94).

Example Barley data. [pic]= 75.94, [pic] =[pic]= 0.3279, t0.025,13 = 2.160, CI: [75.23- 76.65]

1) Choose a null hypothesis: Test Ho μ = 78 against the H1 μ ( 78.

2) Choose a significance level: Assign ( = 0.05

3) Calculate the test statistic t:

(interpretation: the sample mean is 6.3 SE from the hypothetical mean of 78. Too far!).

4) Compare the absolute value of the test statistic to the critical statistic:

| - 6.28 | > 2.16

5) Since the absolute value of the test statistic is larger, we reject H0.

This is equivalent to calculate a 95% confidence interval for the mean.

Since μo (78) is not within the CI [75.23- 76.65] we reject Ho.

α is called the significance level of the test (-1.072)=0.85 same as above!

The magnitude of ( depends on

1. The Type I error rate (

2. The distance between the two means under consideration

3. The number of observations (n) ( [pic]

When the distance between the two means is reduced, ( increases

Variation of power as a function of the distance between the alternative hypotheses (Biometry Sokal and Rohlf)

2.3.2. Power of the test for the difference between the means of two samples

Two types of alternative hypothesis

H0: (1 - (2=0 versus H1: (1 - (2 ( 0 (two tail test) -> (t value: top t Table)

H1: (1 - (2 >0 (one tail test) -> (t value: bottom t Table)

The general power formula for both equal and unequal sample sizes reads as:

[pic],

where [pic] is a weighted variance given by: [pic]

and [pic].

When n1 = n2 = n (equal sample sizes) that the formulas reduce to:

[pic]

[pic]

[pic]

The variance of the difference between two random variables is the sum of the variances (error are always added) (ST&D 113-115).

The degrees of freedom for the critical t (/2 are

General case: (n1-1) + (n2-1)

Equal sample size: 2*(n-1)

2. 4. 2 Sample size for estimating µ, when σ2 is known.

Using the z statistic

If the population variance σ2 is known the Z statistic may be used.

[pic] so CI = [pic] or [pic]

The formula for d= half-length of the confidence interval for the mean is

[ [pic] ] [pic]

This can be rearranged to estimate the confidence interval in terms of the population variance. For (=0.05:

n = z 2(/2 (2 / d2 = z 2(/2 ((/d)2 = (1.96)2((/d)2= 3.8((/d)2

So if d=( ( n (4 d= 0.5 ( ( n (16 d= 0.25 ( ( n (64

The equation may be expressed in terms

of the coefficient of variation

CV= s / [pic] (as a proportion not as a %)

d/μ is the confidence interval as a fraction of the population mean.

For example d/μ < 0.1 means that the length of the confidence interval should not be larger than two tenth of the population mean.

d/μ < 0.1 and so 2d/μ < 0.2

Example: The CVs of yield trials in our experimental station are never higher than 15%. How many replications are necessary to have a 95% CI for the true mean of less than 1/10 of the average yield?

2d= 0.1 so d= 0.1/2= 0.05

n= 1.962 0.152/0.052 = 34.6 ( 35

2. 4. 3 Sample size for the estimation of the mean Unknown (2. Stein's Two-Stage Sample

Consider a (1 - ()% confidence interval about some mean µ:

[pic]- [pic] ( ( ( [pic]+ [pic]

The half-length (d) of this confidence interval is therefore:

[pic]

This formula can be rearranged to estimate necessary sample size n

[pic]

Stein's Two-Stage procedure involves using a pilot study to estimate s2.

Note that n is now present at both sides of the equation: iterative approach

Example: An experimenter wants to estimate the mean height of certain plants. From a pilot study of 5 plants, he finds that s = 10 cm. What is the required sample size, if he wants to have the total length of a 95% CI about the mean be no longer than 5 cm?

Using n = t2 (/2,n-1 s2 / d2, n is estimated iteratively,

initial-n t5%, df n

5 2.776 (2.776)2 (10)2 /2.52 = 123

123 1.96 (1.96)2 (10)2 / 2.52 = 62

62 2.00 64

64 2.00 64

Thus with 64 observations, he could estimate the true mean with a CI no longer than 5 cm at (=0.05.

To accelerate the iteration you can start with Z:

n = z2 s2 / d2 = (1.96)2 (10)2 / 2.52 = 62

2. 4. 4 Sample size estimation for a comparison of two means

When testing the hypothesis Ho: μ ’ μo, we can take into account the possibility of a Type I and Type II error simultaneously.

To calculate n we need to known the alternative μ1 or at least the minimum difference we wish to detect between the means δ = |μo - μ1|.

The formula for computing n, the number of observations on each treatment, is:

n = 2 (( / δ)2 (Z(/2 + Z()2

For (= 0.05 and (= 0.20, zβ = 0.8416 and z (/2 = 1.96, (Z(/2 + Z()2=7.85 (8

We can define δ in terms of σ:

• If δ = 2σ, n ≈ 4

• If δ = 1σ, n ≈ 16

• If δ = 0.5σ, n ≈ 64

We rarely know (2 and must estimate it via sample variances:

[pic], where [pic]

n is estimated iteratively. If no estimate of s is available, the equation may be expressed in terms of the CV, and ( as a proportion of the mean:

n ( 2 [((/() / (δ/()]2 (Z(/2 + Z()2 ( 2(CV/(%)2(Z(/2 + Z()2

Example: Two varieties are compared for yield, with a previously estimated s2 = 2.25 (s=1.5). How many replications are needed to detect a difference of 1.5 tons/acre with a ( = 5%, and ( = 20%?

Approximate: n ( 2 ((/δ)2 (Z(/2 + Z()2 = 2 (1.5/1.5)2(1.96+0.8416)= 15.7

Then use n = 2 (s / δ)2 (t(/2 + t()2 to estimate the sample size iteratively.

|guesstimate n |df = 2(n - 1) |t0.025 |t0.20 |estimated n |

|16 |30 |2.0423 |0.8538 |16.8 |

|17 |32 |2.0369 |0.8530 |16.7 |

The answer is that there should be 17 replications of each variety.

2. 4. 5. Sample size to estimate population standard deviation

The chi-squared ((2) distribution is used to establish confidence intervals around the sample variance as a way of estimating the true, unknown population variance.

2. 4. 5. 1. The Chi- square distribution (ST&D p. 55)

[pic]

Distribution of (2 , for 2, 4, and 6 degrees of freedom.

Relation between the normal and chi-square distributions.

The χ2 distribution with df = n is defined as the sum of squares of n independent, normally distributed variables with zero means and unit variances.

(2α, df=1= Z2(0,1) α/2 ’ τ2 α/2, df=(

χ21, 0.05 = 3.84 and Z2(0,1), 0.025 = t2(, 0.025 = 1.962 = 3.84

Note: Z values from both tails go into the upper tail of the χ2 because of the disappearance of the minus sign in the squaring. For this reason we use ( for the (2 and (/2 for Z and t.

[pic]

If we estimate the parametric mean ( with a sample mean, we obtain:

[pic] …due to: [pic] ( [pic]

This expression, which has a χ2n-1 distribution, provides a relationship between the sample variance and the parametric variance.

2. 4. 5. 2. Confidence interval for (2

We can make the following statement about the ratio (n-1) s2/(2 that has(2n-1 distribution,

P { (21-(/2, n-1 ( (n-1) s2/(2 ( (2(/2, n-1} = 1 - (

Simple algebraic manipulation of the quantities in the inequality yields

P { (21-(/2, n-1 /(n-1) ( s2/(2 ( (2(/2, n-1/(n-1)} = 1 - (

which is useful when the precision of s2 can be expressed in terms of the % of (2.

Or inverting the ratio and moving (n-1):

P {(n-1) s2/ (2(/2, n-1 ( (2 ( (n-1) s2/ (21-(/2, n-1} = 1 - (

which is useful to construct 95% confidence intervals for σ2.

Example: What sample size is required to obtain an estimate of ( that deviates no more than 20% from the true value of ( with 90% confidence?

Pr {0.8 < s/( < 1.2} = 0.90 = Pr {0.64 < s2/(2 < 1.44} = 0.90

thus

(2(1 - (/2, n-1) / (n-1)= 0.64 and (2 ((/2, n-1) / (n-1)= 1.44

Since (2 is not symmetrical, the above two solutions may not identical for small n. The computation involves an arbitrary initial n and an iterative process:

| |df |1 - (/2 = 95% | |(/2 = 5% |

|n |(n-1) |(2(n-1) |(2(n-1) /(n-1) | |(2(n-1) |(2(n-1) /(n-1) |

|31 |30 |18.50 |0.616 | |43.8 |1.46 |

|41 |40 |26.50 |0.662 | |55.8 |1.40 |

|36 |35 |22.46 |0.642 | |49.8 |1.42 |

|35 |35 |21.66 |0.637 | |48.6 |1.43 |

Thus a rough estimate of the required sample size is ~ 36.

-----------------------

df=n-1=4

Critical values for |t|>|Z| -> less sensitivity. This is the price we pay for being uncertain about the population variance

[pic]

( between 2 means in SE units

[pic]

[pic]

[pic]

Ho is true

Ho is false

(/2

(

1-(

Acceptance Rejection

n=35

SE=0.7

n=5

SE=1.7

[pic]

d

d

[pic]

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download