figure_1_2_4 {eq5dsuite} | R Documentation |
Figure 1.2.4: Percentage of Respondents Who Had a Mixed Change Overall, by Dimension Improved or Worsened, Grouped by Procedure (or Other Grouping)
Description
This function focuses on patients classified as having "Mixed change" overall (i.e., some dimensions improved, others worsened). It then examines which dimensions improved vs. worsened for each subject. Results are summarized by a grouping variable (e.g., procedure) and time points. The final output is a table plus a ggplot object.
Usage
figure_1_2_4(
df,
name_id,
name_groupvar,
names_eq5d = NULL,
name_fu = NULL,
levels_fu = NULL
)
Arguments
df |
Data frame containing columns for EQ-5D dimensions, a grouping variable, a patient ID, and a follow-up variable |
name_id |
Character string indicating the patient ID column |
name_groupvar |
Character string for the grouping column (e.g. "procedure") |
names_eq5d |
Character vector naming the EQ-5D dimensions (e.g. c("mo","sc","ua","pd","ad")) |
name_fu |
Character string for the follow-up column (e.g. "time") |
levels_fu |
Character vector of length 2 specifying the time order (e.g. c("Pre-op","Post-op")) |
Value
A list with two elements:
plot_data |
A wide-format data frame of dimension-specific improvements/worsenings for "Mixed change" |
p |
A ggplot2 object showing a dimension-level bar chart from .pchc_plot_by_dim |
Examples
result <- figure_1_2_4(
df = example_data,
name_id = "id",
name_groupvar = "procedure",
names_eq5d = c("mo","sc","ua","pd","ad"),
name_fu = "time",
levels_fu = c("Pre-op","Post-op")
)
result$plot_data
result$p