Computing Contextual Effects in R

33 Views Asked by At

Trying to compute the contextual effects using between- and within-person intercepts in a longitudinal multilevel model.

I fit the below model, which has between-person (job_bpc) and within-person (job_wpc) effects. I am trying to calculate the contextual effect, or the beta between - beta within, with confidence intervals.

modelB <- lmer(gpa ~ time1 + job_bpc + job_wpc + (time1|student), 
               data = df_long, 
               REML = FALSE)

I know in SAS it would look like this, but am trying to learn how to do the same in R:

ESTIMATE 'Contextual Effect' job_bpc 1 job_wpc -1 /CL;

Does anyone know an easy way to do this? Thanks!

0

There are 0 best solutions below