Solved
New Contributor
Posts: 2

# Testing 2-way ANOVA with interaction

I am trying to run a 2-way anova with my 2 x variables being speed and replicate. When I test the main effects of speed and replicate alone, I am able to produce output that gives me p values however when I try to test speed*replicate in my model my output fails to give me any p values. I am not sure if my data set is too small but my degrees of freedom are 3 and 5 and N = 25.  My coding is found below, if anyone could assist me with this I would really appreciate it, thanks

Rakesh

Title Adult Fatmucket CR vs Speed;

data first;

input replicate 1. +1 speed 2. +1 cr 6.;

cards;

proc print data=first;

title 'Speed Data';

run;

Title 'Analysis of variance';

proc mixed covtest;

class replicate speed;

model cr=speed replicate speed*replicate;

lsmeans speed;

run;

Accepted Solutions
Solution
‎01-26-2015 03:36 PM
Posts: 2,655

## Re: Testing 2-way ANOVA with interaction

I ran the code and got p values for both speed (<0.0001) and replicate (0.0571).  I repeated with the interaction included and obtained the missing values that you report.  The reason is that the error term is the interaction in this model.  You have 4 levels of replicate, and 6 levels of speed, for 24 total observations.  Degrees of freedom will be 3, 5 and 15, or 23 total, which is n-1, so no p values are available.

Steve Denham

All Replies
Posts: 2,054

## Re: Testing 2-way ANOVA with interaction

It is the design of the experiment that determines whether or not the speed*replicate term can be estimated. Could you show us the 25 runs in your experiment?

--
Paige Miller
New Contributor
Posts: 2

## Re: Testing 2-way ANOVA with interaction

So my first category is replicate (df = 3) and second is speed (df = 5). The third category is CR (feeding rate). I have posted the runs below, thanks

Title Adult Fatmucket CR vs Speed;

data first;

input replicate 1. +1 speed 2. +1 cr 6.;

cards;

1 00 0.4956

2 00 0.3467

3 00 0.4513

4 00 0.5148

1 02 1.0200

2 02 1.1800

3 02 0.8400

4 02 0.8700

1 10 0.6024

2 10 1.2458

3 10 0.9109

4 10 1.4416

1 15 1.3708

2 15 1.3784

3 15 0.9514

4 15 1.4002

1 20 1.2100

2 20 1.6400

3 20 1.4500

4 20 1.7700

1 25 1.8636

2 25 1.7435

3 25 1.2154

4 25 1.8201

;

proc print data=first;

title 'Concentration Data';

run;

Title 'Analysis of variance';

proc mixed covtest;

class replicate speed;

model cr=speed replicate;

lsmeans speed;

run;

Solution
‎01-26-2015 03:36 PM
Posts: 2,655

## Re: Testing 2-way ANOVA with interaction

I ran the code and got p values for both speed (<0.0001) and replicate (0.0571).  I repeated with the interaction included and obtained the missing values that you report.  The reason is that the error term is the interaction in this model.  You have 4 levels of replicate, and 6 levels of speed, for 24 total observations.  Degrees of freedom will be 3, 5 and 15, or 23 total, which is n-1, so no p values are available.

Steve Denham

🔒 This topic is solved and locked.