From 2504f94bd2cf1b950f4da5004751fd2eaadea9f1 Mon Sep 17 00:00:00 2001 From: wlandau Date: Thu, 11 Jul 2024 13:19:16 -0400 Subject: [PATCH] Remove role attribute from vignettes --- vignettes/archetypes.Rmd | 1 - vignettes/archetypes.Rmd.source | 1 - vignettes/bcva.Rmd | 1 - vignettes/bcva.Rmd.source | 1 - vignettes/fev1.Rmd | 1 - vignettes/fev1.Rmd.source | 1 - vignettes/subgroup.Rmd | 2 -- vignettes/subgroup.Rmd.source | 1 - vignettes/usage.Rmd | 12 +++++------- vignettes/usage.Rmd.source | 11 +++++------ 10 files changed, 10 insertions(+), 22 deletions(-) diff --git a/vignettes/archetypes.Rmd b/vignettes/archetypes.Rmd index a2e66fec..fad3122b 100644 --- a/vignettes/archetypes.Rmd +++ b/vignettes/archetypes.Rmd @@ -35,7 +35,6 @@ data(fev_data, package = "mmrm") data <- fev_data |> brm_data( outcome = "FEV1", - role = "response", group = "ARMCD", time = "AVISIT", patient = "USUBJID", diff --git a/vignettes/archetypes.Rmd.source b/vignettes/archetypes.Rmd.source index 43895fcb..a154d0eb 100644 --- a/vignettes/archetypes.Rmd.source +++ b/vignettes/archetypes.Rmd.source @@ -44,7 +44,6 @@ data(fev_data, package = "mmrm") data <- fev_data |> brm_data( outcome = "FEV1", - role = "response", group = "ARMCD", time = "AVISIT", patient = "USUBJID", diff --git a/vignettes/bcva.Rmd b/vignettes/bcva.Rmd index bfe023a4..1d96369e 100644 --- a/vignettes/bcva.Rmd +++ b/vignettes/bcva.Rmd @@ -88,7 +88,6 @@ The rest of the pre-processing steps create factors for the study arm and visit + mutate(AVISIT = gsub("VIS0*", "VIS", as.character(AVISIT))) |> + brm_data( + outcome = "BCVA_CHG", -+ role = "change", + group = "ARMCD", + time = "AVISIT", + patient = "USUBJID", diff --git a/vignettes/bcva.Rmd.source b/vignettes/bcva.Rmd.source index 7ce26d02..c5c301eb 100644 --- a/vignettes/bcva.Rmd.source +++ b/vignettes/bcva.Rmd.source @@ -100,7 +100,6 @@ bcva_data <- bcva_data |> mutate(AVISIT = gsub("VIS0*", "VIS", as.character(AVISIT))) |> brm_data( outcome = "BCVA_CHG", - role = "change", group = "ARMCD", time = "AVISIT", patient = "USUBJID", diff --git a/vignettes/fev1.Rmd b/vignettes/fev1.Rmd index 3c2a7dfd..8911dd88 100644 --- a/vignettes/fev1.Rmd +++ b/vignettes/fev1.Rmd @@ -100,7 +100,6 @@ The rest of the pre-processing steps create factors for the study arm and visit > fev_data <- brm_data( + data = fev_data, + outcome = "FEV1_CHG", -+ role = "change", + group = "ARMCD", + time = "AVISIT", + patient = "USUBJID", diff --git a/vignettes/fev1.Rmd.source b/vignettes/fev1.Rmd.source index 331e07f2..dea85627 100644 --- a/vignettes/fev1.Rmd.source +++ b/vignettes/fev1.Rmd.source @@ -111,7 +111,6 @@ The rest of the pre-processing steps create factors for the study arm and visit fev_data <- brm_data( data = fev_data, outcome = "FEV1_CHG", - role = "change", group = "ARMCD", time = "AVISIT", patient = "USUBJID", diff --git a/vignettes/subgroup.Rmd b/vignettes/subgroup.Rmd index c510db71..773a35fa 100644 --- a/vignettes/subgroup.Rmd +++ b/vignettes/subgroup.Rmd @@ -88,7 +88,6 @@ When you create the special classed dataset for `brms.mmrm` using `brm_data()`, data <- brm_data( data = raw_data, outcome = "response", - role = "response", baseline = NULL, group = "group", subgroup = "subgroup", @@ -108,7 +107,6 @@ str(data) #> $ missing : logi [1:900] FALSE FALSE FALSE FALSE FALSE FALSE ... #> $ response: num [1:900] 1.263 -0.326 1.33 1.272 0.415 ... #> - attr(*, "brm_outcome")= chr "response" -#> - attr(*, "brm_role")= chr "response" #> - attr(*, "brm_group")= chr "group" #> - attr(*, "brm_subgroup")= chr "subgroup" #> - attr(*, "brm_time")= chr "time" diff --git a/vignettes/subgroup.Rmd.source b/vignettes/subgroup.Rmd.source index 841587f3..dcba82d1 100644 --- a/vignettes/subgroup.Rmd.source +++ b/vignettes/subgroup.Rmd.source @@ -62,7 +62,6 @@ When you create the special classed dataset for `brms.mmrm` using `brm_data()`, data <- brm_data( data = raw_data, outcome = "response", - role = "response", baseline = NULL, group = "group", subgroup = "subgroup", diff --git a/vignettes/usage.Rmd b/vignettes/usage.Rmd index 7470411a..ef9759ff 100644 --- a/vignettes/usage.Rmd +++ b/vignettes/usage.Rmd @@ -71,7 +71,6 @@ Next, create a special classed dataset that the package will recognize. The clas data <- brm_data( data = raw_data, outcome = "response", - role = "response", group = "group", patient = "patient", time = "time", @@ -99,13 +98,12 @@ data class(data) #> [1] "brms_mmrm_data" "tbl_df" "tbl" "data.frame" -roles <- attributes(data) -roles$row.names <- NULL -str(roles) +attributes <- attributes(data) +attributes$row.names <- NULL +str(attributes) #> List of 10 #> $ names : chr [1:7] "patient" "time" "response" "group" ... #> $ brm_outcome : chr "response" -#> $ brm_role : chr "response" #> $ brm_group : chr "group" #> $ brm_time : chr "time" #> $ brm_patient : chr "patient" @@ -381,8 +379,8 @@ model$brms.mmrm_formula Regardless of the choice of fixed effects formula, `brms.mmrm` performs inference on the marginal distributions at each treatment group and time point of the mean of the following quantities: 1. Response. -2. Change from baseline, if you set `role` to `"change"` in `brm_data()`. -3. Treatment difference, in terms of change from baseline. +2. Change from baseline. Only reported if you originally declared a baseline time point with the `reference_time` argument of `brm_data()`. +3. Treatment difference. If you declared a baseline in (2), then treatment difference is calculated in terms of change from baseline. Otherwise, it is calculated in terms of raw response. 4. Effect size: treatment difference divided by the residual standard deviation. To derive posterior draws of these marginals, use the `brm_marginal_draws()` function. diff --git a/vignettes/usage.Rmd.source b/vignettes/usage.Rmd.source index 97375df6..cab8dae1 100644 --- a/vignettes/usage.Rmd.source +++ b/vignettes/usage.Rmd.source @@ -61,7 +61,6 @@ Next, create a special classed dataset that the package will recognize. The clas data <- brm_data( data = raw_data, outcome = "response", - role = "response", group = "group", patient = "patient", time = "time", @@ -74,9 +73,9 @@ data class(data) -roles <- attributes(data) -roles$row.names <- NULL -str(roles) +attributes <- attributes(data) +attributes$row.names <- NULL +str(attributes) ``` # Formula @@ -183,8 +182,8 @@ model$brms.mmrm_formula Regardless of the choice of fixed effects formula, `brms.mmrm` performs inference on the marginal distributions at each treatment group and time point of the mean of the following quantities: 1. Response. -2. Change from baseline, if you set `role` to `"change"` in `brm_data()`. -3. Treatment difference, in terms of change from baseline. +2. Change from baseline. Only reported if you originally declared a baseline time point with the `reference_time` argument of `brm_data()`. +3. Treatment difference. If you declared a baseline in (2), then treatment difference is calculated in terms of change from baseline. Otherwise, it is calculated in terms of raw response. 4. Effect size: treatment difference divided by the residual standard deviation. To derive posterior draws of these marginals, use the `brm_marginal_draws()` function.