fit_ancova {junco}R Documentation

ANCOVA Analysis

Description

Does the ANCOVA analysis, separately for each visit.

Usage

fit_ancova(
  vars = list(response = "AVAL", covariates = c(), arm = "ARM", visit = "AVISIT", id =
    "USUBJID"),
  data,
  conf_level = 0.95,
  weights_emmeans = "proportional"
)

Arguments

vars

(named list of string or character)
specifying the variables in the ANCOVA analysis. The following elements need to be included as character vectors and match corresponding columns in data:

  • response: the response variable.

  • covariates: the additional covariate terms (might also include interactions).

  • id: the subject ID variable (not really needed for the computations but for internal logistics).

  • arm: the treatment group variable (factor).

  • visit: the visit variable (factor).

Note that the arm variable is by default included in the model, thus should not be part of covariates.

data

(data.frame)
with all the variables specified in vars. Records with missing values in any independent variables will be excluded.

conf_level

(proportion)
confidence level of the interval.

weights_emmeans

(string)
argument from emmeans::emmeans(), 'counterfactual' by default.

Value

A tern_model object which is a list with model results:

Examples

library(mmrm)

fit <- fit_ancova(
  vars = list(
    response = "FEV1",
    covariates = c("RACE", "SEX"),
    arm = "ARMCD",
    id = "USUBJID",
    visit = "AVISIT"
  ),
  data = fev_data,
  conf_level = 0.9,
  weights_emmeans = "equal"
)


[Package junco version 0.1.1 Index]