Help using Base SAS procedures

2-way ANOVA with interaction not giving P-value

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

2-way ANOVA with interaction not giving P-value

Hello, I am trying to run proc GLM considering disease severity on 102 samples and 3 environments. It is ok when I am considering only the variables by itself, but SAS does not give me p-values when I try the interaction between them. Why is that? Is it because my model is saturated? How can I have that interaction analysed?

proc glm data=sev;
class line env;
model sev = line env line*env;
run;

Thank you.


Accepted Solutions
Solution
‎01-12-2017 04:13 PM
SAS Super FREQ
Posts: 3,752

Re: 2-way ANOVA with interaction not giving P-value

You only have 305 valid observations but ENV has 102 unique levels. Thus the model with the interaction term contains more parameters than there are observations.

 

Some options are 

1. Get more data

2. Do not model interactions

3. Consider whether you can model ENV as a continuous variable

 

View solution in original post


All Replies
SAS Super FREQ
Posts: 3,752

Re: 2-way ANOVA with interaction not giving P-value

[ Edited ]

Please show the output.  

 

Also, please use PROC FREQ to provide the answers for

1. How many levels for LINE?

2. How many joint levels for ENV*LINE?

 

Since you didn't specify the SOLUTION option, I assume you are asking about p-values in the Type 1 and Type III model ANOVA tables.

As the following example shows, PROC GLM does give p-values for those tables when the data are nondegenerate:

 

proc glm data=sashelp.bweight plots=none;
class boy MomEdLevel;
model weight = boy MomEdLevel boy*MomEdLevel;
run;
New Contributor
Posts: 3

Re: 2-way ANOVA with interaction not giving P-value

Hello,

Thank you for your answer.

Proc Freq gaves 3 levels for line and total of 306 env*line. I am looking for Type III model anova tables.

 

SAS Output

The SAS System

The GLM Procedure

 

Class Level Information Class Levels Values line env
1021 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
31 2 3

Number of Observations Read Number of Observations Used
306
305

 


The SAS System

The GLM Procedure
 
Dependent Variable: sev

 

Source DF Sum of Squares Mean Square F Value Pr > F Model Error Corrected Total
30467164.16118220.93474..
00.00000.  
30467164.16118   

R-Square Coeff Var Root MSE sev Mean
1.000000..34.64164

Source DF Type I SS Mean Square F Value Pr > F line env line*env
10130175.75618298.76986..
25588.619532794.30976..
20131399.78547156.21784..

Source DF Type III SS Mean Square F Value Pr > F line env line*env
10130089.07898297.91167..
25588.619532794.30976..
20131399.78547156.21784.

.

 

 



Solution
‎01-12-2017 04:13 PM
SAS Super FREQ
Posts: 3,752

Re: 2-way ANOVA with interaction not giving P-value

You only have 305 valid observations but ENV has 102 unique levels. Thus the model with the interaction term contains more parameters than there are observations.

 

Some options are 

1. Get more data

2. Do not model interactions

3. Consider whether you can model ENV as a continuous variable

 

New Contributor
Posts: 3

Re: 2-way ANOVA with interaction not giving P-value

Thank you very much.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 207 views
  • 0 likes
  • 2 in conversation