Solved
New Contributor
Posts: 3

# 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: 4,237

## 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

All Replies
SAS Super FREQ
Posts: 4,237

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

[ Edited ]

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,

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
 102 1 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 3 1 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
 304 67164.2 220.93474 . . 0 0 . 304 67164.2

R-Square Coeff Var Root MSE sev Mean
 1 . . 34.6416

Source DF Type I SS Mean Square F Value Pr > F line env line*env
 101 30175.8 298.77 . . 2 5588.62 2794.31 . . 201 31399.8 156.218 . .

Source DF Type III SS Mean Square F Value Pr > F line env line*env
 101 30089.1 297.912 . . 2 5588.62 2794.31 . . 201 31399.8 156.218 . .

Solution
‎01-12-2017 04:13 PM
SAS Super FREQ
Posts: 4,237

## 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.

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