Skip to content

Commit

Permalink
Remove role attribute from vignettes
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau committed Jul 11, 2024
1 parent 66b5e33 commit 2504f94
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 22 deletions.
1 change: 0 additions & 1 deletion vignettes/archetypes.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ data(fev_data, package = "mmrm")
data <- fev_data |>
brm_data(
outcome = "FEV1",
role = "response",
group = "ARMCD",
time = "AVISIT",
patient = "USUBJID",
Expand Down
1 change: 0 additions & 1 deletion vignettes/archetypes.Rmd.source
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ data(fev_data, package = "mmrm")
data <- fev_data |>
brm_data(
outcome = "FEV1",
role = "response",
group = "ARMCD",
time = "AVISIT",
patient = "USUBJID",
Expand Down
1 change: 0 additions & 1 deletion vignettes/bcva.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion vignettes/bcva.Rmd.source
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion vignettes/fev1.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion vignettes/fev1.Rmd.source
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 0 additions & 2 deletions vignettes/subgroup.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
Expand Down
1 change: 0 additions & 1 deletion vignettes/subgroup.Rmd.source
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 5 additions & 7 deletions vignettes/usage.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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.
Expand Down
11 changes: 5 additions & 6 deletions vignettes/usage.Rmd.source
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 2504f94

Please sign in to comment.