Description Usage Arguments Details Value Examples
This function extracts the variance components from a gam or bam object, where one is using the associated functions from the mgcv package for mixed models.
1 | extract_vc(model, ci_level = 0.95, ci_scale = "sd", digits = 3)
|
model |
A gam or bam model |
ci_level |
Level for the confidence interval. Must be between 0 and 1. |
ci_scale |
Whether the confidence interval should be on the variance or standard deviation scale. |
digits |
Rounding for the output. |
This is essentially a pretty way to print gam.vcomp
.
Note that if you do something like a random slope, the gam approach does
not estimate the intercept-slope correlation, so none will be printed.
Should work fine on standard smooth terms also, but the model must be
estimated with method = REML
or method = ML
. This is the default for
non-exponential families, but otherwise you'll have to change the value or
will receive an error. Have not tested much with interactions, using by
,
etc., but it has worked on some default mgcv
examples.
A tibble or data frame with the standard deviation, its lower and upper bounds, the variance, and the relative proportion of total variance for each variance component.
1 2 3 4 5 6 7 8 9 10 11 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.