gamlj_lm | R Documentation |
General Linear Model. Estimates models using lm()
function 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_lm(
formula = NULL,
data,
dep = NULL,
fixed_intercept = TRUE,
factors = NULL,
covs = NULL,
model_terms = NULL,
nested_terms = NULL,
nested_intercept = NULL,
omnibus = "F",
estimates_ci = TRUE,
betas_ci = FALSE,
ci_width = 95,
ci_method = "wald",
boot_r = 1000,
contrasts = NULL,
show_contrastnames = TRUE,
show_contrastcodes = FALSE,
vcov = FALSE,
plot_x = NULL,
plot_z = NULL,
plot_by = NULL,
plot_raw = FALSE,
plot_yscale = FALSE,
plot_xoriginal = FALSE,
plot_black = FALSE,
plot_around = "ci",
emmeans = NULL,
posthoc = NULL,
simple_x = NULL,
simple_mods = NULL,
simple_interactions = FALSE,
covs_scale = NULL,
covs_conditioning = "mean_sd",
ccm_value = 1,
ccp_value = 25,
covs_scale_labels = "labels",
adjust = list("bonf"),
posthoc_es = list("dm"),
d_ci = FALSE,
es = list("beta", "etap"),
homo_test = FALSE,
qq_plot = FALSE,
norm_test = FALSE,
norm_plot = FALSE,
resid_plot = FALSE,
intercept_info = FALSE,
es_info = FALSE,
dep_scale = "none",
se_method = "standard"
)
formula |
(optional) the formula of the model, see the examples. If not passed
model terms should be defined as a list in |
data |
the data as a data frame |
dep |
a string naming the dependent variable from |
fixed_intercept |
|
factors |
a vector of strings naming the fixed factors from
|
covs |
a vector of strings naming the covariates from |
model_terms |
a list of character vectors describing fixed effects
terms. Not needed if |
nested_terms |
A right-hand formula for the nested model. It can be passed as a list of character vectors describing effects terms for the nested model. |
nested_intercept |
|
omnibus |
Omnibus tests are based on F-test |
estimates_ci |
|
betas_ci |
|
ci_width |
a number between 50 and 99.9 (default: 95) specifying the confidence interval width for the plots. |
ci_method |
the method to compute the confidence intervals. It can be 'wald' (default) for large samples confidence intervals, 'quantile' for percentile bootstrap method, or 'bcai' for bias corrected accelarated method. |
boot_r |
a number bootstrap repetitions. |
contrasts |
a named vector of the form |
show_contrastnames |
|
show_contrastcodes |
|
vcov |
|
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 variables defining the levels at which a separate plot should be produced. |
plot_raw |
|
plot_yscale |
|
plot_xoriginal |
|
plot_black |
|
plot_around |
|
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 |
a character vector with the variable(s) providing the levels at which the simple effects are computed |
simple_interactions |
should simple Interactions be computed |
covs_scale |
a named vector of the form |
covs_conditioning |
' |
ccm_value |
how many st.deviations around the means used to condition
simple effects and plots. Used if |
ccp_value |
offsett (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 |
adjustment method for postho tests. One or more of
|
posthoc_es |
effect size indices for mean comparisons. One or more of
|
d_ci |
|
es |
a list of effect sizes to print out. They can be: |
homo_test |
|
qq_plot |
|
norm_test |
|
norm_plot |
|
resid_plot |
|
intercept_info |
|
es_info |
|
dep_scale |
Re-scale the dependent variable. |
se_method |
Method to compute the standard error.
Classical standard errors is the default |
A results object containing:
results$model | a property | ||||
results$info | a table | ||||
results$main$r2 | a table of R | ||||
results$main$intercept | a table of information for the model intercept | ||||
results$main$anova | a table of ANOVA results | ||||
results$main$effectsizes | a table of effect size indeces | ||||
results$main$coefficients | a table | ||||
results$main$vcov | a table | ||||
results$main$contrastCodeTables | an array of contrast coefficients tables | ||||
results$posthoc | an array of post-hoc tables | ||||
results$posthocEffectSize | an array of post-hoc effect size | ||||
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$homotest | a table of homogeneity tests | ||||
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$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('ToothGrowth')
GAMLj3::gamlj_lm(formula = len ~ supp, data = ToothGrowth)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.