stack_data | R Documentation |
Takes a data.frame in with longitudinal data to be used in the multivariate mixed model function. Uses the pairwise combination created with the make_pairs() function to unroll the outcome matrix into a vector. The longitudinal predictor and time invariant covariates are processed accordingly.
stack_data(data, id, pairs, covars = NULL)
data |
A data.frame with the longitudinal data in long format. |
id |
A character value with the variable name of the subject identifier. |
pairs |
A character matrix with the pairs, returned from the make_pairs function |
covars |
(optional) a character vector with the names of the covariate vectors. |
a list of data.frames of length nrow(pairs).
## Not run: df_stacked <- stack_data( data = df, id = "id", pairs = pairs, covars = c("time", "sex", "time_failure") ) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.