jmstanBig | R Documentation |
function for joint model in BIG DATA using rstanarm
package
jmstanBig(
dtlong,
dtsurv,
longm,
survm,
samplesize = 50,
time_var,
id,
nchain = 1,
refresh = 2000
)
dtlong |
longitudinal dataset, which contains id,visit time,longitudinal measurements along with various covariates |
dtsurv |
survival dataset corresponding to the longitudinal dataset, with survival status and survival time |
longm |
model for longitudinal response |
survm |
survival model |
samplesize |
sample size to divide the Big data |
time_var |
time variable in longitudinal model, included in the longitudinal data |
id |
name of id column in longitudinal dataset |
nchain |
number of chain for MCMC |
refresh |
refresh rate for MCMC chain |
returns a list containing various output which are useful for prediction.
Atanu Bhattacharjee, Bhrigu Kumar Rajbongshi and Gajendra Kumar Vishwakarma
Goodrich, B., et al. "rstanarm: Bayesian applied regression modeling via Stan. R package version 2.17. 4." Online< http://mc-stan. org (2018).
jmbayesBig,jmcsBig,joinRMLBig
##
library(survival)
library(dplyr)
fit3<-jmstanBig(dtlong=long2,dtsurv = surv2,longm=y~ x7+visit+(1|id),
survm=Surv(time,status)~x1+visit,samplesize=200,time_var='visit',id='id')
P2<-postTraj(model<-fit3,m<-1,ids<-c(1,2,100))
pp1<-plot(P2$p1[[1]],plot_observed = TRUE)
pp2<-plot(P2$p1[[2]],plot_observed = TRUE)
pp3<-plot(P2$p1[[3]],plot_observed = TRUE)
##
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.