prepare_data | R Documentation |
Data pre-processing for analysis with stochastic process model methodology.
prepare_data( x, col.id = NA, col.status = NA, col.age = NA, col.age.event = NA, covariates = NA, interval = 1, verbose = FALSE )
x |
A path to the file with table of follow-up oservations (longitudinal table). File formats: csv, sas7bdat |
col.id |
A name of column containing subject ID. This ID should be the same in both x (longitudinal) and y (vital statistics) tables. None: if col.id not provided, the first column of the x and first column of the y will be used by default. |
col.status |
A name of the column containing status variable (0/1, which is an indicator of death/censoring). Note: if not provided - then the column #2 from the y (vital statistics) dataset will be used. |
col.age |
A name of age column (also called 't1'). This column represents a time (age) of measurement. If not provided then the 3rd column from the longitudinal dataset (x) will be used. |
col.age.event |
A name of 'event' column. The event column indicates a time when the even occured (e.g. system failure). Note: if not provided then the 3rd column from the y (vital statistics) dataset will be used. |
covariates |
A list of covariates (physiological variables). If covariates not provided, then all columns from longitudinal table having index > 3 will be used as covariates. |
interval |
A number of breaks between observations for data for discrete model. This interval must be integer and should be equal or greater than 1. Default = 1 unit of time. |
verbose |
A verbosing output indicator. Default=FALSE. |
A list of two elements: first element contains a preprocessed data for continuous model, with arbitrary intervals between observations and second element contains a prepocessed data table for a discrete model (with constant intervals between observations).
## Not run: library(stpm) data <- prepare_data(x=system.file("extdata","longdat.csv",package="stpm")) head(data[[1]]) head(data[[2]]) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.