Presentation is loading. Please wait.

Presentation is loading. Please wait.

T-tests and ANOVA using JMP Kristopher Patton April 7, 2015 *http://gipedu.org/virginia-polytechnic- institute-state-university-virginia-tech/

Similar presentations


Presentation on theme: "T-tests and ANOVA using JMP Kristopher Patton April 7, 2015 *http://gipedu.org/virginia-polytechnic- institute-state-university-virginia-tech/"— Presentation transcript:

1 T-tests and ANOVA using JMP Kristopher Patton April 7, 2015 *http://gipedu.org/virginia-polytechnic- institute-state-university-virginia-tech/

2 Laboratory for Interdisciplinary Statistical Analysis Collaboration From our website request a meeting for personalized statistical advice Great advice right now: Meet with LISA before collecting your data Short Courses Designed to help graduate students apply statistics in their research Walk-In Consulting OSB 103: Mon. – Fri. from 1:00 to 3:00 GLC Room A: Tues., Thurs., Fri. from 10:00 to 12:00 Hutcheson 403-J: Wed. from 10:00 to 12:00 All services are FREE for VT researchers. We assist with research—not class projects or homework. LISA helps VT researchers benefit from the use of Statistics www.lisa.stat.vt.edu Designing Experiments Analyzing Data Interpreting Results Grant Proposals Using Software (R, SAS, JMP, Minitab...)

3 Hypothesis Test 3 A hypothesis test is a detailed protocol for decision-making concerning a population by examining a sample from that population.

4 Hypothesis Tests vs. Criminal Trials 4 Burden of Proof—Obligation to shift the conclusion using evidence Trial Hypothesis Test Innocent until proven guilty Assume the initial hypothesis is true until the data suggests otherwise

5 Steps in a Hypothesis Test 1. Test 2. Assumptions 3. Hypotheses 4. Mechanics 5. Conclusion 5

6 One Sample t-Test Used to test whether the population mean is different from a specified value. 6

7 Medical Example In a glaucoma study, the following intraocular pressure (mm Hg) values were recorded from a sample of 21 elderly subjects. Based on this data, can we conclude that the mean intraocular pressure of the population from which the sample was drawn differs from 14 mm Hg?* 7 Intraocular Pressure 14.512.91416.11217.514.1 12.917.91216.424.212.214.4 171018.520.816.214.919.6 *Wayne, D. Biostatistics: A Foundation for Analysis in the Health Sciences. 5 th ed. New York: John Wiley & Sons, 1991.

8 Assumptions The data are randomly sampled from the population. The data are approximately normally distributed. Our data are representative of the variable of interest, which is also referred to as the response variable.

9 Hypotheses

10 For hypothesis testing there are three versions for testing that are determined by the context of the research question. Left Tailed Hypothesis Test (less than) Right Tailed Hypothesis Test (greater than) Two Tailed or Two Sided Hypothesis Test (not equal to)

11 Mechanics

12 Test Statistic for Medical Example 12 Test statistic for a one sample t-test

13 Test Statistic for Medical Example

14 P-value

15

16

17 Medical Example

18 Conclusion

19 Summary of One Sample t-test 19 2-Tailed TestRight-TailedLeft Tailed Null hypothesis Alternative hypothesis

20 Importing Data into JMP 20 *http://nuke.progettiesistemi.com/Simpl eBusiness/tabid/97/Default.aspx

21 Egyptian Skulls Data Set Four measurements of male Egyptian skulls from 5 different time periods. Thirty skulls are measured from each time period. Variables MB: Maximal Breadth of Skull BH: Basibregmatic Height of Skull BL: Basialveolar Length of Skull NH: Nasal Height of Skull Year: Approximate Year of Skull Formation (negative = B.C., positive = A.D.) 21 *Thomson, A. and Randall-Maciver, R. (1905) Ancient Races of the Thebaid, Oxford: Oxford University Press. *http://members.ozemail.com.au/~rdun lop/CoplandMain/MathsLG/CollandEnt DataLG.htm

