Presentation is loading. Please wait.

Presentation is loading. Please wait.

Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means.

Similar presentations


Presentation on theme: "Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means."— Presentation transcript:

1 Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means

2 Hypothesis Testing: The Difference Between Two Population Means Hypothesis testing involving the difference between two population means is most frequently employed to determine whether or not it is reasonable to conclude that the population means are not equal. Using the same methodology, it is possible to test the hypothesis that the difference is equal to, greater than or equal to, or less than or equal to some value other than zero. In such cases, one of the following hypotheses may be formulated: H 0 : μ 1 – μ 2 = 0, H A : μ 1 – μ 2 ≠ 0 H 0 : μ 1 – μ 2 ≥ 0, H A : μ 1 – μ 2  0 H 0 : μ 1 – μ 2 ≤ 0, H A : μ 1 – μ 2  0

3 A) When we withdraw two samples from two populations that are normally distributed with known σ 1 and σ 2 Test statistic for the null hypothesis of equal population means (H 0 : μ 1 – μ 2 = 0, H A : μ 1 – μ 2 ≠ 0) is: The subscript H indicates that the difference is a hypothesized parameter (in this case (μ 1 -μ 2 ) H =0).  x 1  x 2 z z   (x1  x2 )  (1  2 )H(x1  x2 )  (1  2 )H  2121   2222 n1n2n1n2

4 Example Researchers are interested to know if there is any difference in the mean uric acid levels between normal individuals and individuals with Down’s syndrome. They collected samples from each population and uric acid level were determined in each samples. Analysis results are summarized below: Assume that samples were drawn from normally distributed population with variance equal to 1 for the Down’s syndrome population and 1.5 for the normal population. A)Construct the proper hypothesis to test if there is significant difference between the two population means; B)Test your constructed hypothesis using the experimental data. C)Decide on your hypothesis and D)Conclude on the difference in mean uric acid levels between the two studied populations E)Calculate the P-value Normal individualsWith Down’s Syndrome Number of volunteers1512 Uric acid sample mean (mg/100 mL) 4.53.4

5 Example We are interested in any significant difference, so we consider the null hypothesis with equal means H 0 : μ 1 – μ 2 = 0, H A : μ 1 – μ 2 ≠ 0 An alternative way of stating the hypothesis is as follows H 0 : μ 1 = μ 2, H A : μ 1 ≠ μ 2 The test statistic is: Calculation of the test statistic: z  x 1  x 2   (x1  x2 )  (1  2 )H (x1  x2 )  (1  2 )H  2121   2222 n1n2n1n2 z X N  X D   (x N  x D )  (  N   D ) H  2 2   2D2D NnNnD NnNnD  11.511.5 1215  (4.5  3.4)  0 1.1 (4.5  3.4)  0 1.1  2.57 0.4282

6 Example Decision rule: We use the z-stat. Let α=0.05, the critical values of z are 1.96 and -1.96. Reject H 0 unless -1.96  z  1.96 Statistical decision to reject H 0 since +2.57  +1.96 Conclude that on the basis of the data, there is an indication that the two population means are not equal. P-value: 0.0102 (the area to the right of 2.57 and the left of - 2.57 )

7 B) When we withdraw two samples from two populations that are NOT normally distributed (σ 1 and σ 2 are unknown) andthe sample size is large Test statistic for the null hypothesis of equal population means (H 0 : μ 1 – μ 2 = 0, H A : μ 1 – μ 2 ≠ 0) is: The subscript H indicates that the difference is a hypothesized parameter (in this case (μ 1 -μ 2 ) H =0).  z  (x1  x2 )  (1  2 )Hz  (x1  x2 )  (1  2 )H s  s 2 2 221221 n1n2n1n2 If we have no idea about the normality of the parent distributions and their parameters, we use the CLT to justify our use of the z-table to find the reliability coefficient. We use the samples standard deviations to calculate the standard error of the difference. This is only true for large samples  X  X 1212  s X  X 1212 2 1 2 2  [(s / n )  (s / n )]

8 Example A study was designed to test the effect of disability on the beneficiary effects of health promotion. The researchers developed a scale for testing this effect (BHADP), the scale was administered to a sample of 132 disabled (D) and 137 nondisabled (ND) subjects with the following results: The authors wish to know if they may conclude on the basis of these results that, in general, disabled persons, on the average, score higher on the BHADP scale. Construct the proper hypothesis and test it. Note: use a significance level of 1%. SampleMean ScoreStandard Deviation D31.837.93 ND25.074.80

