h_mmrm_tmb_data {mmrm}R Documentation

Data for TMB Fit

Description

Data for TMB Fit

Usage

h_mmrm_tmb_data(
  formula_parts,
  data,
  weights,
  reml,
  singular = c("drop", "error", "keep"),
  drop_visit_levels,
  allow_na_response = FALSE,
  drop_levels = TRUE
)

Arguments

formula_parts

(mmrm_tmb_formula_parts)
list with formula parts from h_mmrm_tmb_formula_parts().

data

(data.frame)
which contains variables used in formula_parts.

weights

(vector)
weights to be used in the fitting process.

reml

(flag)
whether restricted maximum likelihood (REML) estimation is used, otherwise maximum likelihood (ML) is used.

singular

(string)
choices of method deal with rank-deficient matrices. "error" to stop the function return the error, "drop" to drop these columns, and "keep" to keep all the columns.

drop_visit_levels

(flag)
whether to drop levels for visit variable, if visit variable is a factor.

allow_na_response

(flag)
whether NA in response is allowed.

drop_levels

(flag)
whether drop levels for covariates. If not dropped could lead to singular matrix.

Details

Note that the subject_var must not be factor but can also be character. If it is character, then it will be converted to factor internally. Here the levels will be the unique values, sorted alphabetically and numerically if there is a common string prefix of numbers in the character elements. For full control on the order please use a factor.

Value

List of class mmrm_tmb_data with elements:


[Package mmrm version 0.3.11 Index]