View source: R/to.unbalanced.R
to.unbalanced | R Documentation |
Transforms a longitudinal data set in the balanced format to the unbalanced format.
to.unbalanced(data, id.col, times, Y.col, other.col = NA)
data |
a data frame with longitudinal data in the balanced format. That
is, in the format of 'one row per subject'. |
id.col |
a column number, or column name, in the data frame |
times |
a vector with the unique time points where the patients are observed. This is the study design time points in a balanced data set. |
Y.col |
a vector of column numbers, or column names, of longitudinal
variables, and/or time dependent covariates in the data frame |
other.col |
a vector of column numbers, or column names, of baseline
covariates, and/or other subject level data, as for example, survival data.
Default does not include |
A data frame with longitudinal data in the unbalanced format. The unbalanced format is considered in this context as the format where each row has data on each subject observation.
Ines Sousa
to.balanced
.
simul <- data.frame(num = 1:10, Y1.1 = rnorm(10), Y1.2 = rnorm(10), Y2.1 = rnorm(10), Y2.2 = rnorm(10), age = rnorm(10)) to.unbalanced(simul, id.col = 1, times = c(1, 2), Y.col = 2:5, other.col = 6)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.