Learn R Programming

eq5dsuite (version 1.0.1)

figure_1_2_5: Figure 1.2.5: Health Profile Grid (HPG) for Two Time Points

Description

This function creates a Health Profile Grid (HPG) for EQ-5D data, plotting each individual's change in health states (ranked from best to worst) between two time points. A diagonal reference line indicates no change; points above the line reflect improvement, and points below indicate deterioration.

Usage

figure_1_2_5(
  df,
  names_eq5d,
  name_fu,
  levels_fu = NULL,
  name_id,
  eq5d_version,
  country
)

Value

A list with components:

plot_data

The plot data with ranks and classification.

p

A ggplot2 object displaying the HPG scatter plot.

Arguments

df

A data frame containing EQ-5D columns, a grouping variable, an ID column, and a follow-up column

names_eq5d

A character vector of EQ-5D dimension names

name_fu

A character string for the follow-up column

levels_fu

A character vector of length 2, specifying the order of the follow-up levels (e.g., c("Pre-op","Post-op"))

name_id

A character string for the patient ID column

eq5d_version

Version of the EQ-5D instrument

country

A character string representing the name of the country.

Examples

Run this code
tmp <- figure_1_2_5(
           df = example_data, 
           names_eq5d = c("mo", "sc", "ua", "pd", "ad"), 
           name_fu = "time", 
           levels_fu = c("Pre-op", "Post-op"), 
           name_id = "id", 
           eq5d_version = "3L", 
           country = "UK"
       )

Run the code above in your browser using DataLab