turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Interaction for Two-Way ANOVA in Proc GLM not show...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-19-2016 03:12 PM

Hello all,

I am trying to conduct a two-way ANOVA with 8 observations, independent variables Income (5 levels) and Age (4 levels), and dependent variable Rates. The independent variables started out as numbers, so to make them categorical I used statements such as

if income<35000 and income>40000 then inlevel='First';

I then used the following procedure:

proc glm data=works;

class income age;

model rates = income age income*age;

run;

The output was working fine until it hit the interaction effects. In the SS output, the interaction effects are just showing missing values. Does this mean I have too few observations and the interaction effects are too small? Or should I not be using categorical variables? This is all using SAS University, by the way.

Thanks for your help!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-19-2016 06:52 PM

Is there a typo in your binning statement?

You said

if income<35000 and income>40000 then **inlevel**='First';

but you are using INCOME as a class variable in PROC GLM. Did you mean to use INLEVEL?

When you put INCOME on the CLASS statement, it is trying to fit every unique value of INCOME as a distinct level!

BTW, coding the levels as 1, 2, 3,... will be easier to handle than 'first', 'second', 'third'.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-19-2016 10:54 PM

You have too few observations for the number of quantities that you are trying to estimate. Try defining only two levels of income and two levels of age. For example :

```
proc rank data=works out=rworks groups=2;
var income age;
run;
proc glm data=rworks;
class income age;
model rates = income age income*age;
run;
```

PG

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-20-2016 08:46 AM

Also, the way you are discretizing your INCOME variable seems strange. You are assigning the same category to the high and low values. Was that intentional? Typically people use cutpoints to discretize:

if income<35000 then **inlevel**=1;

else if income>=35000 and income<50000 then **inlevel**=2;

else if income>=50000 and income<80000 then **inlevel**=3;

etc;