How to create a Nested effect within interaction factors?Hello,
I wil be running RCBD using fit model. I know how to create the nested effect within a single factor, but how do I create nested effect within interaction factors?
ex. Block (Year * Location)
Thank you!
Re: How to create a Nested effect within interaction factors?You said, "I would also like to be able to report that individuals within genotypes are quite different. So I'd like to use MS rather than REML method, because REML does not test random effects." The random effect is modeled as a variance. The REML report includes confidence intervals and a Wald test statistic. You can also examine the best linear unbiased prediction (BLUPs) for inidivuals.
You said, "So when I did it exactly the way you show, with individuals given unique IDs, and genotype and T as full factorial effects and Individual as random non-interacting block effect. And I am getting a lot of singularities and missing DFs, as if JMP was trying to cross individuals to genotype and T, when using MS. (Everthing fine in REML)." That is one of the advantages of REML. Many designs are not suited to the older MS method.
Re: How to create a Nested effect within interaction factors?Dear Mark,
Thank you so much, so quickly and on a weekend, you guys are amazing.
Yes this is pretty much my design, although each individual is measured not 3 times but more like 300 times (velocity recorded every second for 5 min and it varies quite a bit as individuals swim, rest, swim again, etc.). Of course these 300 measurements are not quite independent observations, but I feel they still can be used to estimate the difference between individuals. (Two adjacent measurement at not independent at all, but over a couple of cycles of swimming and resting perhaps they are).
Yes, sure, I started out by averaging speed for each individual and using individuals as replicates. But I would also like to be able to report that individuals within genotypes are quite different. So I'd like to use MS rather than REML method, because REML does not test random effects.
So when I did it exactly the way you show, with individuals given unique IDs, and genotype and T as full factorial effects and Individual as random non-interacting block effect. And I am getting a lot of singularities and missing DFs, as if JMP was trying to cross individuals to genotype and T, when using MS. (Everthing fine in REML).
Perhaps I cannot estimate the significance the Individual effect in the same model and should do it in a separate analysis, say for each T separately and nested within genotypes?
Thanks again for your advise!
Re: How to create a Nested effect within interaction factors?Here is a simple example to illustrate how I interpret your design.

You included 4 x 2 = 8 treatments. Each treatment was replicated with multiple subjects (e.g., 5 times). Each subject was observed multiple times (e.g., 3 times). Is that essentially what you did?
So you could use the average of the observations as the response from each individual. This way, the residual error is individual and you do not need a term in the model. (You could also create and model the variance of the observations to see if the treatment affected the variability, too.)

Alternatively, you could use the individual observations. You must stack the separate observation columns first and create a new column for the identity of the individual. The ID column would be added as the random effect.

The new table looks like this:

So the model changes to this:

This way, the individual contributes a random effect but it is not a nested effect. It acts like a random block.
Re: How to create a Nested effect within interaction factors?Dear Mark,
Thank you for this discussion of RCBD design 3 years ago. I followed this discussion, but I am still uncertain how to specify my model, which is actually much more simple. It also includes an effect nested within a combination of two other effects. Specifically, I have 4 genotypes reared at 2 temperatures and 4-5 individuals per combination of temperature and phenotype measured repeatedly (many observations of swimming speed per individual). So individuals are random effect nested within genotypeXtemperature. When I do as you suggested in the discussion above to specify individual with unique IDs and run this:
Fit Model( Y( :v ), Effects( :Genotype, :T, :T * :Genotype, :G_T_Ind & Random))
I get lost DF's and nothing is evaluated.
There must be a way to specify that individuals are unique within a combination of :T * :Genotype, right?
Thanks in advance!
L.Yampolsky
Re: How to create a Nested effect within interaction factors?Hello Mark,
Thank you for comparing the power of detection for me. I did't want to treat the nested Block (Year*Location) effect as fixed, effect. I wanted to treat it as random effect, but just didn't know how to run the test by nesting the Block within the interactions of Year and Location. But now since the power of detection was not affected by simply naming the Blocks 1~12 throughhout the 2 Locations and 2 Years, I would do the analysis this way. Thank you very cmuh again!!
Re: How to create a Nested effect within interaction factors?I don't know the standard deviation of your response or the minimum effect that you are trying to detect but this comparison is fair because I use 1 for the standard deviation (Anticipated RMSE) and 1 for the parameter value (with coding of factor levels, the value is equivalent to an effect that is twice the standard deviation) in both analyses. Here is the power analysis using the random block effect in the model:

(RCBD with random block effects in the model)
Here is the power analysis using your model:

(RCBD with fixed block effects in the model)
So you can see that the power is essentially the same for the effects of interest. Your choice should come down to how you think about the block effect. A random effect seems appropriate to me. Why would you want to model Block as a fixed effect? I do not mean that question as a challenge. It is simply something to think about.
Re: How to create a Nested effect within interaction factors?Is there any differences in the power of detecting differences in Varieties using these two methods?
Thank you!!
Re: How to create a Nested effect within interaction factors?By giving each block a unique level (1-12), you are indicating the nesting indirectly. If you used instread 1-3 in the four envirionments, then you would have to explicityly nest the blocks.
Re: How to create a Nested effect within interaction factors?Mark,
Thank you so much for your time and effort simulating the data.
I was trying to treat the nested Block (Y*L) as random effect, not fixed.
I wonder what would be the differences between the two methods on the power of distingushing the differences in the factors and reducing the effects from field variances?. How do I justify myslef not nesting the blocks statistically?
Thank you so much again !
Re: How to create a Nested effect within interaction factors?I made a custom design that should be equivalent to your RCBD as you described it. (I made up the response values with a Monte Carlo simulation.) It includes the model (table script) with the random block effect.
I attached it for your inspection.
Re: How to create a Nested effect within interaction factors?Thank you for the clarification, it really helps a lot.
So to be sure I undestand, you have all 10 varieties in every combination of location (2) and year (2), an environment. Each variety is tested in triplicate and arranged as 3 coimplete blocks within each environment. So you have 10 x 2 x 2 x 3 = 120 observations arranged in 12 blocks?
It seems to me that the model should treat block as a random effect without nesting. Instead of indicating block = 1, 2, or 3, indicate it as 1 through 12 in the data table. Select the block effect in the model, click the red triangle next to Attributes, and select Random Effect.
I don't understand why you would treat the block as a fixed effect or need to nest it based on your description.
Re: How to create a Nested effect within interaction factors?Hello Mark,
The three factors are : 10 Varieties, 2 Years, 2 Locations, (3 blocks in each environment, meaning each year and location)
This is my field design for RCBD for one environment : And I am trying to next the Block effect in (year*Location)

Re: How to create a Nested effect within interaction factors?There are more than one possible model and it is easy to misunderstand your design and model. Would you please provide the following information for clarification?
- What is your RCBD? That is, what are the factors, factor levels, treatments, and blocking. In particular, how does the nesting occur in your design?
- What is your intended linear model?
For the linear model, please use this nomenclature for the sake of clarity:
Y = I + X1 + X2[X1] + X1*X2[X1] + B
I am indicating that there are two factors, X1 (e.g., Site) and X2 (e.g., Line). They have been entered as two main effects and one interaction effect. The changes in X2 are nested in the X1 levels. B is the block (e.g., Day).
(BTW, I am not guaranteeing that my example is estimable but only to show how the nomenclature works!)
Re: How to create a Nested effect within interaction factors?Hi Mark,
I know how to create interaction term, but how do I nest the "Block" within ( Year*Location )?
Thank you.
Re: How to create a Nested effect within interaction factors?You simply select the columns involved in the interaction first, and then click Cross.