1
$\begingroup$

I am using three categorical predictor variables $X_1$, $X_2$, $X_3$ and one continuous dependent variable $Y$, and I want to treat $X_3$ as a random effect.

The simplest model I could come with:

M1<-lme(Y~X1*X2, random=~1|X3,method="ML")

Here are some more complex models:

M2<-lme(Y~X1*X2, random=~1+X1|X3,method="ML")
M3<-lme(Y~X1*X2, random=~1|X3, weights = varIdent(form =~ 1 | X1*X2),method="ML")
M4<-lme(Y~X1*X2, random=~1+X1|X3, weights = varIdent(form =~ 1 | X1*X2),method="ML")

   Model df       AIC       BIC    logLik   Test  L.Ratio p-value
M1   1   20  4211.434  4343.094 -2085.717                        
M2   2   40 -4278.814 -4015.495  2179.407 1 vs 2 8530.249  <.0001
M3   3   37  2737.569  2981.139 -1331.784 2 vs 3 7022.383  <.0001
M4   4   57 -4863.952 -4488.722  2488.976 3 vs 4 7641.521  <.0001
  • Please note that I had to increase iterations using lmeControl, to achieve convergence for M2 and M4.

    1. Is it actually possible to use a categorical variable in a random slope model such as M2 & M4?
    2. Should I be worry of the drop in AIC from high positives to low negatives?
    3. Given that I have no missing values, do I have other possibilities than lme/lmer with equivalent structures of for random effects & variances?
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.