Help with 'olsrr' package, is adding a random intercept possible?

Hi there,

I am admittingly a newbie at both R and stepwise regression.

I have been analysing my data using linear regression analysis but have decided stepwise regression would be more appropriate.

After a quick bit of research it looked like the 'olsrr' package is a straightforward way to do stepwise regression. However, I have encountered a bit of an error. In my dataset there are multiple observations per individual, as such it would be optimal to add participant ID as a random intercept. Previously I was doing this by adding '(1 |participantID)' after listing my independent variables when performing regression analysis. However, this command doesn't seem to work with the 'olsrr' package, is there another command I can use or is this not possible?

Many thanks in advance!!

Code example:

model1 <- lm(dependentvariable ~ variable1 + variable2 + variable3 + variable4, data = datafile)
forward <- ols_step_forward_p(model1, pent = 0.5, details = TRUE)

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.