jammGLM | R Documentation |
GLM mediation model
jammGLM(
data,
dep = NULL,
mediators = NULL,
factors = NULL,
covs = NULL,
modelTerms = NULL,
ciType = "standard",
ciWidth = 95,
bootN = 1000,
contrasts = NULL,
showRealNames = TRUE,
showContrastCode = FALSE,
bogus = FALSE,
simpleScale = "mean_sd",
cvalue = 1,
percvalue = 25,
simpleScaleLabels = "labels",
scaling = NULL,
tableOptions = list("beta", "component"),
pathOptions = list("suggested"),
mediatorsTerms = list(list()),
moderatorsTerms = list(list()),
formula
)
data |
the data as a data frame |
dep |
a string naming the dependent variable from |
mediators |
a vector of strings naming the mediators from |
factors |
a vector of strings naming the fixed factors from
|
covs |
a vector of strings naming the covariates from |
modelTerms |
a list of character vectors describing fixed effects terms. Not useful if formula is used |
ciType |
Choose the confidence interval type |
ciWidth |
a number between 50 and 99.9 (default: 95) specifying the confidence interval width for the parameter estimates |
bootN |
number of bootstrap samples for estimating confidence intervals |
contrasts |
a named vector of the form |
showRealNames |
|
showContrastCode |
|
bogus |
|
simpleScale |
|
cvalue |
offset value for conditioning. Values are mean +/- cvalue. |
percvalue |
offset value for conditioning. Values are median +/- pecvalue |
simpleScaleLabels |
style for presenting condition values of a moderator. It can be |
scaling |
a named vector of the form |
tableOptions |
a vector of options to be shown in the tables. |
pathOptions |
. |
mediatorsTerms |
a list of lists specifying the models for with the mediators as dependent variables. Not required in formula is used. |
moderatorsTerms |
a named list of the form list("med"=c("mod1",mod2"),med2="mod1") specifying the moderator(s) of each mediator. This is required to decide for which variable we need to condition the mediated effects and to single out moderators in the path diagram. If not specified, any interaction is considered as any other term in the model |
formula |
a list of formulas to use, see the examples |
A results object containing:
results$info | a table | ||||
results$pathmodelgroup$pathmodel | a path model | ||||
results$pathmodelgroup$pathnotes | a table | ||||
results$models$moderationEffects | a table | ||||
results$models$main | a table | ||||
results$models$contrastCodeTables | an array of contrast coefficients tables | ||||
results$regressions$overall | a group | ||||
results$regressions$mediator_regressions | an array of regressions for the mediators | ||||
results$regressions$full | a group | ||||
Tables can be converted to data frames with asDF
or as.data.frame
. For example:
results$info$asDF
as.data.frame(results$info)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.