[R-sig-ME] Random slope with cross-level interaction

Ben Bolker bbo|ker @end|ng |rom gm@||@com
Sun Jul 19 20:35:32 CEST 2020


   Assuming that fertilizer is a numeric covariate and wheatlanduse is 
categorical, you might want

lmer( Production ~ seed + fertilizer *wheatlanduse + (1 + fertilizer | 
Household) , contrasts=list(wheatlanduse=contr.sum), ...)

   that would mean that the main effect for fertilizer would represent 
the *average* effect across levels of wheatlanduse.  The estimated main 
effect of wheatlanduse will represent the expected differences across 
levels at zero fertilizer (or, if you center fertilizer by subtracting 
the mean, at the average fertilizer level)

    I'm not sure what you mean by "cross-level interaction" ...




On 7/19/20 12:59 PM, Yashree Mehta wrote:
> Hi Salahadin, Thanks for your reply. It is very helpful. Then, is 
> there a way I can extract the coefficient estimate of the fixed effect 
> of fertilizer as well as that of wheatlanduse as a main effect? 
> Regards, Yashree On Sun, Jul 19, 2020 at 6:59 PM Yashree Mehta 
> <yashree19 using gmail.com> wrote:
>> Hi Salahadin, Thanks for your reply. It is very helpful. Then, is 
>> there a way I can extract the coefficient estimate of the fixed 
>> effect of fertilizer as well as that of wheatlanduse as a main 
>> effect? Regards, Yashree On Sun, Jul 19, 2020 at 5:46 PM Salahadin 
>> Lotfi <salahadin.lotfi using gmail.com> wrote:
>>> Hi Yashree, The interpretation of the interaction term do change 
>>> whether you include the main effect of not. Usually having only the 
>>> interaction term in the model requires a specific hypothesis. Thus, 
>>> the lower level terms (i.e., the main effects) are almost always 
>>> included. The lmer function automatically includes the lower level 
>>> terms even if you just include an interaction term. For example, if 
>>> you setup your model as follow, the main effects of fertilizer and 
>>> wheatlanduse will be still taken into account. Production = seed + 
>>> fertilizer : wheatlanduse + (1 + fertilizer | Household) Thanks, 
>>> Sala ************* Salahadin (Sala) Lotfi PhD Candidate of Cognitive 
>>> Psychology & Neuroscience University of Wisconsin-Milwaukee Anxiety 
>>> Disorders Laboratory President, Association of Clinical and 
>>> Cognitive Neuroscience, UWM On Sun, Jul 19, 2020 at 5:02 AM Yashree 
>>> Mehta <yashree19 using gmail.com> wrote:
>>>> Hi, I have the following model: Production = seed + fertilizer + 
>>>> fertilizer : wheatlanduse + (1 + fertilizer | Household) As the 
>>>> formula indicates, the household level is specified as the random 
>>>> intercept. Fertilizer is specified as random slope , and has also 
>>>> been specified as a fixed effect. I am interested in cross-level 
>>>> interaction between fertilizer and the wheatlanduse variable. So, I 
>>>> have inserted "fertilizer : wheatlanduse". My question is: Do I 
>>>> have to include "wheatlanduse" as a main effect in the formula as 
>>>> well? Or is it acceptable to only have it as a part of the 
>>>> interaction term? Thank you, Regards, Yashree [[alternative HTML 
>>>> version deleted]] _______________________________________________ 
>>>> R-sig-mixed-models using r-project.org mailing list 
>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models 
> [[alternative HTML version deleted]] 
> _______________________________________________ 
> R-sig-mixed-models using r-project.org mailing list 
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models



More information about the R-sig-mixed-models mailing list