In Python, I'm trying to validate the LS means from a mixed model that I ran with R's lme4 after using the lsmeans library. I'm using Python's mixedlm() from statsmodels.
I've successfully obtained the fixed effects means (by "hand") by extracting the parameters and alternatively with .predict() and a pandas dataframe. But I'm hung up on the standard errors for my predicted values. I'm not quite sure how to obtain these, though R's lsmeans library spits them out. In truth, I'm not sure how R is calculating them.
Does anyone know how to calculate the LS mean standard errors?