9 Example The statistics were computed from two independent samples that behave as simple random samples from a normally distributed population of disabled persons and a population of nondisabled persons. Since the population variances are unknown, we will use sample variances in the calculation of the test statistic. Since we have large samples, the central limit theorem allows us to use z as a test statistic. Hypotheses : H 0 : μ D – μ ND ≤ 0 H A : μ D – μ ND > 0 or alternatively: H 0 : μ D ≤ μ ND H A : μ D > μ ND Disabled scores are higher!!  z  (x1  x2 )  (1  2 )Hz  (x1  x2 )  (1  2 )H s  s 2 2 221221 n1n2n1n2

10 Decision rule: Let α=0.01. this is a one-tailed (right) test with critical value of z equal to 2.33 (from SND tables, Z 0.99 ). Reject H 0 since z computed = 8.42 > 2.33 The data indicate that, on average, disabled persons score higher on the BHADP scale than do nondisabled person. For this test, p  0.001 (very highly significant) 132137 (7.93) 2 (4.80) 2  Reject H 0 if z computed ≥2.33 Calculation of the test statistic: z  (31.83  25.07)  0  8.42

11 C) When we withdraw two samples from two populations that are normally distributed (σ 1 and σ 2 are unknown) and the sample size is small Parent pops: Normally distributed Variance for pops: Unknown Sample size: Small We can not use the z-distribution in this case. We need to use the t-table to find the critical values and we need to use standard deviations of the two samples to find the standard error in the t-score calculation. Important note in this case: The calculation of the standard error from s 1,n 1 and s 2, n 2 depend on the equality of the parent populations variances C.1) If they are equal: we use t- distribution C.2) If they are not equal: we use the t’-distribution

12 C.1) When we withdraw two samples from two populations that are normally distributed (σ 1 and σ 2 are unknown and equal) and the sample size is small In this case, we need to consider the samples variances + to use t-table. Since the sample variance is dependent on the sample size, we need to take this into consideration for samples with different sizes (n) to calculate the pooled estimate of the common variance NOTE: If the sample size for both independent samples is equal, we take directly the arithmetic mean of the two samples variances (simple average). The standard error of the estimate will be: The test statistic for testing H 0 : μ 1 = μ 2 is given by: p s2s2  (n1)s2  (n1)s21122(n1)s2  (n1)s21122 n 1  n 2  2   s X 1  X 2  s 2p2p n 1  s 2p2p n 2 [ This formula pools both sample variances with their corresponding weight that based on the sample size] For critical values: We use the t-table with D.F= n 1 +n 2 -2  t  (x1  x 2 )  (1  2 )Ht  (x1  x 2 )  (1  2 )H  s2s2s2s2 p ppn1n2ppn1n2

13 Example In a study to investigate the lung destruction in cigarette smokers, a lung destructive index was measured in a sample of lifelong nonsmokers and smokers. A larger score indicates greater lung damage. The data is summarized below: We wish to know if we may conclude that smokers, in general, have greater lung damage measured by this destructive index than do nonsmokers? Assuming that the lung destructive index scores in both populations are approximately normally distributed with equal variances, construct the proper hypothesis and test it. Non-smokerssmokers Number of volunteers916 Average score12.417.5 Standard deviation4.84924.4711

14 Example Hypotheses: H 0 : μ S ≤ μ NS, H A : μ S  μ NS Test statistic (t-test with pooled variance): x NS p n S  9,x S  17.5, S S  4.4711............. n NS  16,  12.4, S NS  4.8492 2 ss S (n S  1)s  (n NS 2 n S  n NS  1)s8(4.8492)  15(4.4711) 2  223  21.2165  s 2p2p nSnS  s 2p2p n NS 21.2165  21.2165 916 t  (x S  x NS )  (  S   NS ) 0  (17.5  12.4)  0  2.6573

15 Example t 0.95 =1.714 for DF:23 α=5% (0.05) Confidence=95% AUC -∞  t 0.95 Critical values and Decision rule: let α=0.05 (right-tailed test). the critical values of t is +1.714 (from table with D.F=23, cumm. prop=95%). Reject if t caclulated >1.714

16 Example Statistical decision: we reject H 0 because 2.6573 >1.714 (falls in the rejection zone). Conclusion: we conclude that smokers may have greater lung damage than nonsmokers. α=5% (0.05) t calc =2.6573 t 0.95 =1.714 for DF:23 p value: 0.01>P>0.005, since 2.500  2.6573  2.8073 t calc =2.6573

