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)a data matrix. Z is the treatment trajectory in the mediation analysis. The number of rows is the number of subjects, and the number of columns is the number of measured time points.
a data matrix. M is the mediator trajectory in the mediation analysis. The number of rows is the number of subjects, and the number of columns is the number of measured time points.
a data matrix. Y is the outcome trajectory in the mediation analysis. The number of rows is the number of subjects, and the number of columns is the number of measured time points.
a number indicates the width of treatment-mediator time interval in the mediator model.
a number indicates the width of treatment-outcome time interval in the outcome model.
a number indicates the width of mediator-outcome time interval in the outcome model.
a logic variable. Default is TRUE, an intercept term is included in the regression model.
a data matrix. Basis function on the \(s\) domain used in the functional data analysis. The number of columns is the number of basis function considered. If basis = NULL, Fourier basis functions will be generated.
a data matrix. The second derivative of the basis function on the \(s\) domain. The number of columns is the number of basis function considered. If Ld2.basis = NULL, the second derivative of Fourier basis functions will be generated.
a data matrix. Basis function on the \(t\) domain used in the functional data analysis. The number of columns is the number of basis function considered. If basis = NULL, Fourier basis functions will be generated.
a data matrix. The second derivative of the basis function on the \(t\) domain. The number of columns is the number of basis function considered. If Ld2.basis = NULL, the second derivative of Fourier basis functions will be generated.
a character of basis function type. Default is Fourier basis (basis.type = "fourier").
an integer, the number of basis function on the \(s\) domain included. If basis1 is provided, this argument will be ignored.
an integer, the number of basis function on the \(t\) domain included. If basis2 is provided, this argument will be ignored.
a numeric vector of length two, the time interval considered in the analysis. Default is (0,1).
a numeric vector of time grids of measurement. If timegrids = NULL, it is assumed the between measurement time interval is constant.
a numeric vector of tuning parameter values on the \(s\) domain in the mediator model.
a numeric vector of tuning parameter values on the \(t\) domain in the mediator model.
a numeric vector of tuning parameter values on the \(s\) domain in the outcome model.
a numeric vector of tuning parameter values on the \(t\) domain in the outcome model.
an integer indicating the number of simulations for inference.
a logical value, indicating whether or not bootstrap should be used. Default is TRUE.
a character of confidence interval method. boot.ci.type = "bca" bias corrected confidence interval; boot.ci.type = "perc" percentile confidence interval.
a number of significance level. Default is 0.95.
a logical value, indicating whether print out bootstrap replications.
a list of output for \(\alpha\) estimate
coefficients: the result of the coefficient estimates corresponding to the basis function
curve: the point-wise estimate of the coefficient curve
a list of output for \(\gamma\) estimate
coefficients: the result of the coefficient estimates corresponding to the basis function
curve: the point-wise estimate of the coefficient curve
a list of output for \(\beta\) estimate
coefficients: the result of the coefficient estimates corresponding to the basis function
curve: the point-wise estimate of the coefficient curve
a list of output for indirect effect estimate
curve: the point-wise estimate of the coefficient curve
a list of output for direct effect estimate
curve: the point-wise estimate of the coefficient curve
The historical influence mediation model is $$M(t)=\int_{\Omega_{t}^{1}}Z(s)\alpha(s,t)ds+\epsilon_{1}(t),$$ $$Y(t)=\int_{\Omega_{t}^{2}}Z(s)\gamma(s,t)ds+\int_{\Omega_{t}^{3}}M(s)\beta(s,t)ds+\epsilon_{2}(t),$$ where \(\alpha(s,t)\), \(\beta(s,t)\), \(\gamma(s,t)\) are coefficient curves; \(\Omega_{t}^{j}=[(t-\delta_{j})\vee 0,t]\) for \(j=1,2,3\). The model coefficient curves are estimated by minimizing the penalized \(L_{2}\)-loss.
Zhao et al. (2017). Functional Mediation Analysis with an Application to Functional Magnetic Resonance Imaging Data. arXiv preprint arXiv:1805.06923.
# 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.boot<-FMA.historical.boot(Z,M,Y,delta.grid1=3,delta.grid2=3,delta.grid3=3,
intercept=FALSE,timeinv=c(0,300))
# }
# NOT RUN {
##################################################
# }
Run the code above in your browser using DataLab