Recreating plot of EMMs with two time points


I made a GLM repeated measures analysis in SPSS with calculation of estimated marginal means, with following plot:

Now, I want to redo the plot in R, but can't seem to make it work.
The response variable is called "LVEDVi" (called factor1 in the SPSS plot) and is measured at two timepoints. I have seven explanatory variables.

I made a linear regression model (lm) in R with a deltavariable "deltaLVEDVi", which gives me the same output in SPSS as in R:

model1 <- lm(delta_LVEDVi ~ Age_Y0+Sex+SLEDAI_2K_Y0+LN_Y0+APL_M+APL_G+LAK_Y0, data=SLE_FU_new)

However, using a deltavariable does not work with the "emmip" function as two or more timepoints are needed.
Therefore - how do I create a model with same result as "model1" , where I can use the emmip function or similar to create a plot of EMMs?

Thanks! :pray:

This topic was automatically closed 21 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.