View source: R/bruceR-stats_4_regress.R
HLM_summary | R Documentation |
lmer
and glmer
models).NOTE: model_summary
is preferred.
HLM_summary(model = NULL, test.rand = FALSE, digits = 3, nsmall = digits, ...)
model |
A model fitted with |
test.rand |
[Only for |
digits, nsmall |
Number of decimal places of output. Default is |
... |
Other arguments. You may re-define |
No return value.
Hox, J. J. (2010). Multilevel analysis: Techniques and applications (2nd ed.). New York, NY: Routledge.
Nakagawa, S., & Schielzeth, H. (2013). A general and simple method for obtaining R^2 from generalized linear mixed-effects models. Methods in Ecology and Evolution, 4, 133–142.
Xu, R. (2003). Measuring explained variation in linear mixed effects models. Statistics in Medicine, 22, 3527–3541.
print_table
(print simple table)
model_summary
(highly suggested)
GLM_summary
regress
library(lmerTest) ## Example 1: data from lme4::sleepstudy # (1) 'Subject' is a grouping/clustering variable # (2) 'Days' is a level-1 predictor nested within 'Subject' # (3) No level-2 predictors m1 = lmer(Reaction ~ (1 | Subject), data=sleepstudy) m2 = lmer(Reaction ~ Days + (1 | Subject), data=sleepstudy) m3 = lmer(Reaction ~ Days + (Days | Subject), data=sleepstudy) HLM_summary(m1) HLM_summary(m2) HLM_summary(m3) ## Example 2: data from lmerTest::carrots # (1) 'Consumer' is a grouping/clustering variable # (2) 'Sweetness' is a level-1 predictor # (3) 'Age' and 'Frequency' are level-2 predictors hlm.1 = lmer(Preference ~ Sweetness + Age + Frequency + (1 | Consumer), data=carrots) hlm.2 = lmer(Preference ~ Sweetness + Age + Frequency + (Sweetness | Consumer) + (1 | Product), data=carrots) HLM_summary(hlm.1) HLM_summary(hlm.2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.