Given a dependent variable, a set of fixed effect variables, and a random effect structure, this function creates an lmer model for each predictor variable, lacking that predictor variable. Then, conditional and marginal coefficients of determination for each model are calculated. Comparing the value of the conditional coefficient of determination across all models, one can conclude the predictor strength of the respective missing predictor. The function uses MuMIn::r.squaredGLMM to compute coefficients of determination.

predictor_strength(dependent, fixed, random_str, data)

Arguments

dependent

The dependent variable for all models.

fixed

The independent variables, i.e. the fixed effects, for all models.

random_str

The random effect structure for all models.

data

The original data set.

Value

A dataframe containing the conditional and marginal coefficients of determination for each model, and a column defining the variable the values belong to.

References

Bates, D., Maechler, M., Bolker, B., & Walker, S. (2015). Fitting Linear Mixed-Effects Models Using lme4. Journal of Statistical Software, 67(1), 1-48. doi:10.18637/jss.v067.i01.

Barton, K. (2020). MuMIn: Multi-Model Inference. R package version 1.43.17. https://CRAN.R-project.org/package=MuMIn

Nakagawa, S., Johnson, P.C.D., & Schielzeth, H. (2017) The coefficient of determination R? and intra-class correlation coefficient from generalized linear mixed-effects models revisited and expanded. J. R. Soc. Interface 14: 20170213.

Author

D. Schmitz & J. Esser

Examples

data("data_s")

predictor_strength(dependent = "sDur",
        fixed = c("pauseBin", "list", "folType", "baseDur"),
        random_str = c("(1 | speaker) + (1 | item)"),
        data = data_s)
#> Warning: 'r.squaredGLMM' now calculates a revised statistic. See the help page.
#> boundary (singular) fit: see ?isSingular
#>   predictor       R2m       R2c
#> 1   baseDur 0.4614588 0.5733752
#> 2   folType 0.4971085 0.5808113
#> 3      list 0.3830629 0.6111709
#> 4  pauseBin 0.4211637 0.4743685