1
$\begingroup$

I´m still new to statistical modeling and quite confused about how I should correctly specify my model.

I have 3 crossed categorical treatments - stress, infection and food. Each individual was measured at 4 time points (just before the experiment and 3x during the experiment).

As there are only 4 time points and I have no reason to assume that changes in response variables will change in a single direction through time (as growth would), I treated time as a categorical variable. So the full model would be:

lme(response~stress*infection*food*time, random=~1|ind)

I hope so far, everything´s right.

But I don´t seem to understand if I need a random slope too.

I tried to plot response~time for individuals of each experimental group and noticed a big difference in shape of response between them. So I´d say there is much noise still to be filtered. Does it make sense then to put time as a random slope? Anyway I used it as a fixed categorical variable, so I suppose it shouldn´t be specified as continuous in random part of the model then? But what does it tell me random categorical slope? Does it even make any sense?

I´m sorry if the question is stupid, and thank you very much for your answers.

$\endgroup$
2
$\begingroup$

If you treat time as a categorical variable, you should state factor(time) instead directly stating time in your model. So do other categorical variables, if you did not state them as factor before.

Besides, if you plot response with the original time, and want to model its slope, that means time is no longer a categorical variable. However, you cannot change the feature of a variable in a model.

The solutions are:

  1. Treat time as categorical and no slope, using:
    lme(response~factor(stress)*factor(infection)*factor(food)*factor(time), random=~1|ind)

  2. Treat time as continuous and consider its random slope, using:
    lme(response~factor(stress)*factor(infection)*factor(food), random=~time|ind)

$\endgroup$
0
$\begingroup$

If time is in a continuous scale originally, make 2 models: one without random slope and one with random slope. Fit with REML. Compare them with anova(model1,model2) for quick check to see if random slope is statistically significantly better than random intercept. If it is, it means the rates of growth are different, i.e. the fitted linear lines are not parallel.

$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.