Skip to content

[Feature Request]: variables with interaction variables #279

@gogonzo

Description

@gogonzo

Feature description

In teal.modules.clinical::tm_a_mmrm variables can be defined as interaction with "BASE:AVISIT". In tidyselect this denotes column range between BASE and AVISIT.

    tm_a_mmrm(
      label = "MMRM",
      dataname = "ADQS",
      aval_var = choices_selected(c("AVAL", "CHG"), "AVAL"),
      id_var = choices_selected(c("USUBJID", "SUBJID"), "USUBJID"),
      arm_var = choices_selected(c("ARM", "ARMCD"), "ARM"),
      visit_var = choices_selected(c("AVISIT", "AVISITN"), "AVISIT"),
      arm_ref_comp = arm_ref_comp,
      paramcd = choices_selected(
        choices = value_choices(data[["ADQS"]], "PARAMCD", "PARAM"),
        selected = "FKSI-FWB"
      ),
      cov_var = choices_selected(c("BASE", "AGE", "SEX", "BASE:AVISIT"), NULL)
    )

We probably need to have a special function/class for interaction BASE:AVISIT to provide such choice. This will have to be handled in variables(), determine.variables and in merge_srv, so that:

  • providing interaction(BASE:AVISIT) shouldn't throw any errors (yes there is an base::interaction but it just creates a factor/no special class).
  • determine.variables should determine choices and selected by keeping "interaction"
  • merge_srv should create an ANL containing interaction variables.

Above description is not exhaustive. There are many question marks, like for example:

  • picks_srv/determine returns choices and selected, should we returns c(..., "BASE:AVISIT") there or c(..., "BASE", "AVISIT").
  • merge_srv returns a list of variables in ANL - same as in picks_srv but renamed if duplicated across datasets, should we return c(..., "BASE:AVISIT") there or c(..., "BASE", "AVISIT")

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions