caterpillar_mean_plot: caterpillar_mean_plot() it plots the rank of random effects...

View source: R/caterpillar_mean_plot.R

caterpillar_mean_plotR Documentation

caterpillar_mean_plot() it plots the rank of random effects across clusters, with ther point estimates and their uncertainty (1.96*SD), around it points estimates

Description

caterpillar_mean_plot() it plots the rank of random effects across clusters, with ther point estimates and their uncertainty (1.96*SD), around it points estimates

Usage

caterpillar_mean_plot(mlm_model)

Arguments

mlm_model

it requires an mlm_model, generated by lme4. If this is a null, the plot display the unconditioned random effect, plus its intercept. If the model is not a null model, then the plot display the expected random effects given the model plus its intercept or grand mean.

Details

Given the return object is a common 'ggplot2' user can further customize the figure, overwritting or defining parameter for the plot such as colours, axis lenght, and coord_fixed(ratio=.xx)

Value

a plot, a 'ggplot2' object.

Examples


lme4::lmer(y ~ 1 + (1|id_j), data = clustered_data, REML = FALSE) %>%
caterpillar_mean_plot(.)


dacarras/r4sda documentation built on Nov. 9, 2023, 10:17 a.m.