I'm creating a linear mixed model using the lme
package because I need to specify an AR1 correlational structure and heterogenous variance to the data (it's time series data of 3 separate stimuli).
I have 2 variables of interest - CS & sec - that are both fixed variables but sec is on the y-axis and CS is the grouping variable. Each CS is measured at each sec and thus they are crossed variables and I have reason to believe I need to model separate random slopes and intercepts for both. My original model looked like this:
model <- lme(DV ~ CS + sec + CS:sec, random = ~CS|subject, method = "ML", data = df)
But this only models a separate slope for each CS. I know from reading that modeling crossed random variables in lme
is a chore and have read this about how to potentially go about it. Unfortunately, it seems as if this tactic only models the crossed slopes? Is there a way to do something similar so that modeling both variables slopes AND intercepts is possible? Does this even make sense within the context of this hack? I know this can be done with simple syntax in the lmer
command using something as simple as (slope | g1) + (slope2 | g2)
so it seems odd it can't be done in lme