17 C.2) When we withdraw two samples from two populations that are normally distributed (σ 1 and σ 2 are unknown and NOT equal) and the sample size is small We can not use the t-table to find the critical values for D.F= n 1 +n 2 -2. Solution: Instead of finding the critical values from the tables, we need to compute it taking into consideration the critical values for each sampling distributions and the weight of each sample. 1 / 21 / 2 t't'  w 1 t 1  w 2 t 2 1 w  w 2 1 w w  s 2121 n 1 2 ww 2 s2s2 n 2 t 1  t 1   / 2....... for: n 1  1 t 2  t 1   / 2....... for: n 2  1 How to compute the critical values for two-tailed test? 11 t't'  w 1 t 1  w 2 t 2 1 w  w 2 1 w w  s 2121 n 1 2 ww 2 s2s2 n 2 t 1  t 1  ....... for: n 1  1 t 2  t 1  ....... for: n 2  1 How to compute the critical values for one-tailed test? _ (x  x )  (    ) t  12 12 0 s2s2s2s2 1  2 n 1 n 2 An d we use S 1 and S 2 in the formula of t-test

18 α/2=2.5% (0.025) t 1 / 21 / 2 '  w 1 t 1  w 2 t 2 1 w  w 2 1 w w  s 2121 n 1 2 ww s 2 2 n 2 t 1  t 1   / 2....... for: n 1  1 t 2  t 1   / 2....... for: n 2  1 t 1-α/2= t 97.5%= t 0.975 α=5% (0.05) 11 t't'  w 1 t 1  w 2 t 2 w  w 1212 1 w w  1 s2s2 n 1 w 2 22 s2s2 n 2 t 1  t 1 ....... for: n 1  1 t 2  t 1 ....... for: n 2  1 For a two sided test, reject H 0 if the computed value of t is either greater than or equal to the critical values t` (1-α/2) or less than or equal to the negative of that value. t 1-α= t 95%= t 0.95 For a one-sided test with the rejection region in the right tail of the sampling distribution, reject H 0 if the computed t is equal to or greater than the critical t` 1-α. For a one-sided test with the rejection region in the left tail of the sampling distribution, reject H if the computed t is equal to or smaller than the negative of the critical t` 1-α 0 computed.

19 Example The research team want to know if they can conclude that the two population means are different. Assuming that both populations are approximately normally distributed, construct the proper hypothesis and test it?. Researchers wish to know if two populations differ with respect to the mean value of the total serum complement activity (C H50 ). The data consist of C H50 determinations on apparently normal subjects (n 2 =20 ) and subjects with disease (n 1 =10 ). The sample means and standard deviations are: _ s 1  33.8 s 2  101.1 x 1  62.6 _ x 2  47.2 The populations are normally distributed with unknown variances that are unequal. With this in mind we will use t’-stat.

20 Example Hypothesis: H 0 : μ 1 – μ 2 = 0 H A : μ 1 – μ 2 ≠ 0 Test statistic: _ t  (x 1  x 2 )  (1  2 )0t  (x 1  x 2 )  (1  2 )0 s  s 2 2 221221 n 1 n 2 We obtain the critical value by the equation: 1212 t`t` w ww w  w 1 t 1  w 2 t 2 (1   ) 2 Two-tailed test!!

21 Example t '1 / 2'1 / 2 12 w  w114.244  5.1005  w 1 t 1  w 2 t 2  114.244(2.2622)  5.1005(2.0930)  2.255 1 ww s 2121 n 1 33.833.8 2 10  114.244 s 2 2 w 2  n 2 10.1 2 20  5.1005 t 1  t 1   / 2....... for : n 1  1...........  2.2622 t 2  t 1   / 2....... for : n 2  1..........  2.0930 Using t-table with DF=9 and cumm prop=0.975 (let α=0.05) Using t-table with DF=19 and cumm prop=0.975 (let α=0.05)

