count_grps | R Documentation |
A helper function to count groups to add to random effect results.
count_grps(model, grp_vars) ## Default S3 method: count_grps(model, grp_vars) ## S3 method for class 'merMod' count_grps(model, grp_vars) ## S3 method for class 'glmmTMB' count_grps(model, grp_vars) ## S3 method for class 'lme' count_grps(model, grp_vars) ## S3 method for class 'brmsfit' count_grps(model, grp_vars) ## S3 method for class 'stanreg' count_grps(model, grp_vars) ## S3 method for class 'stanmvreg' count_grps(model, grp_vars) ## S3 method for class 'gam' count_grps(model, grp_vars)
model |
A fitted model e.g. from |
grp_vars |
A character vector for the grouping/cluster variables used for random effects |
For each grouping variable for which random effects are estimated, count the respective group sizes. This is not meant to be used directly.
A tibble of the results.
library(lme4) library(mixedup) mod = lmer(Reaction ~ Days + (1 + Days | Subject), sleepstudy) count_grps(mod, 'Subject')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.