help-octave
[Top][All Lists]

## Re: ANOVA with empty cells

 From: Isaac Neuhaus Subject: Re: ANOVA with empty cells Date: Mon, 11 Apr 2005 14:14:54 -0400 User-agent: Mozilla Thunderbird BMS-en M6r11d (Windows/20041005)

```Please see bellow.

Mike Miller wrote:

```
```On Mon, 11 Apr 2005, Isaac Neuhaus wrote:

```
```How does SAS do it?

Source   DF     Type III SS     Mean Square    F Value    Pr > F
R         3     36.30000000     12.10000000      48.40    0.0203
T         1      4.08333333      4.08333333      16.33    0.0561
R*T       1      0.75000000      0.75000000       3.00    0.2254
```
```

```
You'll have to look at their manuals to figure out what they are doing. Note that you have 3 df for R, 1 df for T, but only one df for R*T. It must be fitting a model with a sort of partial interaction effect. In a full model, you would have 3*1 = 3 df for interaction.
```
```
Yes.... this is because there are two empty cells in the design, but how are they calculating it?
```
```
```
```
Looking more closely, you can only fit an interaction to the part of the model where f1 is 1 or 3. So that must be what it is doing. You can do this in Octave using dummy codes. You need three dummy codes for f1, one for f2, and one for (arbitrary choice here) when f1=1, f2=1. Once you have that done, you can use the '\' operator and other functions to solve this,
```

```
That is pretty much what I did but I do not get the same answer although it is close. Here is my design matrix:
```
X = [ 1, 1, 0, 0, 1, 0;
1, 1, 0, 0,-1, 0;
1, 1, 0, 0,-1, 0;
1, 0, 1, 0, 1, 0;
1, 0, 0, 1, 1, 1;
1, 0, 0, 1,-1,-1;
1, 0, 0, 1,-1,-1;
1,-1,-1,-1,-1, 1]

```
And here are my contrast matrices and their results (which I believe are not approximation errors):
```
C1 = [0,1,0,0,0,0;
0,0,1,0,0,0;
0,0,0,1,0,0]    pval = 0.0178    (in SAS 0.0203)

C2 = [0,0,0,0,1,0]    pval = 0.0550    (in SAS 0.0561)

C3 = [0,0,0,0,0,1]    pval = 0.2254    (the same in SAS)

Isaac

```
but I'm sure someone has developed a little regression or ANOVA package to make this easier.
```
Mike

```
```Your data....

```
```    f1   f2   response
S1    1    1    7
S2    2    1    1
S3    3    1    4
S4    4    2    5
S5    3    2    5
S6    1    2    9
S7    3    2    5
S8    1    2    10
```
```
```
```

-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

```