Title: | Causal Functional Mediation Analysis |
---|---|
Description: | Performs causal functional mediation analysis (CFMA) for functional treatment, functional mediator, and functional outcome. This package includes two functional mediation model types: (1) a concurrent mediation model and (2) a historical influence mediation model. See Zhao et al. (2018), Functional Mediation Analysis with an Application to Functional Magnetic Resonance Imaging Data, <arXiv:1805.06923> for details. |
Authors: | Yi Zhao <[email protected]>, Xi Luo <[email protected]>, Martin Lindquist <[email protected]>, Brian Caffo <[email protected]> |
Maintainer: | Yi Zhao <[email protected]> |
License: | GPL (>=2) |
Version: | 1.0.1 |
Built: | 2024-11-27 05:55:13 UTC |
Source: | https://github.com/zhaoyi1026/cfma |
cfma package performs causal functional mediation analysis (CFMA) for functional treatment, functional mediator, and functional outcome. This package includes two functional mediation model type: (1) a concurrent mediation model and (2) a historical influence mediation model.
Package: | cfma |
Type: | Package |
Version: | 1.0 |
Date: | 2018-05-16 |
License: | GPL (>=2) |
Yi Zhao <[email protected]> and Xi Luo <[email protected]> and Martin Lindquist <[email protected]> and Brian Caffo <[email protected]>
Maintainer: Yi Zhao <[email protected]>
"env.concurrent" is an R environment containing the data generated from a concurrent mediation model.
data("env.concurrent")
data("env.concurrent")
An R environment
Z
a data matrix, treatment trajectory of
subjects for
time points.
M
a data matrix, mediator trajectory of
subjects for
time points.
Y
a data matrix, outcome trajectory of
subjects for
time points.
alpha
a length vector model coefficient.
beta
a length vector model coefficient.
gamma
a length vector model coefficient.
The data was generated from the concurrent mediation model
is the convolution of hemodynamic response function (HRF) and event onsets.
data(env.concurrent) Z<-get("Z",env.concurrent) M<-get("M",env.concurrent) Y<-get("Y",env.concurrent)
data(env.concurrent) Z<-get("Z",env.concurrent) M<-get("M",env.concurrent) Y<-get("Y",env.concurrent)
"env.historical" is an R environment containing the data generated from a historical influence mediation model.
data("env.historical")
data("env.historical")
An R environment
Z
a data matrix, treatment trajectory of
subjects for
time points.
M
a data matrix, mediator trajectory of
subjects for
time points.
Y
a data matrix, outcome trajectory of
subjects for
time points.
alpha
a matrix model coefficient.
beta
a matrix model coefficient.
gamma
a matrix model coefficient.
The data was generated from the historical influence mediation model
where ,
,
are coefficient curves;
for
.
is the convolution of hemodynamic response function (HRF) and event onsets.
data(env.historical) Z<-get("Z",env.historical) M<-get("M",env.historical) Y<-get("Y",env.historical)
data(env.historical) Z<-get("Z",env.historical) M<-get("M",env.historical) Y<-get("Y",env.historical)
This function performs functional mediation regression under the concurrent model with given tuning parameter.
FMA.concurrent(Z, M, Y, intercept = TRUE, basis = NULL, Ld2.basis = NULL, basis.type = c("fourier"), nbasis = 3, timeinv = c(0, 1), timegrids = NULL, lambda.m = 0.01, lambda.y = 0.01)
FMA.concurrent(Z, M, Y, intercept = TRUE, basis = NULL, Ld2.basis = NULL, basis.type = c("fourier"), nbasis = 3, timeinv = c(0, 1), timegrids = NULL, lambda.m = 0.01, lambda.y = 0.01)
Z |
a data matrix. |
M |
a data matrix. |
Y |
a data matrix. |
intercept |
a logic variable. Default is |
basis |
a data matrix. Basis function used in the functional data analysis. The number of columns is the number of basis function considered. If |
Ld2.basis |
a data matrix. The second derivative of the basis function. The number of columns is the number of basis function considered. If |
basis.type |
a character of basis function type. Default is Fourier basis ( |
nbasis |
an integer, the number of basis function included. If |
timeinv |
a numeric vector of length two, the time interval considered in the analysis. Default is (0,1). |
timegrids |
a numeric vector of time grids of measurement. If |
lambda.m |
a numeric value of the tuning parameter in the mediator model. |
lambda.y |
a numeric value of the tuning parameter in the outcome model. |
The concurrent mediation model is
where ,
,
are coefficient curves. The model coefficient curves are estimated by minimizing the penalized
-loss.
basis |
the basis functions used in the analysis. |
M |
a list of output for the mediator model
|
Y |
a list of output for the outcome model
|
IE |
a list of output for the indirect effect comparing
|
DE |
a list of output for the direct effect comparing
|
Yi Zhao, Johns Hopkins University, [email protected];
Xi Luo, Brown University [email protected];
Martin Lindquist, Johns Hopkins University, [email protected];
Brian Caffo, Johns Hopkins University, [email protected]
Zhao et al. (2017). Functional Mediation Analysis with an Application to Functional Magnetic Resonance Imaging Data. arXiv preprint arXiv:1805.06923.
################################################## # Concurrent functional mediation model data(env.concurrent) Z<-get("Z",env.concurrent) M<-get("M",env.concurrent) Y<-get("Y",env.concurrent) # consider Fourier basis fit<-FMA.concurrent(Z,M,Y,intercept=FALSE,timeinv=c(0,300)) # estimate of alpha plot(fit$M$curve[1,],type="l",lwd=5) lines(get("alpha",env.concurrent),lty=2,lwd=2,col=2) # estimate of gamma plot(fit$Y$curve[1,],type="l",lwd=5) lines(get("gamma",env.concurrent),lty=2,lwd=2,col=2) # estimate of beta plot(fit$Y$curve[2,],type="l",lwd=5) lines(get("beta",env.concurrent),lty=2,lwd=2,col=2) # estimate of causal curves plot(fit$IE$curve,type="l",lwd=5) plot(fit$DE$curve,type="l",lwd=5) ##################################################
################################################## # Concurrent functional mediation model data(env.concurrent) Z<-get("Z",env.concurrent) M<-get("M",env.concurrent) Y<-get("Y",env.concurrent) # consider Fourier basis fit<-FMA.concurrent(Z,M,Y,intercept=FALSE,timeinv=c(0,300)) # estimate of alpha plot(fit$M$curve[1,],type="l",lwd=5) lines(get("alpha",env.concurrent),lty=2,lwd=2,col=2) # estimate of gamma plot(fit$Y$curve[1,],type="l",lwd=5) lines(get("gamma",env.concurrent),lty=2,lwd=2,col=2) # estimate of beta plot(fit$Y$curve[2,],type="l",lwd=5) lines(get("beta",env.concurrent),lty=2,lwd=2,col=2) # estimate of causal curves plot(fit$IE$curve,type="l",lwd=5) plot(fit$DE$curve,type="l",lwd=5) ##################################################
This function performs functional mediation regression under the concurrent model with given tuning parameter. Point-wise confidence bands are obtained from bootstrap.
FMA.concurrent.boot(Z, M, Y, intercept = TRUE, basis = NULL, Ld2.basis = NULL, basis.type = c("fourier"), nbasis = 3, timeinv = c(0, 1), timegrids = NULL, lambda.m = 0.01, lambda.y = 0.01, sims = 1000, boot = TRUE, boot.ci.type = c("bca", "perc"), conf.level = 0.95, verbose = TRUE)
FMA.concurrent.boot(Z, M, Y, intercept = TRUE, basis = NULL, Ld2.basis = NULL, basis.type = c("fourier"), nbasis = 3, timeinv = c(0, 1), timegrids = NULL, lambda.m = 0.01, lambda.y = 0.01, sims = 1000, boot = TRUE, boot.ci.type = c("bca", "perc"), conf.level = 0.95, verbose = TRUE)
Z |
a data matrix. |
M |
a data matrix. |
Y |
a data matrix. |
intercept |
a logic variable. Default is |
basis |
a data matrix. Basis function used in the functional data analysis. The number of columns is the number of basis function considered. If |
Ld2.basis |
a data matrix. The second derivative of the basis function. The number of columns is the number of basis function considered. If |
basis.type |
a character of basis function type. Default is Fourier basis ( |
nbasis |
an integer, the number of basis function included. If |
timeinv |
a numeric vector of length two, the time interval considered in the analysis. Default is (0,1). |
timegrids |
a numeric vector of time grids of measurement. If |
lambda.m |
a numeric value of the tuning parameter in the mediator model. |
lambda.y |
a numeric value of the tuning parameter in the outcome model. |
sims |
an integer indicating the number of simulations for inference. |
boot |
a logical value, indicating whether or not bootstrap should be used. Default is |
boot.ci.type |
a character of confidence interval method. |
conf.level |
a number of significance level. Default is 0.95. |
verbose |
a logical value, indicating whether print out bootstrap replications. |
The concurrent mediation model is
where ,
,
are coefficient curves. The model coefficient curves are estimated by minimizing the penalized
-loss.
alpha |
a list of output for
|
gamma |
: a list of output for
|
beta |
a list of output for
|
IE |
a list of output for indirect effect estimate
|
DE |
a list of output for direct effect estimate
|
Yi Zhao, Johns Hopkins University, [email protected];
Xi Luo, Brown University [email protected];
Martin Lindquist, Johns Hopkins University, [email protected];
Brian Caffo, Johns Hopkins University, [email protected]
Zhao et al. (2017). Functional Mediation Analysis with an Application to Functional Magnetic Resonance Imaging Data. arXiv preprint arXiv:1805.06923.
################################################## # Concurrent functional mediation model data(env.concurrent) Z<-get("Z",env.concurrent) M<-get("M",env.concurrent) Y<-get("Y",env.concurrent) # consider Fourier basis fit.boot<-FMA.concurrent.boot(Z,M,Y,intercept=FALSE,timeinv=c(0,300)) ##################################################
################################################## # Concurrent functional mediation model data(env.concurrent) Z<-get("Z",env.concurrent) M<-get("M",env.concurrent) Y<-get("Y",env.concurrent) # consider Fourier basis fit.boot<-FMA.concurrent.boot(Z,M,Y,intercept=FALSE,timeinv=c(0,300)) ##################################################
This function performs functional mediation regression under the concurrent model. Tuning parameter is chosen based on cross-validation.
FMA.concurrent.CV(Z, M, Y, intercept = TRUE, basis = NULL, Ld2.basis = NULL, basis.type = c("fourier"), nbasis = 3, timeinv = c(0, 1), timegrids = NULL, lambda = NULL, nfolds = 5)
FMA.concurrent.CV(Z, M, Y, intercept = TRUE, basis = NULL, Ld2.basis = NULL, basis.type = c("fourier"), nbasis = 3, timeinv = c(0, 1), timegrids = NULL, lambda = NULL, nfolds = 5)
Z |
a data matrix. |
M |
a data matrix. |
Y |
a data matrix. |
intercept |
a logic variable. Default is |
basis |
a data matrix. Basis function used in the functional data analysis. The number of columns is the number of basis function considered. If |
Ld2.basis |
a data matrix. The second derivative of the basis function. The number of columns is the number of basis function considered. If |
basis.type |
a character of basis function type. Default is Fourier basis ( |
nbasis |
an integer, the number of basis function included. If |
timeinv |
a numeric vector of length two, the time interval considered in the analysis. Default is (0,1). |
timegrids |
a numeric vector of time grids of measurement. If |
lambda |
a numeric vector of tuning parameter values. |
nfolds |
a number gives the number of folds in cross-validation. |
The concurrent mediation model is
where ,
,
are coefficient curves. The model coefficient curves are estimated by minimizing the penalized
-loss. Tuning parameter
controls the smoothness of the estimated curves, and is chosen by cross-validation.
basis |
the basis functions used in the analysis. |
M |
a list of output for the mediator model
|
Y |
a list of output for the outcome model
|
IE |
a list of output for the indirect effect comparing
|
DE |
a list of output for the direct effect comparing
|
Yi Zhao, Johns Hopkins University, [email protected];
Xi Luo, Brown University [email protected];
Martin Lindquist, Johns Hopkins University, [email protected];
Brian Caffo, Johns Hopkins University, [email protected]
Zhao et al. (2017). Functional Mediation Analysis with an Application to Functional Magnetic Resonance Imaging Data. arXiv preprint arXiv:1805.06923.
################################################## # Concurrent functional mediation model data(env.concurrent) Z<-get("Z",env.concurrent) M<-get("M",env.concurrent) Y<-get("Y",env.concurrent) ## Not run: # consider Fourier basis fit<-FMA.concurrent.CV(Z,M,Y,intercept=FALSE,timeinv=c(0,300)) # estimate of alpha plot(fit$M$curve[1,],type="l",lwd=5) lines(get("alpha",env.concurrent),lty=2,lwd=2,col=2) # estimate of gamma plot(fit$Y$curve[1,],type="l",lwd=5) lines(get("gamma",env.concurrent),lty=2,lwd=2,col=2) # estimate of beta plot(fit$Y$curve[2,],type="l",lwd=5) lines(get("beta",env.concurrent),lty=2,lwd=2,col=2) # estimate of causal curves plot(fit$IE$curve,type="l",lwd=5) plot(fit$DE$curve,type="l",lwd=5) ## End(Not run) ##################################################
################################################## # Concurrent functional mediation model data(env.concurrent) Z<-get("Z",env.concurrent) M<-get("M",env.concurrent) Y<-get("Y",env.concurrent) ## Not run: # consider Fourier basis fit<-FMA.concurrent.CV(Z,M,Y,intercept=FALSE,timeinv=c(0,300)) # estimate of alpha plot(fit$M$curve[1,],type="l",lwd=5) lines(get("alpha",env.concurrent),lty=2,lwd=2,col=2) # estimate of gamma plot(fit$Y$curve[1,],type="l",lwd=5) lines(get("gamma",env.concurrent),lty=2,lwd=2,col=2) # estimate of beta plot(fit$Y$curve[2,],type="l",lwd=5) lines(get("beta",env.concurrent),lty=2,lwd=2,col=2) # estimate of causal curves plot(fit$IE$curve,type="l",lwd=5) plot(fit$DE$curve,type="l",lwd=5) ## End(Not run) ##################################################
This function performs functional mediation regression under the historical influence model with given tuning parameter.
FMA.historical(Z, M, Y, delta.grid1 = 1, delta.grid2 = 1, delta.grid3 = 1, intercept = TRUE, basis1 = NULL, Ld2.basis1 = NULL, basis2 = NULL, Ld2.basis2 = NULL, basis.type = c("fourier"), nbasis1 = 3, nbasis2 = 3, timeinv = c(0, 1), timegrids = NULL, lambda1.m = 0.01, lambda2.m = 0.01, lambda1.y = 0.01, lambda2.y = 0.01)
FMA.historical(Z, M, Y, delta.grid1 = 1, delta.grid2 = 1, delta.grid3 = 1, intercept = TRUE, basis1 = NULL, Ld2.basis1 = NULL, basis2 = NULL, Ld2.basis2 = NULL, basis.type = c("fourier"), nbasis1 = 3, nbasis2 = 3, timeinv = c(0, 1), timegrids = NULL, lambda1.m = 0.01, lambda2.m = 0.01, lambda1.y = 0.01, lambda2.y = 0.01)
Z |
a data matrix. |
M |
a data matrix. |
Y |
a data matrix. |
delta.grid1 |
a number indicates the width of treatment-mediator time interval in the mediator model. |
delta.grid2 |
a number indicates the width of treatment-outcome time interval in the outcome model. |
delta.grid3 |
a number indicates the width of mediator-outcome time interval in the outcome model. |
intercept |
a logic variable. Default is |
basis1 |
a data matrix. Basis function on the |
Ld2.basis1 |
a data matrix. The second derivative of the basis function on the |
basis2 |
a data matrix. Basis function on the |
Ld2.basis2 |
a data matrix. The second derivative of the basis function on the |
basis.type |
a character of basis function type. Default is Fourier basis ( |
nbasis1 |
an integer, the number of basis function on the |
nbasis2 |
an integer, the number of basis function on the |
timeinv |
a numeric vector of length two, the time interval considered in the analysis. Default is (0,1). |
timegrids |
a numeric vector of time grids of measurement. If |
lambda1.m |
a numeric vector of tuning parameter values on the |
lambda2.m |
a numeric vector of tuning parameter values on the |
lambda1.y |
a numeric vector of tuning parameter values on the |
lambda2.y |
a numeric vector of tuning parameter values on the |
The historical influence mediation model is
where ,
,
are coefficient curves;
for
. The model coefficient curves are estimated by minimizing the penalized
-loss.
basis1 |
the basis functions on the |
basis2 |
the basis functions on the |
M |
a list of output for the mediator model
|
Y |
a list of output for the outcome model
|
IE |
a list of output for the indirect effect comparing
|
DE |
a list of output for the direct effect comparing
|
Yi Zhao, Johns Hopkins University, [email protected];
Xi Luo, Brown University [email protected];
Martin Lindquist, Johns Hopkins University, [email protected];
Brian Caffo, Johns Hopkins University, [email protected]
Zhao et al. (2017). Functional Mediation Analysis with an Application to Functional Magnetic Resonance Imaging Data. arXiv preprint arXiv:1805.06923.
################################################## # Historical influence functional mediation model data(env.historical) Z<-get("Z",env.historical) M<-get("M",env.historical) Y<-get("Y",env.historical) # consider Fourier basis fit<-FMA.historical(Z,M,Y,delta.grid1=3,delta.grid2=3,delta.grid3=3, intercept=FALSE,timeinv=c(0,300)) # estimate of causal curves plot(fit$IE$curve,type="l",lwd=5) plot(fit$DE$curve,type="l",lwd=5) ##################################################
################################################## # Historical influence functional mediation model data(env.historical) Z<-get("Z",env.historical) M<-get("M",env.historical) Y<-get("Y",env.historical) # consider Fourier basis fit<-FMA.historical(Z,M,Y,delta.grid1=3,delta.grid2=3,delta.grid3=3, intercept=FALSE,timeinv=c(0,300)) # estimate of causal curves plot(fit$IE$curve,type="l",lwd=5) plot(fit$DE$curve,type="l",lwd=5) ##################################################
This function performs functional mediation regression under the historical influence model with given tuning parameter. Point-wise confidence bands are obtained from bootstrap.
FMA.historical.boot(Z, M, Y, delta.grid1 = 1, delta.grid2 = 1, delta.grid3 = 1, intercept = TRUE, basis1 = NULL, Ld2.basis1 = NULL, basis2 = NULL, Ld2.basis2 = NULL, basis.type = c("fourier"), nbasis1 = 3, nbasis2 = 3, timeinv = c(0, 1), timegrids = NULL, lambda1.m = 0.01, lambda2.m = 0.01, lambda1.y = 0.01, lambda2.y = 0.01, sims = 1000, boot = TRUE, boot.ci.type = c("bca", "perc"), conf.level = 0.95, verbose = TRUE)
FMA.historical.boot(Z, M, Y, delta.grid1 = 1, delta.grid2 = 1, delta.grid3 = 1, intercept = TRUE, basis1 = NULL, Ld2.basis1 = NULL, basis2 = NULL, Ld2.basis2 = NULL, basis.type = c("fourier"), nbasis1 = 3, nbasis2 = 3, timeinv = c(0, 1), timegrids = NULL, lambda1.m = 0.01, lambda2.m = 0.01, lambda1.y = 0.01, lambda2.y = 0.01, sims = 1000, boot = TRUE, boot.ci.type = c("bca", "perc"), conf.level = 0.95, verbose = TRUE)
Z |
a data matrix. |
M |
a data matrix. |
Y |
a data matrix. |
delta.grid1 |
a number indicates the width of treatment-mediator time interval in the mediator model. |
delta.grid2 |
a number indicates the width of treatment-outcome time interval in the outcome model. |
delta.grid3 |
a number indicates the width of mediator-outcome time interval in the outcome model. |
intercept |
a logic variable. Default is |
basis1 |
a data matrix. Basis function on the |
Ld2.basis1 |
a data matrix. The second derivative of the basis function on the |
basis2 |
a data matrix. Basis function on the |
Ld2.basis2 |
a data matrix. The second derivative of the basis function on the |
basis.type |
a character of basis function type. Default is Fourier basis ( |
nbasis1 |
an integer, the number of basis function on the |
nbasis2 |
an integer, the number of basis function on the |
timeinv |
a numeric vector of length two, the time interval considered in the analysis. Default is (0,1). |
timegrids |
a numeric vector of time grids of measurement. If |
lambda1.m |
a numeric vector of tuning parameter values on the |
lambda2.m |
a numeric vector of tuning parameter values on the |
lambda1.y |
a numeric vector of tuning parameter values on the |
lambda2.y |
a numeric vector of tuning parameter values on the |
sims |
an integer indicating the number of simulations for inference. |
boot |
a logical value, indicating whether or not bootstrap should be used. Default is |
boot.ci.type |
a character of confidence interval method. |
conf.level |
a number of significance level. Default is 0.95. |
verbose |
a logical value, indicating whether print out bootstrap replications. |
The historical influence mediation model is
where ,
,
are coefficient curves;
for
. The model coefficient curves are estimated by minimizing the penalized
-loss.
alpha |
a list of output for
|
gamma |
a list of output for
|
beta |
a list of output for
|
IE |
a list of output for indirect effect estimate
|
DE |
a list of output for direct effect estimate
|
Yi Zhao, Johns Hopkins University, [email protected];
Xi Luo, Brown University [email protected];
Martin Lindquist, Johns Hopkins University, [email protected];
Brian Caffo, Johns Hopkins University, [email protected]
Zhao et al. (2017). Functional Mediation Analysis with an Application to Functional Magnetic Resonance Imaging Data. arXiv preprint arXiv:1805.06923.
################################################## # Historical influence functional mediation model data(env.historical) Z<-get("Z",env.historical) M<-get("M",env.historical) Y<-get("Y",env.historical) # consider Fourier basis fit.boot<-FMA.historical.boot(Z,M,Y,delta.grid1=3,delta.grid2=3,delta.grid3=3, intercept=FALSE,timeinv=c(0,300)) ##################################################
################################################## # Historical influence functional mediation model data(env.historical) Z<-get("Z",env.historical) M<-get("M",env.historical) Y<-get("Y",env.historical) # consider Fourier basis fit.boot<-FMA.historical.boot(Z,M,Y,delta.grid1=3,delta.grid2=3,delta.grid3=3, intercept=FALSE,timeinv=c(0,300)) ##################################################
This function performs functional mediation regression under the historical influence model. Tuning parameter is chosen based on cross-validation.
FMA.historical.CV(Z, M, Y, delta.grid1 = 1, delta.grid2 = 1, delta.grid3 = 1, intercept = TRUE, basis1 = NULL, Ld2.basis1 = NULL, basis2 = NULL, Ld2.basis2 = NULL, basis.type = c("fourier"), nbasis1 = 3, nbasis2 = 3, timeinv = c(0, 1), timegrids = NULL, lambda1 = NULL, lambda2 = NULL, nfolds = 5)
FMA.historical.CV(Z, M, Y, delta.grid1 = 1, delta.grid2 = 1, delta.grid3 = 1, intercept = TRUE, basis1 = NULL, Ld2.basis1 = NULL, basis2 = NULL, Ld2.basis2 = NULL, basis.type = c("fourier"), nbasis1 = 3, nbasis2 = 3, timeinv = c(0, 1), timegrids = NULL, lambda1 = NULL, lambda2 = NULL, nfolds = 5)
Z |
a data matrix. |
M |
a data matrix. |
Y |
a data matrix. |
delta.grid1 |
a number indicates the width of treatment-mediator time interval in the mediator model. |
delta.grid2 |
a number indicates the width of treatment-outcome time interval in the outcome model. |
delta.grid3 |
a number indicates the width of mediator-outcome time interval in the outcome model. |
intercept |
a logic variable. Default is |
basis1 |
a data matrix. Basis function on the |
Ld2.basis1 |
a data matrix. The second derivative of the basis function on the |
basis2 |
a data matrix. Basis function on the |
Ld2.basis2 |
a data matrix. The second derivative of the basis function on the |
basis.type |
a character of basis function type. Default is Fourier basis ( |
nbasis1 |
an integer, the number of basis function on the |
nbasis2 |
an integer, the number of basis function on the |
timeinv |
a numeric vector of length two, the time interval considered in the analysis. Default is (0,1). |
timegrids |
a numeric vector of time grids of measurement. If |
lambda1 |
a numeric vector of tuning parameter values on the |
lambda2 |
a numeric vector of tuning parameter values on the |
nfolds |
a number gives the number of folds in cross-validation. |
The historical influence mediation model is
where ,
,
are coefficient curves;
for
. The model coefficient curves are estimated by minimizing the penalized
-loss. Tuning parameter
controls the smoothness of the estimated curves, and is chosen by cross-validation.
basis1 |
the basis functions on the |
basis2 |
the basis functions on the |
M |
a list of output for the mediator model
|
Y |
a list of output for the outcome model
|
IE |
a list of output for the indirect effect comparing
|
DE |
a list of output for the direct effect comparing
|
Yi Zhao, Johns Hopkins University, [email protected];
Xi Luo, Brown University [email protected];
Martin Lindquist, Johns Hopkins University, [email protected];
Brian Caffo, Johns Hopkins University, [email protected]
Zhao et al. (2017). Functional Mediation Analysis with an Application to Functional Magnetic Resonance Imaging Data. arXiv preprint arXiv:1805.06923.
################################################## # Historical influence functional mediation model data(env.historical) Z<-get("Z",env.historical) M<-get("M",env.historical) Y<-get("Y",env.historical) ## Not run: # consider Fourier basis fit<-FMA.historical.CV(Z,M,Y,delta.grid1=3,delta.grid2=3,delta.grid3=3, intercept=FALSE,timeinv=c(0,300)) ## End(Not run) ##################################################
################################################## # Historical influence functional mediation model data(env.historical) Z<-get("Z",env.historical) M<-get("M",env.historical) Y<-get("Y",env.historical) ## Not run: # consider Fourier basis fit<-FMA.historical.CV(Z,M,Y,delta.grid1=3,delta.grid2=3,delta.grid3=3, intercept=FALSE,timeinv=c(0,300)) ## End(Not run) ##################################################