Description Usage Arguments Value Examples
View source: R/sem_functions.R
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.
1 |
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. |
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
).
1 2 | dat <- generate_data(setting = "GLM")
sem_appl(Y = dat$Y, X = dat$X, K = dat$K, L = dat$L)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.