View source: R/predictor_competition.R
predictor_competition | R Documentation |
NOTE: This function is deprecated. Please use SfL::predictor_competition2
instead.
Compare the predictive strength of two independent variables in a minimal linear (mixed effects) regression model. The function creates two identical
lm
or lmer
objects, only differing in fixed effects structure. Then, a log-likelihood test is used to decide which fixed effect structure is better fit to
predict the dependent variable.
predictor_competition(
data,
dependent,
independent1,
independent2,
random.intercept = NULL,
random.slope = 1
)
data |
The original data set for both models. |
dependent |
The dependent variable for both models. |
independent1 |
The independent variable(s), i.e. the fixed effects, of the 1st model. |
independent2 |
The independent variable(s), i.e. the fixed effects, of the 2nd model. |
random.intercept |
The random intercept for both models. If not random intercept is specified, regular linear models are fitted. |
random.slope |
The random slope for both models. The default assumes no random slope. |
A dataframe containing npar, AIC, BIG, logLik, deviance, Chisq, Df, and Pr(>Chisq). Usually used without variable assignment.
D. Schmitz
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.
data("data_s")
# example 1: two similarly well fit predictors
predictor_competition(data = data_s, dependent = "sDur", independent1 = "typeOfS", independent2 = "pauseBin", random.intercept = "speaker")
# example 2: one predictor is better than the other
predictor_competition(data = data_s, dependent = "sDur", independent1 = "typeOfS", independent2 = "slideNumber", random.intercept = "speaker")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.