22 Since we found the t` (1-α/2) to be equal to 2.255, our critical values will be ± 2.255 (two-tailed test) Our decision rule is reject H 0 if the computed t is either ≥2.255 or ≤- 2.255. Calculation of the test statistic: Statistical decision: since -2.255  1.41  2.255, we can not reject the H 0. On the basis of these results we can not conclude that the two population means are different. The p value of this test  0.05 t t  (62.6  47.2)  0  (33.8)2(10.1)2(33.8)2(10.1)2 1020  15.4 10.92  1.41

23 Paired Comparisons Previously we discussed the difference between two population means assuming that the samples were independent. Some times we may want to assess the effectiveness of a treatmentor experimental procedure making use of observations resulting from nonindependent samples. A hypothesis test based on this type of data is called a paired comparison test.

24 Why do we need paired test?? The objective in paired comparison tests is to eliminate maximum number of sources of extraneous variations by making the pairs similar with respect to as many variables as possible. Not PairedPaired To study the effect of gold nanoparticles in treating tumors, we induce tumor and then target it with gold nanoparticles which serve as “nanoheaters” upon radiation with laser. In “Not Paired” case, we use two groups that one receives gold nanoparticles and the other does not (control). The difference between treated and control may be due simply a difference in external characteristics between the mice in both groups. To eliminate this difference, we can use one group of mice and induce two identical tumors in the same mouse as you see in the picture to the right. Or we can use the same mice with before/after strategy. Example laserlaserNo laser laser No laser

25 Why do we need paired test?? Related or paired observations may be obtained in a number of ways: – The same subjects may be measured before and after receiving some treatment. – Same subjects with part of their bodies (treatment/control, previous slide) – In comparing two methods of analysis, the material to be analyzed may be divided equally so that one half is analyzed by one method and one half is analyzed by another.

26 Paired Test Instead of performing the analysis with individual observations, we use d i, the difference between pairs of observations as the variable of interest. When the n sample differences computed from the n pairs of measurements constitute a simple random sample from a normally distributed population of differences, the test statistic for testing hypothesis about the population mean difference μ d is: d   d t  0 S d /n where: d is the mean for sample differences 0  d is the hypothesized population mean differe S d is the standard deviation of the sample differe n is the number of sample differences

27 Paired Test The t statistic is distributed as Student’s t with n-1 degrees of freedom (this is the general case but not always!!). We do not have to worry about the equality of variances in paired comparisons, since our variable is the difference in the reading of the same subject or object. If the population variance of the difference is known, we can use z-stat (this is not applicable always) If the assumption of normality for the distribution of the differences can not be made, we can use large n and thus use the CLT to justify our use of the z-stat (we approximate σ by the use of sample S)

28 Example In a study to evaluate the effect of very low calorie diet (VLCD) on the weight of 9 subjects, the following data was collected before (B) and after (A) treatment: The researchers wish to know if these data provide sufficient evidence to allow them to conclude that the treatment is effective in causing weight reduction in those individuals. Assuming that differences between A&B are approximately normally distributed, construct the proper hypothesis and test it (you need to know that this is paired t-test!!!!!)?. B (Kg) 117.3111.498.6104.3105.4100.481.789.578.2 A (Kg) 83.385.975.882.982.377.762.76963.9

29 Example We may obtain the differences in one of two ways: by subtracting the before weights from the after weights (A – B) or by subtracting the after weights from the before weights (B – A). If we choose (d i =A – B), the differences are: -34, -25.5, -22.8, -21.4, -23.1, -22.7, -19, -20.5, -14.3 Assumptions: the observed differences constitute a simple random sample from a normally distributed population of differences with unknown variance (t-test). Hypotheses: H 0 : μ d ≥ 0 H A : μ d  0 (left-tailed test) (indicating weight reduction)

30 Example Hypotheses (for (d i =A – B)) : H 0 : μ d ≥ 0 H A : μ d  0 (left-tailed test) (indicating weight reduction) NOTE: If we had obtained the differences by subtracting the after weights from the before weights (B – A) our hypotheses would have been: H 0 : μ d ≤ 0 (right-tailed test) H A : μ d > 0 (indicating weight reduction) If the question had been such that a two-tailed test was indicated (any difference/change), the hypotheses would have been: H 0 : μ d = 0 H A : μ d ≠ 0

31 Example The test statistic: -1.860, reject H 0 if the computed t is less than or equal to the critical value. d   d t  0 S d /n Decision rule: Let α=0.05, the critical value of t is d d  di203.3di203.3 n 9n 9   2 2.5 889 d 2 ss  (d i  d) 2 n 1n 1  2 8.2 961 t t   2 2.5 88 9  0 2 8.2 961 9   1 2.74 Reject H 0, since -12.7395 is in the rejection reg We may conclude that the diet program is effect -1.860=-t 1-α =-t 0.95 (n-1=8) α=5% (0.05) t' calc =-12.74 P-value<0.001 since - 12.74<-5.041 see the table H 0 : μ d ≥ 0


Download ppt "Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means."

Similar presentations


Ads by Google