gamlj_mixed | R Documentation |
Mixed Linear Model. Estimates models using lmer and lmer functions and provides options to facilitate estimation of interactions, simple slopes, simple effects, post-hoc tests, contrast analysis, effect size indexes and visualization of the results.
gamlj_mixed(
formula = NULL,
data,
dep = NULL,
factors = NULL,
covs = NULL,
cluster = NULL,
model_terms = NULL,
re = NULL,
reml = TRUE,
re_lrt = FALSE,
re_ci = FALSE,
fixed_intercept = TRUE,
nested_terms = NULL,
nested_intercept = NULL,
nested_re = NULL,
omnibus = "LRT",
estimates_ci = TRUE,
ci_method = "wald",
boot_r = 1000,
ci_width = 95,
contrasts = NULL,
show_contrastnames = TRUE,
show_contrastcodes = FALSE,
plot_x = NULL,
plot_z = NULL,
plot_by = NULL,
plot_raw = FALSE,
plot_yscale = FALSE,
plot_xoriginal = FALSE,
plot_black = FALSE,
plot_around = "none",
plot_re = FALSE,
plot_re_method = "average",
emmeans = NULL,
posthoc = NULL,
simple_x = NULL,
simple_mods = NULL,
simple_interactions = FALSE,
covs_conditioning = "mean_sd",
ccm_value = 1,
ccp_value = 25,
covs_scale_labels = "labels",
adjust = list("bonf"),
covs_scale = NULL,
dep_scale = "none",
scale_missing = "complete",
norm_test = FALSE,
df_method = "Satterthwaite",
norm_plot = FALSE,
qq_plot = FALSE,
resid_plot = FALSE,
cluster_boxplot = FALSE,
cluster_respred = FALSE,
rand_hist = FALSE
)
formula |
(optional) the formula of the linear mixed model as defined in lmer. |
data |
the data as a data frame |
dep |
a string naming the dependent variable from |
factors |
a vector of strings naming the fixed factors from
|
covs |
a vector of strings naming the covariates from |
cluster |
a vector of strings naming the clustering variables from
|
model_terms |
a list of character vectors describing fixed effects
terms. Not needed if |
re |
a list of lists specifying the models random effects. |
reml |
|
re_lrt |
|
re_ci |
|
fixed_intercept |
|
nested_terms |
a list of character vectors describing effects terms for nestet. It can be passed as right-hand formula. |
nested_intercept |
|
nested_re |
a list of lists specifying the models random effects. |
omnibus |
|
estimates_ci |
|
ci_method |
. |
boot_r |
a number bootstrap repetitions. |
ci_width |
a number between 50 and 99.9 (default: 95) specifying the confidence interval width for the plots. |
contrasts |
a named vector of the form |
show_contrastnames |
|
show_contrastcodes |
|
plot_x |
a string naming the variable placed on the horizontal axis of the plot |
plot_z |
a string naming the variable represented as separate lines in the plot |
plot_by |
a list of string naming the variables defining the levels for multiple plots |
plot_raw |
|
plot_yscale |
|
plot_xoriginal |
|
plot_black |
|
plot_around |
|
plot_re |
|
plot_re_method |
Method to plot the random effects. |
emmeans |
a rhs formula with the terms specifying the marginal means
to estimate (of the form |
posthoc |
a rhs formula with the terms specifying the table to apply
the comparisons (of the form |
simple_x |
The variable for which the simple effects (slopes) are computed |
simple_mods |
the variable that provides the levels at which the simple effects are computed |
simple_interactions |
should simple Interactions be computed |
covs_conditioning |
|
ccm_value |
Covariates conditioning mean offset value: how many
st.deviations around the means used to condition simple effects and plots.
Used if |
ccp_value |
Covariates conditioning percentile offset value: number of
percentiles around the median used to condition simple effects and plots.
Used if |
covs_scale_labels |
how the levels of a continuous moderator should
appear in tables and plots: |
adjust |
one or more of |
covs_scale |
a list of lists specifying the covariates scaling, one of
|
dep_scale |
Re-scale the dependent variable. |
scale_missing |
. |
norm_test |
|
df_method |
The method for computing the denominator degrees of freedom and F-statistics. "Satterthwaite" (default) uses Satterthwaite’s method; "Kenward-Roger" uses Kenward-Roger’s method, "lme4" returns the lme4-anova table, i.e., using the anova method for lmerMod objects as defined in the lme4-package |
norm_plot |
|
qq_plot |
|
resid_plot |
|
cluster_boxplot |
|
cluster_respred |
|
rand_hist |
|
re_corr |
|
A results object containing:
results$model | a property | ||||
results$info | a table | ||||
results$main$r2 | a table of R | ||||
results$main$anova | a table of ANOVA results | ||||
results$main$coefficients | a table | ||||
results$main$contrastCodeTables | an array of contrast coefficients tables | ||||
results$main$random | a table | ||||
results$main$randomcov | a table | ||||
results$main$ranova | a table | ||||
results$posthoc | an array of post-hoc tables | ||||
results$simpleEffects$anova | a table of ANOVA for simple effects | ||||
results$simpleEffects$coefficients | a table | ||||
results$simpleInteractions | an array of simple interactions tables | ||||
results$emmeans | an array of predicted means tables | ||||
results$mainPlots | an array of results plots | ||||
results$plotnotes | a html | ||||
results$assumptions$normtest | a table of normality tests | ||||
results$assumptions$qqplot | a q-q plot | ||||
results$assumptions$normplot | Residual histogram | ||||
results$assumptions$residPlot | Residual Predicted plot | ||||
results$assumptions$clusterBoxplot | Residuals boxplot by cluster | ||||
results$assumptions$clusterResPred | an array of random coefficients histograms | ||||
results$assumptions$randHist | an array of random coefficients histograms | ||||
results$predicted | an output | ||||
results$residuals | an output | ||||
Tables can be converted to data frames with asDF
or as.data.frame
. For example:
results$info$asDF
as.data.frame(results$info)
data(clustermanymodels)
GAMLj3::gamlj_mixed(formula = ycont ~ 1 + x+( 1|cluster ),
data = clustermanymodels
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.