22 Hypothesis Test for a Single Mean in JMP JMP Demonstration Open data set. Analyze  Distribution Complete the dialog box as shown and select OK. Select the red arrow next to “Pressure” and select Test Mean. Complete Dialog box as shown and select OK. Select the red arrow next to “Pressure” and select Confidence Interval->0.95. 22

23 Two Sample T-Test The major goal is to determine whether a difference exists between two populations. Examples: Compare blood pressure for male and females. Compare the proportion of smokers and nonsmokers with lung cancer. Compare weight before and after treatment. Is the mean cholesterol of people taking drug A lower than the mean cholesterol of people taking drug B? 23

24 Hypotheses for 2 Samples The population means of the two groups are not equal. H 0 : μ 1 = μ 2 H a : μ 1 ≠ μ 2 The population mean of group 1 is greater than the population mean of group 2. H 0 : μ 1 = μ 2 H a : μ 1 > μ 2 The population mean of group 1 is less than the population mean of group 2. H 0 : μ 1 = μ 2 H a : μ 1 < μ 2 24

25 Two Sample Assumptions The two samples are random and independent. The populations from which the samples are drawn are approximately normal. The populations have the same standard deviation. 25

26 Test Statistic for TWO Samples 26

27 Summary: Two Sample t-Test 27 2-Tailed TestRight-TailedLeft Tailed Null Alternative Assumption: The populations from which both samples are drawn are normal or approximately normal.

28 VA Lung Cancer Data Set Veteran's Administration lung cancer trial. Variables stime: Survival of follow-up time in days. status: Dead or Censored. treat: Treatment type of either Standard or Test. age: Patient’s age in years. Karn: Karnofsky score of patient's performance on a scale of 0 (dead) to 100 (perfectly normal). diag.time: Time since diagnosis in months at entry to the trial. cell: One of four cell types. prior: Did the patient receive prior therapy? 28 *Kalbfleisch, J.D. and Prentice R.L. (1980) The Statistical Analysis of Failure Time Data. Wiley. *http://lungcancernewst oday.com/2015/03/05/f da-grants-licensing- application-to-opdivo- for-the-treatment- advanced-squamous- nsclc/

29 JMP JMP Demonstration: Analyze  Fit Y By X Y, Response: Karnofsky Score (Karn) X, Factor: Treatment (treat) Select: Means/ANOVA/Pooled t 29

30 Paired t-Test The objective of paired comparisons is to minimize sources of variation that are not of interest in the study by pairing observations with similar characteristics. Example: A researcher would like to determine if background noise causes people to take longer to complete math problems. The researcher gives 20 subjects two math tests one with complete silence and one with background noise and records the time each subject takes to complete each test. 30

31 Hypotheses for Paired t-Test The population mean difference is not equal to zero. H 0 : μ difference = 0 H a : μ difference ≠ 0 The population mean difference is greater than zero. H 0 : μ difference = 0 H a : μ difference > 0 The population mean difference is less than a zero. H 0 : μ difference = 0 H a : μ difference < 0 31

32 Assumptions for Paired t-Test The sample is random. The data is matched pairs. The differences have a normal distribution. 32

33 Test Statistic for Paired t-Test 33

34 Summary of Paired t-Test 34 2-TailedRight TailedLeft Tailed Null Alternative Assumption: The population of differences is normal or approximately normal.

35 Egyptian Skulls Data Set Four measurements of male Egyptian skulls from 5 different time periods. Thirty skulls are measured from each time period. Variables MB: Maximal Breadth of Skull BH: Basibregmatic Height of Skull BL: Basialveolar Length of Skull NH: Nasal Height of Skull Year: Approximate Year of Skull Formation (negative = B.C., positive = A.D.) 35 *Thomson, A. and Randall-Maciver, R. (1905) Ancient Races of the Thebaid, Oxford: Oxford University Press. *http://members.ozemail.com.au/~rdun lop/CoplandMain/MathsLG/CollandEnt DataLG.htm

