- data
data.frame
- model
lme4
model syntax. Support more complicated model structure from lme4
. It is not well-tested to ensure accuracy ![[Experimental]](figures/lifecycle-experimental.svg?package=psycModel&version=0.5.0)
- response_variable
DV (i.e., outcome variable / response variable). Length of 1. Support dplyr::select()
syntax.
- random_effect_factors
random effect factors (level-1 variable for HLM from a HLM perspective) Factors that need to estimate fixed effect and random effect (i.e., random slope / varying slope based on the id). Support dplyr::select()
syntax.
- non_random_effect_factors
non-random effect factors (level-2 variable from a HLM perspective). Factors only need to estimate fixed effect. Support dplyr::select()
syntax.
- two_way_interaction_factor
two-way interaction factors. You need to pass 2+ factor. Support dplyr::select()
syntax.
- three_way_interaction_factor
three-way interaction factor. You need to pass exactly 3 factors. Specifying three-way interaction factors automatically included all two-way interactions, so please do not specify the two_way_interaction_factor argument. Support dplyr::select()
syntax.
- family
a GLM family. It will passed to the family argument in glmer. See ?glmer
for possible options. ![[Experimental]](figures/lifecycle-experimental.svg?package=psycModel&version=0.5.0)
- cateogrical_var
list. Specify the upper bound and lower bound directly instead of using ± 1 SD from the mean. Passed in the form of list(var_name1 = c(upper_bound1, lower_bound1),var_name2 = c(upper_bound2, lower_bound2))
- id
the nesting variable (e.g. group, time). Length of 1. Support dplyr::select()
syntax.
- graph_label_name
optional vector or function. vector of length 2 for two-way interaction graph. vector of length 3 for three-way interaction graph. Vector should be passed in the form of c(response_var, predict_var1, predict_var2, ...). Function should be passed as a switch function (see ?two_way_interaction_plot for an example)
- estimation_method
character. ML
or REML
default is REML
.
- opt_control
default is optim
for lme
and bobyqa
for lmerTest
.
- na.action
default is stats::na.omit
. Another common option is na.exclude
- model_summary
print model summary. Required to be TRUE
if you want assumption_plot
.
- interaction_plot
generate interaction plot. Default is TRUE
- y_lim
the plot's upper and lower limit for the y-axis. Length of 2. Example: c(lower_limit, upper_limit)
- plot_color
If it is set to TRUE
(default is FALSE
), the interaction plot will plot with color.
- digits
number of digits to round to
- use_package
Default is lmerTest
. Only available for linear mixed effect model. Options are nlme
, lmerTest
, or lme4
('lme4
return similar result as lmerTest
except the return model)
- standardize
The method used for standardizing the parameters. Can be NULL (default; no standardization), "refit" (for re-fitting the model on standardized data) or one of "basic", "posthoc", "smart", "pseudo". See 'Details' in parameters::standardize_parameters()
- ci_method
see options in the Mixed model
section in ?parameters::model_parameters()
- simple_slope
Slope estimate at ± 1 SD and the mean of the moderator. Uses interactions::sim_slope()
in the background.
- assumption_plot
Generate an panel of plots that check major assumptions. It is usually recommended to inspect model assumption violation visually. In the background, it calls performance::check_model()
.
- quite
suppress printing output
- streamline
print streamlined output.
- return_result
If it is set to TRUE
(default is FALSE
), it will return the model
, model_summary
, and plot
(plot
if the interaction term is included)