fimle.lnl: Full Information Maximum Likelihood Estimates in Linear...

Description Usage Arguments Details Value Author(s) References Examples

View source: R/fimle.lnl.R

Description

Parameter estimates in system of correlated linear M-model and linear Y-model with treatment-mediator interaction using the full information maximum likelihood method.

Usage

1
fimle.lnl(fit.M, fit.Y, treatment, rho = 0, t0 = 0, t1 = 1, m = 1)

Arguments

fit.M

a fitted model object for mediator. It must be an object generated by function “lm

fit.Y

a fitted model object for outcome. It must be an object generated by function “lm”. It can contain treatment-mediator interaction

treatment

a character string of the name of the treatment variable. This variable takes numerical values

rho

a numerical variable specifying the correlation coefficient between the residual of the M-model and the residual of the Y-model. Its range is between -1 and 1

t0

a reference value for the treatment

t1

another value for the treatment

m

a value specifying the level of the mediator. Used for CDE computation between the residual of the M-model and the residual of the Y-model. Its range is between -1 and 1

Details

P-values are computed from normal distribution.

Value

A list containing the following components:

M.model

a data frame containing the results for the M-model

Y.model

a data frame containing the results for the Y-model

Effects

a data frame containing estimated ACME, ADE, Total Effect, and CDE for treatment values t1 and t0

Variance

a matrix of variances and covariances of the parameters estimates

Author(s)

Kai Wang <kai-wang@uiowa.edu>

References

Wang, K. (2019) Maximum likelihood analysis of mediation models with treatment-mediator interaction. Revision submitted.

Examples

1
2
3
4
5
6
7
8
9
data("jobs", package = "mediation")

fit.M <- lm(job_seek ~ treat + econ_hard + sex + age, data=jobs)
fit.Y <- lm(depress2 ~ treat + job_seek + econ_hard + sex + age, data=jobs)
fimle.lnl(fit.M, fit.Y, "treat", rho=0.2)

fit.M <- lm(job_seek ~ treat + econ_hard + sex + age , data=jobs)
fit.Y <- lm(depress2 ~ treat*job_seek+ econ_hard + sex + age , data=jobs)
fimle.lnl(fit.M, fit.Y, "treat", rho=0.5)

iMediate documentation built on May 2, 2019, 4:32 a.m.