as_mmrm_df {rbmi}R Documentation

Creates a "MMRM" ready dataset

Description

Converts a design matrix + key variables into a common format In particular this function does the following:

Usage

as_mmrm_df(designmat, outcome, visit, subjid, group = NULL)

Arguments

designmat

a data.frame or matrix containing the covariates to use in the MMRM model. Dummy variables must already be expanded out, i.e. via stats::model.matrix(). Cannot contain any missing values

outcome

a numeric vector. The outcome value to be regressed on in the MMRM model.

visit

a character / factor vector. Indicates which visit the outcome value occurred on.

subjid

a character / factor vector. The subject identifier used to link separate visits that belong to the same subject.

group

a character / factor vector. Indicates which treatment group the patient belongs to.


[Package rbmi version 1.2.6 Index]