G'day Everyone,
When the 'lmer' function in 'lme4' runs its produces an S4 object with a lot of slots. I am interested in one of these slots, namely model@X, and how this 'X' slot output is produced. I want to try reproduce this output for a different model function (glmmPQL) I am using which does not automatically produces this 'X' output (FYI 'lmer' produces an object of class 'mer', and slot 'X' is a model matrix for the fixed effects). Code below shows what I am talking about.
What I want to figure out is how the produced this 'X' data? I looked at the code for 'lmer' by writing it in the terminal without '()' but I couldn't find anything there. I also tried showMethod('lmer') but it says function 'lmer': .
Just wondering if there is a way to get the source code for what the 'X' slot is doing in particular (or any slot in a S4 object)? Or does anyone know how to reproduce this? Thanks lots for your help and time.
library(lme4)
# here is a quick example of what I am looking at using the cake dataset in the 'lme4' package
m <- lmer(cakeglmm<- lmer(angle ~ temp + recipe + (1| replicate), family = gaussian, data = cake)
slotNames(m)
head(m@X)