modmed: Perform an analysis of parallel moderated mediations...

Description Usage Arguments Value References See Also Examples

View source: R/modmed.R

Description

Perform an analysis of parallel moderated mediations according to an extension of Edwards and Lambert (2007) to allow multiple methods.

Usage

1
2
3
modmed(dataset = NA, draws = 1000, x = NA, m = NA, y = NA, z = NA,
  model = c("DFS"), ctrl_s1 = NA, ctrl_s2 = NA, inst_x = NA,
  inst_m = NA, method = "OLS")

Arguments

dataset

Tibble. Table containing the variables used in the model; ideally, fixed effects should be removed and numeric variables scaled.

draws

Integer. Refers to the number of random samples to draw for the bootstrap.

x

Character string. Independent variable.

m

Character vector. Mediating variables. If several values are provided, parallel paths will be estimated.

y

Character string. Dependent variable.

z

Character string. Moderating variable.

model

Character string. Specify the moderation stages: "D","F","S","DF","DS","FS","DFS" (D for direct, F for first stage, S for second stage).

ctrl_s1

List of character vectors. Specify the sets of control variables for the first stage equations (i.e. the controls for each mediating variable).

ctrl_s2

Character vector. Specify the control variables for the second stage equation (i.e. the controls for the dependent variable).

inst_x

Character vector. Specify the set of instrumental variables for the independent variable.

inst_m

List of character vectors. Specify the sets of instrumental variables for the mediating variables.

method

Character vector. Estimation method: "OLS", "WLS", "SUR", "2SLS", "W2SLS", or "3SLS".

Value

A list of five objects:

specifications

User input;

analysis

First and second stages estimation;

coefficients

Bootstapped coefficients;

simplepaths

Bootstrapped simple paths;

pathmodel

Paths synthesis.

References

Edwards, J. R., & Lambert, L. S. (2007). Methods for integrating moderation and mediation: a general analytical framework using moderated path analysis. Psychological Methods, 12(1), 1<e2><80><93>22.

Holzhacker, M., Krishnan, R., & Mahlendorf, M. D. (2015). Unraveling the Black Box of Cost Behavior: An Empirical Investigation of Risk Drivers, Managerial Resource Procurement, and Cost Elasticity. The Accounting Review, 90(6), 2305<e2><80><93>2335.

See Also

modmed_ui()

modmed_simplepaths()

modmed_paths_table()

modmed_paths_graph()

modmed_marginal_effect()

modmed_marginal_graph()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
library(modelest)
data("edwards2007")
dataset <- edwards2007
draws = 10
x <- "fbkc"
m <- "satc"
y <- "comc"
z <- "gen"
mm <- modmed(dataset = dataset,
             draws = draws,
             model = "DFS",
             method = "OLS",
             x = x,
             m = m,
             y = y,
             z = z,
             ctrl_s1 = NA,
             ctrl_s2 = NA,
             inst_x = NA,
             inst_m = NA)

NicolasJBM/model documentation built on Feb. 15, 2018, 11:12 p.m.