sem_appl: Structural equation modeling approach

Description Usage Arguments Value Examples

View source: R/sem_functions.R

Description

Function which uses the sem function in the lavaan package to fit the model

L = α0 + α1*X + ε1, ε1 ~ N(0,σ1^2)

K = α2 + α3*X + α4*L + ε2, ε2 ~ N(0,σ2^2)

Y = α5 + α6*K + αXY*X + ε3, ε3 ~ N(0,σ3^2)

in order to obtain point and standard error estimates of the parameters α1, α3, α4, α6, αXY for the GLM setting. See the vignette for more details.

Usage

1
sem_appl(Y = NULL, X = NULL, K = NULL, L = NULL)

Arguments

Y

Numeric input vector for the primary outcome.

X

Numeric input vector for the exposure variable.

K

Numeric input vector for the intermediate outcome.

L

Numeric input vector for the observed confounding factor.

Value

Returns a list with point estimates of the parameters (point_estimates), standard error estimates (SE_estimates) and p-values from large-sample Wald-type tests (pvalues).

Examples

1
2
dat <- generate_data(setting = "GLM")
sem_appl(Y = dat$Y, X = dat$X, K = dat$K, L = dat$L)

CIEE documentation built on May 2, 2019, 6:39 a.m.