Skip to main content
Removed unnecessary thank you, made questions more readable, added formatting, included related tags (since this is about lme4 in R and interactions)
Source Link
Shawn Hemelstrand
  • 18.5k
  • 6
  • 35
  • 92

I'm a bit unsure about a current project I'm concerned with. I have an outcome of interest, say y$y$, and a main predictor, say x$x$, which both are continuous. I I have multiple measurements per subject of x$x$ and y$y$, at different timepoints. Apart from that, I have some other covariates, which should be included in the model. I

I now have the impression that I ignore the time information when I just specify a random effect on intercept + slope (the main predictor). However, if I specify random intercept + slope (time), I feel that I'm not addressing the research question, how the main predictor affects the outcome variable.

Basically there are two questions: How does the main predictor affect the putcome and how does time affect the outcome. And

  • How does the main predictor affect the outcome?
  • How does time affect the outcome?

I'm not sure how to handle this/ setset up the random effects.

  I never had the situation of including two random effects and I don't think that's the right way here? I. I would suggest toprobably include all covariates as fixed effects, plus an interaction term time*main_predictorTime * Main Predictor, but what about the random effects?

Thanks so much!

I'm a bit unsure about a current project I'm concerned with. I have an outcome of interest, say y, and a main predictor, say x, which both are continuous. I have multiple measurements per subject of x and y, at different timepoints. Apart from that, I have some other covariates, which should be included in the model. I now have the impression that I ignore the time information when I just specify a random effect on intercept + slope (the main predictor). However, if I specify random intercept + slope (time), I feel that I'm not addressing the research question, how the main predictor affects the outcome variable.

Basically there are two questions: How does the main predictor affect the putcome and how does time affect the outcome. And I'm not sure how to handle this/ set up the random effects.

  I never had the situation of including two random effects and I don't think that's the right way here? I would suggest to include all covariates as fixed effects, plus an interaction term time*main_predictor but what about the random effects?

Thanks so much!

I'm a bit unsure about a current project I'm concerned with. I have an outcome of interest, say $y$, and a main predictor, say $x$, which both are continuous. I have multiple measurements per subject of $x$ and $y$, at different timepoints. Apart from that, I have some other covariates, which should be included in the model.

I now have the impression that I ignore the time information when I just specify a random effect on intercept + slope (the main predictor). However, if I specify random intercept + slope (time), I feel that I'm not addressing the research question, how the main predictor affects the outcome variable.

Basically there are two questions:

  • How does the main predictor affect the outcome?
  • How does time affect the outcome?

I'm not sure how to handle this/set up the random effects. I never had the situation of including two random effects and I don't think that's the right way here. I would probably include all covariates as fixed effects, plus an interaction term Time * Main Predictor, but what about the random effects?

Source Link

How to set up a Linear mixed effects model with multiple covariates and interactions

I'm a bit unsure about a current project I'm concerned with. I have an outcome of interest, say y, and a main predictor, say x, which both are continuous. I have multiple measurements per subject of x and y, at different timepoints. Apart from that, I have some other covariates, which should be included in the model. I now have the impression that I ignore the time information when I just specify a random effect on intercept + slope (the main predictor). However, if I specify random intercept + slope (time), I feel that I'm not addressing the research question, how the main predictor affects the outcome variable.

Basically there are two questions: How does the main predictor affect the putcome and how does time affect the outcome. And I'm not sure how to handle this/ set up the random effects.

I never had the situation of including two random effects and I don't think that's the right way here? I would suggest to include all covariates as fixed effects, plus an interaction term time*main_predictor but what about the random effects?

Thanks so much!