Movatterモバイル変換


[0]ホーム

URL:


Title:Mediation Analysis for Zero-Inflated Mediators
Version:0.0.2
Description:A novel mediation analysis approach to address zero-inflated mediators containing true zeros and false zeros. See Jiang et al (2023) "A Novel Causal Mediation Analysis Approach for Zero-Inflated Mediators" <doi:10.48550/arXiv.2301.10064> for more details.
URL:https://github.com/meilinjiang/MAZE
BugReports:https://github.com/meilinjiang/MAZE/issues
License:GPL-2 |GPL-3
Encoding:UTF-8
RoxygenNote:7.2.2
Depends:R (≥ 4.0), flexmix, numDeriv, pracma
LazyData:true
Suggests:knitr, rmarkdown
VignetteBuilder:knitr
LinkingTo:Rcpp
Imports:Rcpp, stats, foreach, doParallel, MASS
NeedsCompilation:yes
Packaged:2023-02-14 18:48:37 UTC; meilinjiang
Author:Meilin Jiang [aut, cre], Zhigang Li [aut]
Maintainer:Meilin Jiang <meilin.jiang@ufl.edu>
Repository:CRAN
Date/Publication:2023-02-16 08:20:10 UTC

DataGen

Description

Generate data under zero-inflated mediation models and calculate the true effects

Usage

DataGen(distM, theta, K, num_Z = 0, n, B, x1, x2, zval = NULL, mval = 0)

Arguments

distM

distribution of the mediator. One of 'zilonm', 'zinbm', and 'zipm' for zero-inflated log-normal, negative binomial, and Poisson mediators respectively

theta

vector of true parameter values

K

true number of componentK in the zero-inflated mixture mediators. Default isK=1 for zero-inflated (non-mixture) mediators

num_Z

number of confounder variables

n

number of observations to generate

B

the upper bound valueB to be used in the probability mechanism of observing false zeros

x1

the first value of independent variable of interest

x2

the second value of independent variable of interest

zval

the value of confounders to be conditional on when calculating true effects

mval

the fixed value of mediator to be conditional on when calculating true CDE

Value

true_eff: a vector containing true effects (NIE1, NIE2, NIE, NDE, and CDE)

dat: a data frame containing variables:

Author(s)

Meilin Jiangmeilin.jiang@ufl.edu and Zhigang Lizhigang.li@ufl.edu

Examples

betas.tr <- c(2, 0.12, -6.6, 6.3, -3.8, 0)delta.tr <- 1.1alpha0_k.tr <- c(0.4, 1.1)alpha1_k.tr <- c(0.1, 0.5)alphas.tr <- rbind(alpha0_k.tr,alpha1_k.tr)xi0.tr <- -1.5psi_km1.tr <- c(0.6)gammas.tr <- c(-1.8, 0.5)eta.tr <- 1theta <- c(betas.tr, delta.tr, alphas.tr,           xi0.tr, psi_km1.tr, gammas.tr, eta.tr)out <- DataGen(distM = 'zilonm', theta, K = 2, num_Z=0,               n = 200, B = 20, x1 = 0, x2 = 1, zval = NULL, mval = 0)(true_eff <- out$true_eff)dat <- out$dat

Mediation Analysis for ZEro-inflated mediators

Description

A novel mediation modeling approach to address zero-inflated mediators containing true zeros and false zeros.

Usage

MAZE(  data,  distM = c("zilonm", "zinbm", "zipm"),  K = 1,  selection = "AIC",  X,  M,  Y,  Z = NULL,  XMint = c(TRUE, FALSE),  x1,  x2,  zval = NULL,  mval = 0,  B = 20,  seed = 1,  ncore = 1)

Arguments

data

a data frame containing variables: an independent variableX, a mediatorM, an outcomeY, and confounder variablesZ (if any). See example dataset:data(zinb10)

distM

a vector with choices of the distribution of mediator to try with. One or more of 'zilonm', 'zinbm', and 'zipm' for zero-inflated log-normal, negative binomial, and Poisson mediators respectively. Default isc('zilonm', 'zinbm', 'zipm') where all three distributions are fitted and the final mediation model is selected by model selection criterionselection

K

a vector with choices of the number of componentK in the zero-inflated mixture mediators to try with. Default isK=1 for zero-inflated (non-mixture) mediators

selection

model selection criterion when more than one model (combination of different values indistM andK) is fitted. Either 'AIC' or 'BIC'. Default is 'AIC'

X

name of the independent variable. Can be continuous or discrete

M

name of the mediator variable. Non-negative values

Y

name of the outcome variable. Continuous values

Z

name(s) of confounder variables (if any)

XMint

a logical vector of length 2 indicating whether to include the two exposure-mediator interaction terms between (i)X and1_{(M>0)} and (ii)X andM. Default isc(TRUE, FALSE), which only includes the first

x1

the first value of independent variable of interest

x2

the second value of independent variable of interest

zval

a vector of value(s) of confounders to be conditional on when estimating effects

mval

the fixed value of mediator to be conditional on when estimating CDE

B

the upper bound valueB to be used in the probability mechanism of observing false zeros

seed

an optional seed number to control randomness

ncore

number of cores available for parallel computing

Details

For an independent variableX, a zero-inflated mediatorM and a continuous outcome variableY, the following regression equation is used to model the association betweenY and(X,M):

Y_{xm1_{(m>0)}}=\beta_0+\beta_1m+\beta_2 1_{(m>0)}+\beta_3x+\beta_4x1_{(m>0)}+\beta_5xm+\epsilon

Users can choose to include either one, both, or none of the two exposure-mediator interaction terms between (i)X and1_{(M>0)} and (ii)X andM using the argumentXMint.

For mediators, zero-inflated log-normal, zero-inflated negative binomial, and zero-inflated Poisson distributions are considered and can be specified through the argumentdistM.

The indirect and direct effects (NIE1, NIE2, NIE, NDE, and CDE) are estimated forX changing fromx1 tox2. When confounders are present, the conditional effects are estimated given the fixed valuezval.

Value

a list containing:

Author(s)

Meilin Jiangmeilin.jiang@ufl.edu and Zhigang Lizhigang.li@ufl.edu

Examples

data(zinb10)maze_out <- MAZE(data = zinb10,                 distM = c('zilonm', 'zinbm', 'zipm'),  K = 1,                 selection = 'AIC',                 X = 'X', M = 'Mobs', Y = 'Y', Z = NULL,                 XMint = c(TRUE, FALSE),                 x1 = 0, x2 = 1, zval = NULL, mval = 0,                 B = 20, seed = 1)## results of selected mediation modelmaze_out$results_effects # indirect and direct effectsmaze_out$selected_model_name # selected distribution of the mediator and number of components Kmaze_out$results_parameters # model parametersmaze_out$BIC; maze_out$AIC # BIC and AIC of the selected mediation model

Example dataset 'zinb10'

Description

An example dataset generated from the proposed model with a zero-inflated negative binomial mediator (K=1). The mediator contains 10% zero values in which half are false zeros.

Usage

data(zinb10)

Format

An object of class'data.frame' with 100 rows and 3 variables:

X

independent variable, continuous data type

Y

outcome, continuous data type

Mobs

observed mediator values with possibly false zeros, count data type

Examples

data(zinb10)head(zinb10)

[8]ページ先頭

©2009-2025 Movatter.jp