getGImpute | R Documentation |
Adds the ith column of imputed infection times from gImpute
to an
existing dataset.
getGImpute(rtdat, gdat, i)
rtdat |
An existing dataset generated from |
gdat |
The imputed dateset from |
i |
The ith imputed infection time in gdat. |
data.frame
# See full examples at https://github.com/vando026/ahri/wiki/6-G-Imputation
# install.packages(system.file("IntCens_0.2.tar.gz", package = "ahri"), repos = NULL, type = 'source')
library(IntCens)
data(gdat_demo)
data(rtdat_demo)
home <- file.path('/home/alain/Seafile/AHRI_Data')
write.table(gdat_demo, file=file.path(home, "intcens/input_data.txt"),
row.names=FALSE, quote=FALSE)
unireg(input = file.path(home, "intcens/input_data.txt"),
output = file.path(home, "intcens/res_dat.txt"),
model = "(Time, sero_event) = Age0 + Age2 + EverCircum",
subject_id = "IIntID", convergence_threshold=0.01, r = 1.0)
ureg_res <- readUniRegResults(
File=file.path(home, "intcens/res_dat.txt"))
Args <- setArgs(
Years=c(2005:2018), nSim=50,
Age=list(Mal=c(15, 54)))
gdates <- gImpute(gdat_demo, ureg_res, nSim=Args$nSim)
gdat_ex <- getGImpute(rtdat_demo, gdates, 1)
gdat_ex[gdat_ex$sero_event==1, ]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.