Our World Statistics Day conversations have been a great reminder of how much statistics can inform our lives. Do you have an example of how statistics has made a difference in your life? Share your story with the Community!
Choose Language Hide Translation Bar
Highlighted
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:

 Treatment Fertilization Dry matter Mowing y 0.65 Mowing y 0.58 Mowing y 0.24 Mowing n 0.29 Mowing n 0.58 Mowing n 0.10 Pasture y 0.73 Pasture y 0.07 Pasture y 0.95 Pasture n 0.56 Pasture n 0.08 Pasture n 0.81 Control n 0.82 Control n 0.60 Control n 0.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
Highlighted
Super User

## 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
4 REPLIES 4
Highlighted
Super User

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

Highlighted
Super User

## 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
Highlighted
Level I

## Re: Two way ANOVA with control (unbalanced)

Many thanks! I really appreciate your help!

Article Labels

There are no labels assigned to this post.