smcfcs.casecohort | R Documentation |
Multiply imputes missing covariate values using substantive model compatible fully conditional specification for case cohort studies.
smcfcs.casecohort(originaldata, smformula, method, sampfrac, in.subco, ...)
originaldata |
The case-cohort data set (NOT a full cohort data set with a case-cohort substudy within it) |
smformula |
A formula of the form "Surv(entertime,t,d)~x", where d is the event (d=1) or censoring (d=0) indicator, t is the event or censoring time and entertime is equal to the time origin (typically 0) for individuals in the subcohort and is equal to (t-0.001) for cases outside the subcohort [this sets cases outside the subcohort to enter follow-up just before their event time. The value 0.001 may need to be modified depending on the time scale.] |
method |
A required vector of strings specifying for each variable either
that it does not need to be imputed (""), the type of regression model to be
be used to impute. Possible values are |
sampfrac |
The proportion of individuals from the underlying full cohort who are in the subcohort |
in.subco |
The name of a column in the dataset with 0/1s that indicates whether the subject is in the subcohort |
... |
Additional arguments to pass on to smcfcs |
This version of smcfcs
is designed for use with case cohort studies but where the analyst does not wish to,
or cannot (due to not having the necessary data) impute the full cohort. The function's arguments are the same
as for the main smcfcs function, except for smformula
, in.subco
, and sampfrac
- see above
for details on how these should be specified.
Ruth Keogh ruth.keogh@lshtm.ac.uk
Jonathan Bartlett jonathan.bartlett1@lshtm.ac.uk
#the following example is not run when the package is compiled on CRAN
#(to keep computation time down), but it can be run by package users
## Not run:
#as per the documentation for ex_cc, the sampling fraction is 10%
imps <- smcfcs.casecohort(ex_cc, smformula="Surv(entertime, t, d)~x+z", sampfrac=0.1,
in.subco="in.subco", method=c("", "", "norm", "", "", "", ""))
library(mitools)
impobj <- imputationList(imps$impDatasets)
models <- with(impobj, coxph(Surv(entertime,t,d)~x+z+cluster(id)))
summary(MIcombine(models))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.