Presentation is loading. Please wait.

Presentation is loading. Please wait.

Go to index Two Sample Inference for Means Farrokh Alemi Ph.D Kashif Haqqi M.D.

Similar presentations


Presentation on theme: "Go to index Two Sample Inference for Means Farrokh Alemi Ph.D Kashif Haqqi M.D."— Presentation transcript:

1 Go to index Two Sample Inference for Means Farrokh Alemi Ph.D Kashif Haqqi M.D.

2 Go to index Summary Slide Review F test Test of two means –Small sample, equal varianceSmall sample, equal variance –Small sample, unequal varianceSmall sample, unequal variance –Small dependent sampleSmall dependent sample

3 Go to index Review Frequency distributions and descriptive statistics. Comparing an observation to a distribution. Comparing two distributions.

4 Go to index Objectives To learn how to compare two distributions. No need to know the formulas, focus on assumptions and interpretations. Be able to do the calculations using excel functions.

5 Go to index Which Test Is Right?

6 Go to index F Test Used to test if two population variances are equal. Assumes independent, random samples from populations with normal distributions. Test is conducted by taking the ratio of the variances (square of standard deviations). If the two variances are equal the ratio will be one. The larger value is always on top. Critical test values are determined using number of observations minus one for each sample.

7 Go to index Example Are nurses in government owned hospitals paid less than privately owned hospitals? From Bluman A. Elementary statistics. McGraw Hill, 1998.

8 Go to index Solution Hypothesis: variances are equal. Alternative hypothesis: variance are unequal. Critical value for two tailed F test at 9 and 7 degrees of freedom is 8.51. The F statistic is equal to 600*600/450*450 = 1.7. The null hypothesis is not rejected. Do this in Excel

9 Go to index Which Test Is Right?

10 Go to index Test of Two Means Small Sample, Equal Variance Normal population. Independent sample observations. Random sample. Unknown variance. Two distributions have same variance, as per F test.

11 Go to index Test of Two Means (Cont.) Small Sample, Equal Variance Test value is always calculated as: (observed value minus expected value) / standard deviation. In this case the observed value is the difference between two means. The expected value is zero as the two means are expected to be equal. What is the standard deviation of the difference?

12 Go to index Standard Deviation of Difference Equal Variance S d = square root {[(n 1 -1)s 1 * s 1 + (n 2 -1)s 2 * s 2 )] / n 1 +n 2 -2)]} * square root (1/ n 1 +1/ n 2 ). S d is standard deviation of the difference of means. n 1 is sample size and s 1 is standard deviation in 1 st distribution. n 2 is sample size and s 2 is standard deviation in 2 nd distribution.

13 Go to index Test of Two Means (Cont.) Small Sample, Equal Variance Decide if one tail or two tailed test. Critical values depend on sample sizes and are calculated at n 1 +n 2 -2 degrees of freedom. The hypothesis is rejected if the test value is larger than positive critical value or smaller than negative critical value. Do this in Excel

14 Go to index Which Test Is Right?

15 Go to index Test of Two Means Small Sample, Unequal Variance Normal population. Independent sample observations. Random sample. Unknown variance. Two distributions have different variance, as per F test.

16 Go to index Test of Two Means (Cont.) Small Sample, Unequal Variance Test value is always calculated as: (observed value minus expected value) / standard deviation. In this case the observed value is the difference between two means. The expected value is zero as the two means are expected to be equal. What is the standard deviation of the difference?

17 Go to index Standard Deviation of Difference Unequal Variance S d = square root (s 1 * s 1 /n 1 + s 2 * s 2 /n 2 ). S d is standard deviation of the difference of means. n 1 is sample size and s 1 is standard deviation in 1 st distribution. n 2 is sample size and s 2 is standard deviation in 2 nd distribution.

18 Go to index Test of Two Means (Cont.) Small Sample, Unequal Variance Decide if one tail or two tailed test. Critical values depend on the smaller sample size minus one. The hypothesis is rejected if the test value is larger than positive critical value or smaller than negative critical value.

19 Go to index Example Are nurses in government owned hospitals paid less than privately owned hospitals? From Bluman A. Elementary statistics. McGraw Hill, 1998. Do this in Excel

20 Go to index Solution Hypothesis:  1  2. Alternative hypothesis:  1   2. Critical value for  =0.01, one tailed test, with equal variances with 10+8-2 degrees of freedom is 2.583. Standard deviation of difference = 256. Test value = 5.47. Null hypothesis is rejected. Private hospitals do not pay nurses less than or equal to government hospitals.

21 Go to index Which Test Is Right?

22 Go to index Test of Two Means Small Dependent Sample Normal population. Dependent sample observations on same or matched case, before and after. Random selection of cases. Unknown variance. By definition, distributions before and after have same variance.

23 Go to index Test of Two Means (Cont.) Small Dependent Sample Test value is always calculated as: (observed value minus expected value) / standard deviation. The observed value is the mean of paired differences. The expected value is zero as the mean of the paired differences is zero when the two means are the same. What is the standard deviation of the difference?

24 Go to index Standard Deviation of Difference Small Dependent Sample S d = square root [  d 2 – (  d) 2 /n] /(n-1). S d = standard deviation of differences. d = paired difference for one case. n = number of paired differences. SE d = standard error of differences. SE d = S d /  n.

25 Go to index Test of Two Means (Cont.) Small Dependent Sample Decide if one tail or two tailed test. Critical values depend on the sample size minus one. The hypothesis is rejected if the test value is larger than positive critical value or smaller than negative critical value.

26 Go to index Example Did clinician improve risk score for his patient after switching their medication (Higher scores are better scores)?

27 Go to index Solution Hypothesis: mean  1 -  2 is greater than or equal to zero. Alternative hypothesis mean of difference is less than zero. Critical value for a one tailed t-distribution at 8-1=7 degrees of freedom is –1.895.

28 Go to index Solution: Compute Test Value Calculate sum of pair wise difference Calculate sum of squared pair wise differences

29 Go to index Solution: Computing Test Value Continued Compute mean as (  d)/n. Compute standard deviation as S d = square root [  d 2 – (  d) 2 /n] /(n-1). Compute standard error as SE d = S d /  n. Computer test statistic as mean (minus expected mean of zero) divided by standard error. Do this in Excel Hypothesis is not rejected.


Download ppt "Go to index Two Sample Inference for Means Farrokh Alemi Ph.D Kashif Haqqi M.D."

Similar presentations


Ads by Google