Two-Way ANOVA in SAS Multiple regression with two or

Slides:



Advertisements
Similar presentations
One-sample T-Test Matched Pairs T-Test Two-sample T-Test
Advertisements

2  How to compare the difference on >2 groups on one or more variables  If it is only one variable, we could compare three groups with multiple ttests:
Inference for Regression
Simple Logistic Regression
Multiple Linear Regression
Multiple Logistic Regression RSQUARE, LACKFIT, SELECTION, and interactions.
Chapter 13 Multiple Regression
Multiple regression analysis
Using Statistics in Research Psych 231: Research Methods in Psychology.
Chapter 12 Multiple Regression
Statistics 350 Lecture 16. Today Last Day: Introduction to Multiple Linear Regression Model Today: More Chapter 6.
Regression Diagnostics Using Residual Plots in SAS to Determine the Appropriateness of the Model.
Plots, Correlations, and Regression Getting a feel for the data using plots, then analyzing the data with correlations and linear regression.
Mean Comparison With More Than Two Groups
Business Statistics - QBM117 Interval estimation for the slope and y-intercept Hypothesis tests for regression.
Introduction to Survival Analysis PROC LIFETEST and Survival Curves.
Analysis of Variance & Multivariate Analysis of Variance
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 13-1 Chapter 13 Introduction to Multiple Regression Statistics for Managers.
Chapter 12: Analysis of Variance
Chapter 13: Inference in Regression
Chapter 5 Hypothesis Testing Introduction Definition Hypothesis testing is a formal approach for determining if data from a sample support.
Introduction to SAS Essentials Mastering SAS for Data Analytics
Topic 28: Unequal Replication in Two-Way ANOVA. Outline Two-way ANOVA with unequal numbers of observations in the cells –Data and model –Regression approach.
Analysis of Variance or ANOVA. In ANOVA, we are interested in comparing the means of different populations (usually more than 2 populations). Since this.
One-Way Analysis of Variance: Comparing Several Means BPS chapter 25 © 2006 W.H. Freeman and Company.
Phi Coefficient Example A researcher wishes to determine if a significant relationship exists between the gender of the worker and if they experience pain.
Introduction to SAS Essentials Mastering SAS for Data Analytics
Chapter 14 Introduction to Multiple Regression
Chi-square Test of Independence Steps in Testing Chi-square Test of Independence Hypotheses.
Section Copyright © 2014, 2012, 2010 Pearson Education, Inc. Lecture Slides Elementary Statistics Twelfth Edition and the Triola Statistics Series.
1 Experimental Statistics - week 2 Review: 2-sample t-tests paired t-tests Thursday: Meet in 15 Clements!! Bring Cody and Smith book.
Two-way ANOVA Introduction to Factorial Designs and their Analysis.
ANOVA (Analysis of Variance) by Aziza Munir
Section Copyright © 2014, 2012, 2010 Pearson Education, Inc. Lecture Slides Elementary Statistics Twelfth Edition and the Triola Statistics Series.
April 4 Logistic Regression –Lee Chapter 9 –Cody and Smith 9:F.
Section Copyright © 2014, 2012, 2010 Pearson Education, Inc. Lecture Slides Elementary Statistics Twelfth Edition and the Triola Statistics Series.
Be humble in our attribute, be loving and varying in our attitude, that is the way to live in heaven.
ANALYSIS OF VARIANCE (ANOVA) BCT 2053 CHAPTER 5. CONTENT 5.1 Introduction to ANOVA 5.2 One-Way ANOVA 5.3 Two-Way ANOVA.
The Statistical Analysis of Data. Outline I. Types of Data A. Qualitative B. Quantitative C. Independent vs Dependent variables II. Descriptive Statistics.
Univariate Linear Regression Problem Model: Y=  0 +  1 X+  Test: H 0 : β 1 =0. Alternative: H 1 : β 1 >0. The distribution of Y is normal under both.
Analysis of Variance (ANOVA) Brian Healy, PhD BIO203.
Copyright © 2013, 2009, and 2007, Pearson Education, Inc. Chapter 14 Comparing Groups: Analysis of Variance Methods Section 14.1 One-Way ANOVA: Comparing.
Section Copyright © 2014, 2012, 2010 Pearson Education, Inc. Lecture Slides Elementary Statistics Twelfth Edition and the Triola Statistics Series.
Data Analysis.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved Section 12-3 Two-Way ANOVA.
Copyright © 2013, 2009, and 2007, Pearson Education, Inc. Chapter 14 Comparing Groups: Analysis of Variance Methods Section 14.3 Two-Way ANOVA.
General Linear Model.
1 URBDP 591 A Lecture 12: Statistical Inference Objectives Sampling Distribution Principles of Hypothesis Testing Statistical Significance.
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 14-1 Chapter 14 Introduction to Multiple Regression Statistics for Managers using Microsoft.
1 Experimental Statistics Spring week 6 Chapter 15: Factorial Models (15.5)
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.. Chap 14-1 Chapter 14 Introduction to Multiple Regression Basic Business Statistics 10 th Edition.
One Way ANOVA In prior notes, we looked at data analysis strategies for when the researcher needs to compare two sample means. But, what if a researcher.
T-TestsSlide #1 2-Sample t-test -- Examples Do mean test scores differ between two sections of a class? Does the average number of yew per m 2 differ between.
Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.Chap 14-1 Statistics for Managers Using Microsoft® Excel 5th Edition Chapter.
Factorial Design of Experiments. An Economy of Design Two or more levels of each factor (variable) are administered in combination with the two or more.
Chapter 13 Understanding research results: statistical inference.
SUMMARY EQT 271 MADAM SITI AISYAH ZAKARIA SEMESTER /2015.
Independent Samples ANOVA. Outline of Today’s Discussion 1.Independent Samples ANOVA: A Conceptual Introduction 2.The Equal Variance Assumption 3.Cumulative.
Slide Slide 1 Copyright © 2007 Pearson Education, Inc Publishing as Pearson Addison-Wesley. Lecture Slides Elementary Statistics Tenth Edition and the.
Chapter 15 Analysis of Variance. The article “Could Mean Platelet Volume be a Predictive Marker for Acute Myocardial Infarction?” (Medical Science Monitor,
Predicting Energy Consumption in Buildings using Multiple Linear Regression Introduction Linear regression is used to model energy consumption in buildings.
Lecture Slides Elementary Statistics Twelfth Edition
One-Way Analysis of Variance: Comparing Several Means
Section 10-4 – Analysis of Variance
Example Problem 3.24 Complete analysis.
CHAPTER 29: Multiple Regression*
Comparing Several Means: ANOVA
Two-way analysis of variance (ANOVA)
Comparing Two Populations
Chapter 9 Introduction to the Analysis of Variance
Presentation transcript:

Two-Way ANOVA in SAS Multiple regression with two or more categorical variables as predictors

Introduction Two-way ANOVA is Analysis of Variance when you have two variables to test the equality of mean values. Significance Tests in Two-Way ANOVA Ho: Effect=0 vs. Ha: Effect not Zero There are three hypothesis tests for a TWO-Way ANOVA. To Test of Main Effect of A: To Test of Main Effect of B: To Test the Interaction of A and B:

Two-Way ANOVA in SAS Open SAS and use the infile statement to input the data set dental.txt (this data set can be found in SAS tutorials-Lesson 1). If you don’t remember how to do this, here is some code that may help: data dental; infile 'C:\Documents and Settings\My Documents\dental.txt'; input relief A B; proc print data = dental; run;

This data set is about the effects of acupuncture and codeine on postoperative pain in male dental patients. The factorial of two treatments are considered: codeine or placebo (factor A) and acupuncture at active sites or at inactive sites (factor B). Pain relief scores were recorded two hours after treatment (higher values mean more pain relief). A = 1 is placebo pill A = 2 is codeine B = 1 is placebo (inactive) acupuncture B = 2 is active acupuncture The question of interest is: Are the main effects and interaction significant for factor A and B?

SAS Code for ANOVA To test our hypotheses, we use the following code in SAS: “class” tells SAS the two classification variables, which are generally going to be the effects that you are studying. In this case, the effects are “A” and “B.” “model” tells SAS the dependent variable. The general format is “model Y = X1 X2 X1*X2” where Y is the dependent variable, X1 and X2 are independent variables. X1*X2 means the interaction of X1 and X2. Often a “quit” statement is necessary, because SAS may continue to run a procedure until either another one has been run, or SAS has been told to quit.

Run the Program—Check Your Log If your Log is free of error messages, look at your output.

The first page of your output says that there are two values under both of the variables “A” and “B”: 1 or 2. It also tells you that there are 32 observations (it’s a good idea to double-check these numbers, to make sure no data are missing). Scroll down to the second page.

ANOVA Table in SAS Output

Interpreting the SAS Output For the main effect of factor A, the F*= 10.96. The p-value of this F* is found under “Pr>F” and p =0.0026. For the main effect of factor B, the F*= 16.03. The p-value of this F* is p =0.0004. For the A*B interaction, the F*= 0.21. The p-value of this F* is p =0.6476.

Conclusions from Two-way ANOVA For factor A and B: Because the p-values for the test statistic (F*) are less than alpha (0.05), we reject the null hypotheses and conclude that the main effects of both factor A and B are significant. For the A*B: The p-value for F* is greater than 0.05. Hence we accept the null hypothesis and conclude that the interaction of A and B is not significant.

Draw a plot of factors and relief We can draw a plot of means of factors (A and B) and the pain relief scores. Here is some SAS code that may help:

Plot of mean relief scores and factors

Conclusion Main effect of factor A (placebo or codeine): Codeine makes higher pain relief score than placebo. Main effect of factor B (inactive acupuncture or active acupuncture): Active acupuncture makes higher pain relief score than inactive site (placebo). The treatment of factor A (both codeine and placebo) makes more pain relief than the treatment of factor B (active and inactive site of acupuncture).

Conclusion (cont.) For the interaction of factor A and B: Notice that the two lines are approximately parallel. This is why the interaction of Codeine and active acupuncture is not significant. The code given in this section can be used for all two-way ANOVAs, with slight modification of variable names, etc..