cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
Muzzè
Level I

Two way ANOVA with control (unbalanced)

Hello everybody,

I need to perfom an anova on dry matter of forage samples. I have a management treatment (pasture or mowing) and fertilization (yes or no) and a control (which is not fertilized).

My database is structured as follows:

 

TreatmentFertilizationDry matter
Mowingy0.65
Mowingy0.58
Mowingy0.24
Mowingn0.29
Mowingn0.58
Mowingn0.10
Pasturey0.73
Pasturey0.07
Pasturey0.95
Pasturen0.56
Pasturen0.08
Pasturen0.81
Controln0.82
Controln0.60
Controln0.26

 

If i go on: Fit Model --> Dry matter on Y and full factorial on Treatment+Fertilizaion (using macro) first I got a warning on test effects (DF missing) and if I try to perfom a Tukey test I got no response for the Control, I assume I'm doing something wrong. Can somebody help me? Thank you very much! 

1 ACCEPTED SOLUTION

Accepted Solutions
cwillden
Super User (Alumni)

Re: Two way ANOVA with control (unbalanced)

Hi @Muzzè,

No worries!  I assume you can reproduce the first solution with the combined column of Treatment and Fertilization.  The Fit Model step was just fitting the model with the only the combined factor column as your only model effect.

The second solution with the custom interaction you can create using a column formula.  Note, I also created the main effect columns in coded units in the table I sent you so you can see how JMP is parameterizing those effects behind the scene, but it's not necessary to do that.  You can create just the custom interaction column.

1. Create a new column, name it something like "Mowing*Fertilizer".

2. Right-click on the column header and select "Formula"

3. Create a formula that returns a value of 1 when Treatment = "Mowing" and Fertilization = "y", 0 otherwise.  You can copy and paste the following right into the formula editor:

If( :Treatment == "Mowing" & :Fertilization == "y",
	1,
	0
)

4. In Fit Model, select the following for your model effects: Treatment, Fertilization, and your custom interaction column. Select your response and press Run.

Note: JMP is not going to recognize your custom interaction column as an interaction, so the profiler will be pretty much worthless as it will allow the value of Mowing*Fertilizer to vary independently of Treatment and Fertilization.

-- Cameron Willden

View solution in original post

4 REPLIES 4
cwillden
Super User (Alumni)

Re: Two way ANOVA with control (unbalanced)

Hi @Muzzè,

Welcome to the community!

Your problem is that Treatment and Fertilization is not fully crossed since the control is never fertilized.  You end up with a design matrix that is not full-rank.

The easiest solution is to collapse Treatment and Fertilization into 1 "super" factor 5 levels (levels would be "Mowing, y", "Mowing, n", "Pasture, y", "Pasture, n", and "Control, n").  You can do this by selecting those 2 columns, then go to Cols > Utilities > Combine Columns.  You would somewhat lose the ability to estimate the significance of Treatment and Fertilization main effects separately since the effects are combined, but you could sort that out in the Tukey analysis pretty well.  It doesn't look like any effects are significant anyway.

If you want to get really technical, you could create a column for the interaction pertaining to "Treatment[Mowing]*Fertilization[y]"

I did it both ways in the attached table (see the scripts) and you can see both get the same R^2, RMSE, etc, except the second method has separate significance tests for treatment, fertilization, and the special interaction column I created.

-- Cameron Willden
Muzzè
Level I

Re: Two way ANOVA with control (unbalanced)

Hi cwillden,

 

thank you for the swift answear!

You get no significant simply because the database was created with "=random()" in excel. I runned the script, I saw the results and understood you did but how can I understand the procedure you applied (fit modell --> etc.) from the script! I need to repeat this procedure on further data.

Sorry if this question looks stupid but as you can immagine I'm a entry-level user.

 

Thanks 

cwillden
Super User (Alumni)

Re: Two way ANOVA with control (unbalanced)

Hi @Muzzè,

No worries!  I assume you can reproduce the first solution with the combined column of Treatment and Fertilization.  The Fit Model step was just fitting the model with the only the combined factor column as your only model effect.

The second solution with the custom interaction you can create using a column formula.  Note, I also created the main effect columns in coded units in the table I sent you so you can see how JMP is parameterizing those effects behind the scene, but it's not necessary to do that.  You can create just the custom interaction column.

1. Create a new column, name it something like "Mowing*Fertilizer".

2. Right-click on the column header and select "Formula"

3. Create a formula that returns a value of 1 when Treatment = "Mowing" and Fertilization = "y", 0 otherwise.  You can copy and paste the following right into the formula editor:

If( :Treatment == "Mowing" & :Fertilization == "y",
	1,
	0
)

4. In Fit Model, select the following for your model effects: Treatment, Fertilization, and your custom interaction column. Select your response and press Run.

Note: JMP is not going to recognize your custom interaction column as an interaction, so the profiler will be pretty much worthless as it will allow the value of Mowing*Fertilizer to vary independently of Treatment and Fertilization.

-- Cameron Willden

Re: Two way ANOVA with control (unbalanced)

Many thanks! I really appreciate your help!