36 Paired T-Test Example JMP Analysis: Create a new column of Diff = MB – BH Analyze  Distribution Y, Columns: Diff Test Mean Specify Hypothesized Mean: 0 36

37 One-Way ANOVA ANOVA is used to determine whether three or more populations have different distributions. 37 A B C Medical Treatment

38 ANOVA Strategy The first step is to use the ANOVA F test to determine there are any significant differences among the population means. If the ANOVA F test shows that the population means are not all the same, then follow up tests can be performed to see which pairs of population means differ. 38

39 One-Way ANOVA Model 39 In other words, for each group the observed value is the group mean plus some random variation.

40 One-Way ANOVA Hypothesis Test whether there is a difference in the population means. 40

41 ANOVA Assumptions The samples are random and independent of each other. The populations are normally distributed. The populations all have the same standard deviations. The ANOVA F test is robust to the assumptions of normality and equal standard deviations. 41

42 Step 3: ANOVA F Test 42 Compare the variation within the samples to the variation between the samples. A B C A B C Medical Treatment

43 ANOVA Test Statistic 43 Variation within groups small compared with variation between groups → Large F Variation within groups large compared with variation between groups → Small F

44 MSG 44 The mean square for groups, MSG, measures the variability of the sample averages. SSG stands for sums of squares groups. r = “# of groups”

45 MSE 45 Mean square error, MSE, measures the variability within the groups. SSE stands for sums of squares error. n = “total # of observations”

46 ANOVA in JMP JMP demonstration Analyze  Fit Y By X Y, Response: MB X, Factor: Year (change to nominal) Normal Quantile Plot  Plot Actual by Quantile Means/ANOVA 46

47 Follow-Up Test If the F-test results in a significant p-value, we can then use Tukey’s HSD Test to determine which pairs of groups are significant! 47

48 Tukey Tests Tukey’s test simultaneously tests JMP demonstration: Oneway ANOVA  Compare Means  All Pairs, Tukey HSD 48 for all pairs of factor levels.

49 Two-Way ANOVA We are interested in the effect of two categorical factors on the response. We are interested in whether either of the two factors have an effect on the response and whether there is an interaction effect. An interaction effect means that the effect on the response of one factor depends on the level of the other factor. 49

50 Interaction 50

51 Two-Way ANOVA Model 51

52 VA Lung Cancer Data Set Veteran's Administration lung cancer trial. Variables stime: Survival of follow-up time in days. status: Dead or Censored. treat: Treatment type of either Standard or Test. age: Patient’s age in years. Karn: Karnofsky score of patient's performance on a scale of 0 (dead) to 100 (perfectly normal). diag.time: Time since diagnosis in months at entry to the trial. cell: One of four cell types. prior: Did the patient receive prior therapy? 52 *Kalbfleisch, J.D. and Prentice R.L. (1980) The Statistical Analysis of Failure Time Data. Wiley. *http://lungcancernewst oday.com/2015/03/05/f da-grants-licensing- application-to-opdivo- for-the-treatment- advanced-squamous- nsclc/

53 Two-Way ANOVA in JMP JMP demonstration Analyze  Fit Model Y: Karn Highlight treat and status and click Macros  Factorial to Degree Run Model 53

54 Acknowledgements Tonya Pruitt, LISA Administrative Specialist, VT Department of Statistics Dr. Chris Franck, Assistant Research Professor, VT Department of Statistics Dr. Anne Ryan Driscoll, Assistant Research Professor, VT Department of Statistics 54


Download ppt "T-tests and ANOVA using JMP Kristopher Patton April 7, 2015 *http://gipedu.org/virginia-polytechnic- institute-state-university-virginia-tech/"

Similar presentations


Ads by Google