[R-sig-ME] Fwd: glme output

Ben Bolker bbolker at gmail.com
Mon Jun 8 21:43:48 CEST 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 15-06-08 11:23 AM, Daniel Frese wrote:
> 

  [snip]

> I am in the process of learning R, and converting over from SAS.
> 
> I have the following model and I am having a difficult time finding
> code that will get me the lumens output of the model.  What I am
> looking for is an equivalent command to the SAS code of  LSMEANS
> within the PROC GLIMMIX.
> 
> Model is the following
> 
> fm14bf<-glmer(I(Steps+1)~Treatment*BFStrata*treathour  + time hour
> + (1|Block) + (0+treatdate|Steer), family=poisson,data=datahourly)
> 
> summary(fm14bf,ddf="Kenward-Roger") qqnorm(resid(fm14bf),main="QQ
> Model 14") plot(fm14bf,main="Residual Model 14") 
> hist(residuals(fm14bf))
> 
> 
> How would I go about getting LSMEANS and differences output from R
> 
> Thanks
> 
> Dan
> 
> Daniel Frese DVM Graduate Teaching Assistant Beef Cattle Institute 
> College of Veterinary Medicine Kansas State University


I would suggest that you take a look at the 'lsmeans' and 'effects'
packages for R -- I'm pretty sure they can both handle glmer models.

Some further questions/suggestions about your model:

* I'm not sure that summary(...,ddf="Kenward-Roger") is going to
do anything at all for a glmer model -- presumably you are using
the lmerTest package, which augments the summary method in this
way, but relies on the pbkrtest package, which does *not* implement
K-R for GLMMs (Stroup 2014 says that despite the lack of theoretical
grounding K-R *does* seem to give reasonable results for GLMMs).

* why are you using Steps+1 as your response variable in a Poisson model?
That seems odd -- a Poisson model *should* be able to handle Steps==0
responses perfectly well.  (I think you can actually get away without
I() for a model _response_)

* do you have a good reason to suppress the intercept variation among
Steers, i.e. are the starting values for each Steer constrained to
be exactly identical?

* you might want to consider adding an observation-level random effect
to allow for overdispersion ...

- ----
Stroup, Walter W. “Rethinking the Analysis of Non-Normal Data in Plant
and Soil Science.” Agronomy Journal 106 (2014):
1–17. doi:10.2134/agronj2013.0342.








-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQEcBAEBAgAGBQJVdfB0AAoJEOCV5YRblxUHkRYH/2iGN3ddo/Ji0X0Q7a4bqfLr
YmAH9kDCueqCYOcGoBF0GEkY+yOpAs0kxhDcpcfvCSwoKrAwUlUCL11f7RjOg7p6
NE5coZs78aEtjRUpSTWlVLveCgIYWKb9H6Zc6OsniVr105S/x1KFiGiz5mJKzGBS
LwxrKLnq522K8kOML9QfBoF0lfFXLHiYEBa2HovowETd1gMUzPXtshPBQRkwsywz
VHByJW+la1iL2Nb7cbDl6fU7eCD80V4dtkolNEXd9qV3T91UuaKRsI+Iz6n9/zJy
coO1KDXfo6Ev537UuN0FrZ0WbO0ybY1m9T8LVvFWeSacNUqbxfHpbzs/PIZ3F+I=
=IDIw
-----END PGP SIGNATURE-----



More information about the R-sig-mixed-models mailing list