Title: | Manipulating and Analysing EQ-5d Data |
---|---|
Description: | The EQ-5D is a widely-used standarized instrument for measuring Health Related Quality Of Life (HRQOL), developed by the EuroQol group <https://euroqol.org/>. It assesses five dimensions; mobility, self-care, usual activities, pain/discomfort, and anxiety/depression, using either a three-level (EQ-5D-3L) or five-level (EQ-5D-5L) scale. Scores from these dimensions are commonly converted into a single utility index using country-specific value sets, which are critical in clinical and economic evaluations of healthcare and in population health surveys. The eq5dsuite package enables users to calculate utility index values for the EQ-5D instruments, including crosswalk utilities using the original crosswalk developed by van Hout et al. (2012) <doi:10.1016/j.jval.2012.02.008> (mapping EQ-5D-5L responses to EQ-5D-3L index values), or the recently developed reverse crosswalk by van Hout et al. (2021) <doi:10.1016/j.jval.2021.03.009> (mapping EQ-5D-3L responses to EQ-5D-5L index values). Users are allowed to add and/or remove user-defined value sets. Additionally, the package provides tools to analyze EQ-5D data according to the recommended guidelines outlined in "Methods for Analyzing and Reporting EQ-5D data" by Devlin et al. (2020) <doi:10.1007/978-3-030-47622-9>. |
Authors: | Kim Rand [aut, cre] |
Maintainer: | Kim Rand <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.0.0 |
Built: | 2025-03-10 04:04:10 UTC |
Source: | https://github.com/mathsinhealth/eq5dsuite |
This function adds utility values to a data frame based on a specified version of EQ-5D and a country name.
.add_utility(df, eq5d_version, country)
.add_utility(df, eq5d_version, country)
df |
A data frame containing the state data. The state must be included in the data frame as a character vector under the column named 'state'. |
eq5d_version |
A character string specifying the version of EQ-5D, i.e. 3L or 5L. |
country |
A character string representing the name of the country. This could be in a 2-letter format, full name or short name, as specified in the country_codes datasets. |
A data frame with an additional column named 'utility' containing the calculated utility values. If the input country name is not found in the country_codes dataset, a list of available codes is printed, and subsequentyl an error message is displayed and the function stops.
df <- data.frame(state = c("11111", "11123", "32541")) .add_utility(df, "5L", "DK")
df <- data.frame(state = c("11111", "11123", "32541")) .add_utility(df, "5L", "DK")
Check the uniqueness of groups This function takes a data frame 'df' and a vector of columns 'group_by', and checks whether the combinations of values in the columns specified by 'group_by' are unique. If the combinations are not unique, a warning message is printed.
.check_uniqueness(df, group_by)
.check_uniqueness(df, group_by)
df |
A data frame. |
group_by |
A character vector of column names in 'df' that specify the groups to check for uniqueness. |
No return value, called for side effects: it will stop with an error if any group combinations are not unique.
df <- data.frame(id = c(1, 1, 1, 1, 2, 2), fu = rep(c("baseline", "follow-up"), 3), value = rnorm(6)) .check_uniqueness(df, c("id", "fu"))
df <- data.frame(id = c(1, 1, 1, 1, 2, 2), fu = rep(c("baseline", "follow-up"), 3), value = rnorm(6)) .check_uniqueness(df, c("id", "fu"))
Takes a matrix of parameters for reverse crosswalk model, returns 243 x 25 matrix of state/level transition probabilities.
.EQxwrprob(par = NULL)
.EQxwrprob(par = NULL)
par |
Matrix of model parameters |
An 243 * 25 matrix with probabilities for state level transitions.
Helper function for frequency of levels by dimensions tables
.freqtab( df, names_eq5d = NULL, name_fu = NULL, levels_fu = NULL, eq5d_version = NULL )
.freqtab( df, names_eq5d = NULL, name_fu = NULL, levels_fu = NULL, eq5d_version = NULL )
df |
Data frame with the EQ-5D and follow-up columns |
names_eq5d |
Character vector of column names for the EQ-5D dimensions |
name_fu |
Character string for the follow-up column. If NULL, no grouping is used, and the table reports for the total population. |
levels_fu |
Character vector containing the order of the values in the follow-up column. If NULL (default value), the levels will be ordered in the order of appearance in df. |
eq5d_version |
Version of the EQ-5D instrument |
Summary data frame.
This internal function generates a vector of colours based on the specified base colour. Currently only green and orange colours are implemented. The wrapper is used in Figures 2.2-2.4.
.gen_colours(col, n)
.gen_colours(col, n)
col |
A character string specifying the base colour. Only "green" or "orange" is accepted. |
n |
A positive integer specifying the number of colours to generate. |
A vector of colours generated based on the specified base colour and number of colours.
# generate 10 colours for base colour "green" .gen_colours("green", 10) # generate 7 colours for base colour "orange" .gen_colours("orange", 7)
# generate 10 colours for base colour "green" .gen_colours("green", 10) # generate 7 colours for base colour "orange" .gen_colours("orange", 7)
This function calculates the Level Frequency Score (LFS) for a given EQ-5D state and a specified version of EQ-5D. If at least one domain contains a missing entry, the whole LFS is set to be NA.
.get_lfs(s, eq5d_version)
.get_lfs(s, eq5d_version)
s |
A character vector representing the EQ-5D state, e.g. 11123. |
eq5d_version |
A character string specifying the version of EQ-5D, i.e. 3L or 5L. |
A character vector representing the calculated LFS.
.get_lfs("333", "3L") # returns 003 .get_lfs("333", "5L") # returns 00300 .get_lfs("12345", "5L") # returns 11111
.get_lfs("333", "3L") # returns 003 .get_lfs("333", "5L") # returns 00300 .get_lfs("12345", "5L") # returns 11111
This function takes in a list of parameters, which would be column names of the input data frame, and checks if they are null. Any nulls are replaced with default values, and the updated list of parameters is returned.
.get_names(df = NULL, ...)
.get_names(df = NULL, ...)
df |
a data frame; only used/supplied if levels_fu needs to be defined |
... |
a list of parameters consisting of any/all of 'names_eq5d', 'name_fu', 'levels_fu', 'eq5d_version', and 'name_vas'. |
a list of parameters with null entries replaced with default values.
.get_names(names_eq5d = c("mo", "sc", "ua", "pd", "ad")) .get_names(names_eq5d = NULL, eq5d_version = NULL, name_vas = NULL) .get_names(df = example_data, name_fu = NULL, levels_fu = NULL)
.get_names(names_eq5d = c("mo", "sc", "ua", "pd", "ad")) .get_names(names_eq5d = NULL, eq5d_version = NULL, name_vas = NULL) .get_names(df = example_data, name_fu = NULL, levels_fu = NULL)
This function calculates the mode of a numeric or character vector. If there are multiple modes, the first one is returned. The code is taken from an R help page.
.getmode(v)
.getmode(v)
v |
A numeric or character vector. |
The mode of 'v'.
.getmode(c(1, 2, 3, 3)) .getmode(c("a", "b", "b", "c"))
.getmode(c(1, 2, 3, 3)) .getmode(c("a", "b", "b", "c"))
Modify ggplot2 theme
.modify_ggplot_theme(p)
.modify_ggplot_theme(p)
p |
ggplot2 plot |
ggplot2 plot with modified theme
This internal function determines Paretian Classification of Health Change (PCHC) for each combination of the variables specified in the 'group_by' argument. It is used in the code for table_2_4-table_2_5 and figure_2_1-figure_2_4. An EQ-5D health state is deemed to be 'better' than another if it is better on at least one dimension and is no worse on any other dimension. An EQ-5D health state is deemed to be 'worse' than another if it is worse in at least one dimension and is no better in any other dimension.
.pchc(df, level_fu_1, add_noprobs = FALSE)
.pchc(df, level_fu_1, add_noprobs = FALSE)
df |
A data frame with EQ-5D states and follow-up variable. The dataset is assumed to be have been ordered correctly. |
level_fu_1 |
Value of the first (i.e. earliest) follow-up. Would normally be defined as levels_fu[1]. |
add_noprobs |
Logical value indicating whether to include a separate classification for those without problems (default is FALSE) |
A data frame with PCHC value for each combination of the grouping variables. If 'add_noprobs' is TRUE, a separate classification for those without problems is also included.
df <- data.frame(id = c(1, 1, 2, 2), fu = c(1, 2, 1, 2), mo = c(1, 1, 1, 1), sc = c(1, 1, 5, 1), ua = c(1, 1, 4, 3), pd = c(1, 1, 1, 3), ad = c(1, 1, 1, 1)) .pchc(df, level_fu_1 = 1, add_noprobs = TRUE)
df <- data.frame(id = c(1, 1, 2, 2), fu = c(1, 2, 1, 2), mo = c(1, 1, 1, 1), sc = c(1, 1, 5, 1), ua = c(1, 1, 4, 3), pd = c(1, 1, 1, 3), ad = c(1, 1, 1, 1)) .pchc(df, level_fu_1 = 1, add_noprobs = TRUE)
This internal function plots Paretian Classification of Health Change (PCHC) by dimension. The input is a data frame containing the information to plot, and the plot will contain bars representing the proportion of the total data that falls into each dimension, stacked by covariate. The wrapper is used in Figures 2.2-2.4.
.pchc_plot_by_dim(plot_data, ylab, title, cols, text_rotate = FALSE)
.pchc_plot_by_dim(plot_data, ylab, title, cols, text_rotate = FALSE)
plot_data |
A data frame containing information to plot, with columns for name (the dimensions to plot), p (the proportion of the total data falling into each dimension), and fu (the follow-up). |
ylab |
The label for the y-axis. |
title |
The plot title. |
cols |
A vector of colors to use for the bars. |
text_rotate |
A logical indicating whether to rotate the text labels for the bars. |
A ggplot object containing the PCHC plot.
plot_data <- data.frame(name = c("Dimension 1", "Dimension 2"), p = c(0.5, 0.5), fu = c("Covariate A", "Covariate B")) cols <- c("#99FF99", "#006600", "#FFCC99", "#663300") .pchc_plot_by_dim(plot_data, "Proportion", "Example PCHC Plot", cols)
plot_data <- data.frame(name = c("Dimension 1", "Dimension 2"), p = c(0.5, 0.5), fu = c("Covariate A", "Covariate B")) cols <- c("#99FF99", "#006600", "#FFCC99", "#663300") .pchc_plot_by_dim(plot_data, "Proportion", "Example PCHC Plot", cols)
.pchctab: Changes in health according to the PCHC (Paretian Classification of Health Change)
.pchctab( df, name_id, name_groupvar, names_eq5d = NULL, name_fu = NULL, levels_fu = NULL, add_noprobs = FALSE )
.pchctab( df, name_id, name_groupvar, names_eq5d = NULL, name_fu = NULL, levels_fu = NULL, add_noprobs = FALSE )
df |
Data frame with the EQ-5D, grouping, id and follow-up columns |
name_id |
Character string for the patient id column |
name_groupvar |
Character string for the grouping column |
names_eq5d |
Character vector of column names for the EQ-5D dimensions |
name_fu |
Character string for the follow-up column |
levels_fu |
Character vector containing the order of the values in the follow-up column. If NULL (default value), the levels will be ordered in the order of appearance in df. |
add_noprobs |
if set to TRUE, level corresponding to "no problems" will be added to the table |
Summary data frame
.pchctab(df = example_data, name_groupvar = "surgtype", name_id = "id")
.pchctab(df = example_data, name_groupvar = "surgtype", name_id = "id")
This function prepares a data frame for analysis by extracting, processing, and adding columns for EQ-5D variables, including state, LSS (Level Sum Score), LFS (Level Frequency Score) and utility.
.prep_eq5d( df, names, add_state = FALSE, add_lss = FALSE, add_lfs = FALSE, add_utility = FALSE, eq5d_version = NULL, country = NULL )
.prep_eq5d( df, names, add_state = FALSE, add_lss = FALSE, add_lfs = FALSE, add_utility = FALSE, eq5d_version = NULL, country = NULL )
df |
a data frame of EQ-5D scores |
names |
character vector of length 5 with names of EQ-5D variables in the data frame. The variables should be in an integer format. |
add_state |
logical indicating whether the EQ-5D state should be added |
add_lss |
logical indicating whether the LSS (Level Sum Score) should be added |
add_lfs |
logical indicating whether the LFS (Level Frequency Score) should be added |
add_utility |
logical indicating whether the utility should be added |
eq5d_version |
character indicating the version of the EQ-5D questionnaire to use (either "3L" or "5L") |
country |
character indicating the country to retrieve the quality of life score for |
a modified data frame with EQ-5D domain columns renamed to default names, and, if necessary, with added columns for state, LSS, LFS, and/or utility. If any of the checks fail (e.g. EQ-5D columns are not in an integer format), an error message is displayed and the function is stopping.
set.seed(1234) df <- data.frame(mo = sample(1:5, 3), sc = sample(1:5, 3), ua = sample(1:5, 3), pd = sample(1:5, 3), ad = sample(1:5, 3)) .prep_eq5d(df, names = c("mo", "sc", "ua", "pd", "ad"), add_state = TRUE, add_lss = TRUE) .prep_eq5d(df, names = c("mo", "sc", "ua", "pd", "ad"), add_state = TRUE, add_lss = TRUE, add_lfs = TRUE, add_utility = TRUE, eq5d_version = "5L", country = "Denmark")
set.seed(1234) df <- data.frame(mo = sample(1:5, 3), sc = sample(1:5, 3), ua = sample(1:5, 3), pd = sample(1:5, 3), ad = sample(1:5, 3)) .prep_eq5d(df, names = c("mo", "sc", "ua", "pd", "ad"), add_state = TRUE, add_lss = TRUE) .prep_eq5d(df, names = c("mo", "sc", "ua", "pd", "ad"), add_state = TRUE, add_lss = TRUE, add_lfs = TRUE, add_utility = TRUE, eq5d_version = "5L", country = "Denmark")
This function prepares the follow-up (FU) variable for analysis by giving it a default name ('fu') and factorising
.prep_fu(df, name = NULL, levels = NULL)
.prep_fu(df, name = NULL, levels = NULL)
df |
A data frame. |
name |
Column name in the data frame that contains follow-up information. |
levels |
Levels to factorise the FU variable into. |
A data frame with the follow-up variable renamed as "fu" and factorised.
df <- data.frame(id = c(1, 1, 2, 2), visit = c("baseline", "follow-up", "baseline", "follow-up")) .prep_fu(df = df, name = "visit", levels = c("baseline", "follow-up"))
df <- data.frame(id = c(1, 1, 2, 2), visit = c("baseline", "follow-up", "baseline", "follow-up")) .prep_fu(df = df, name = "visit", levels = c("baseline", "follow-up"))
The function prepares the data for VAS (Visual Analogue Scale) analyses.
.prep_vas(df, name)
.prep_vas(df, name)
df |
A data frame. |
name |
Column name in the data frame that holds the VAS score. The column can only contain integers or NAs |
A modified data frame with the VAS score renamed to "vas". If any checks fail (e.g. column is not numeric), an error message is displayed and the function is stopping.
df <- data.frame(vas_score = c(20, 50, 80, NA, 100)) .prep_vas(df = df, name = "vas_score") df <- data.frame(vas_score = c(20.5, 50, 80, NA, 100)) .prep_vas(df = df, name = "vas_score")
df <- data.frame(vas_score = c(20, 50, 80, NA, 100)) .prep_vas(df = df, name = "vas_score") df <- data.frame(vas_score = c(20.5, 50, 80, NA, 100)) .prep_vas(df = df, name = "vas_score")
Takes a N x 25 matrix with probabilities per level/dimension, and creates an N * 3125 matrix with probabilities per state
.pstate3t5(PPP)
.pstate3t5(PPP)
PPP |
N x 25 matrix with probabilities per level/dimension created by EQrxwprobs |
An N * 3125 matrix with probabilities per state
Takes a 15 x 5 matrix with probabilities per level/dimension, and creates an 3125x243 matrix with probabilities per state
.pstate5t3(probs = .EQxwprob)
.pstate5t3(probs = .EQxwprob)
probs |
15 x 5 matrix with probabilities per level/dimension, typically saved in .EQxwprob |
An 3125x243 matrix with probabilities per state
This function summarizes a continuous variable for each follow-up (FU) and calculates various statistics such as mean, standard deviation, median, mode, kurtosis, skewness, minimum, maximum, range, and number of observations. It also reports the total sample size and the number (and proportion) of missing values for each FU. The input 'df' must contain an ordered FU variable and the continuous variable of interest. The name of the continuous variable must be specified using 'name_v'. The wrapper is used in Table 3.1 (for VAS) or Table 4.2 (for EQ-5D utility)
.summary_cts_by_fu(df, name_v)
.summary_cts_by_fu(df, name_v)
df |
A data frame containing the FU and continuous variable of interest. The dataset must contain an ordered 'fu' variable. |
name_v |
A character string with the name of the continuous variable in 'df' to be summarised. |
Data frame with one row for each statistic and one column for each FU.
df <- data.frame(fu = c(1,1,2,2,3,3), vas = c(7,8,9,NA,7,6)) .summary_cts_by_fu(df, name_v = "vas")
df <- data.frame(fu = c(1,1,2,2,3,3), vas = c(7,8,9,NA,7,6)) .summary_cts_by_fu(df, name_v = "vas")
This internal function calculates summary mean and 95% confidence interval of the utility variable, which can also be grouped. The function is used in Figures 4.2-4.4.
.summary_mean_ci(df, group_by)
.summary_mean_ci(df, group_by)
df |
A data frame containing a 'utility' column. |
group_by |
A character vector of column names to group by. |
A data frame with the mean, lower bound, and upper bound of the 95
df <- data.frame(group = c("A", "A", "B", "B"), utility = c(0.5, 0.7, 0.8, 0.9)) .summary_mean_ci(df, group_by = "group")
df <- data.frame(group = c("A", "A", "B", "B"), utility = c(0.5, 0.7, 0.8, 0.9)) .summary_mean_ci(df, group_by = "group")
This internal function summarises a data frame by grouping it based on the variables specified in the 'group_by' argument and calculates the frequency of each group. The output is used in Table 2.1
.summary_table_2_1(df, group_by)
.summary_table_2_1(df, group_by)
df |
A data frame |
group_by |
A character vector of variables in ‘df' to group by. Should contain ’eq5d' and 'fu'. |
A summarised data frame with groups defined by 'eq5d' and 'fu' variables, the count of observations in each group, and the frequency of each group.
set.seed(1234) df <- data.frame(eq5d = rep(rnorm(5), 2), fu = rep(c(1, 0, 1, 0, 1), 2)) .summary_table_2_1(df, c("eq5d", "fu"))
set.seed(1234) df <- data.frame(eq5d = rep(rnorm(5), 2), fu = rep(c(1, 0, 1, 0, 1), 2)) .summary_table_2_1(df, c("eq5d", "fu"))
This internal function creates a summary of the data frame for Table 4.3. It groups the data by the variables specified in 'group_by' and calculates various summary statistics.
.summary_table_4_3(df, group_by)
.summary_table_4_3(df, group_by)
df |
A data frame. |
group_by |
A character vector of names of variables by which to group the data. |
A data frame with the summary statistics.
df <- data.frame(group = c("A", "A", "B", "B"), utility = c(0.5, 0.7, 0.8, 0.9)) .summary_table_4_3(df, group_by = "group")
df <- data.frame(group = c("A", "A", "B", "B"), utility = c(0.5, 0.7, 0.8, 0.9)) .summary_table_4_3(df, group_by = "group")
This internal function creates a summary of the data frame for Table 4.4. It groups the data by the variables specified in 'group_by' and calculates various summary statistics.
.summary_table_4_4(df, group_by)
.summary_table_4_4(df, group_by)
df |
A data frame. |
group_by |
A character vector of names of variables by which to group the data. |
A data frame with the summary statistics.
df <- data.frame(group = c("A", "A", "B", "B"), utility = c(0.5, 0.7, 0.8, 0.9)) .summary_table_4_4(df, group_by = "group")
df <- data.frame(group = c("A", "A", "B", "B"), utility = c(0.5, 0.7, 0.8, 0.9)) .summary_table_4_4(df, group_by = "group")
Get EQ-5D index values for the -3L, -5L, crosswalk (-3L value set applied to -5L health states), reverse crosswealk (-5L value set applied to -3L health states), and -Y-3L
eq5d( x, country = NULL, version = "5L", dim.names = c("mo", "sc", "ua", "pd", "ad") )
eq5d( x, country = NULL, version = "5L", dim.names = c("mo", "sc", "ua", "pd", "ad") )
x |
A vector of 5-digit EQ-5D-3L state indexes or a matrix/data.frame with columns corresponding to EQ-5D state dimensions |
country |
String vector indicating country names or ISO3166 Alpha 2 / 3 country codes. |
version |
String indicating which version to use. Options are '5L' (default), '3L', 'xw', 'xwr', and 'Y3L'. |
dim.names |
A vector of dimension names to identify dimension columns. |
A vector of values or data.frame with one column for each value set requested.
# US -3L value set eq5d(c(11111, 12321, 32123, 33333), 'US', '3L') # Danish and US -5L value sets applied to -3L descriptives, i.e. reverse crosswalk eq5d(make_all_EQ_states('3L'), c('DK', 'US'), 'XWR') # US -5L value set eq5d(c(11111, 12321, 32153, 55555), 'US', '5L')
# US -3L value set eq5d(c(11111, 12321, 32123, 33333), 'US', '3L') # Danish and US -5L value sets applied to -3L descriptives, i.e. reverse crosswalk eq5d(make_all_EQ_states('3L'), c('DK', 'US'), 'XWR') # US -5L value set eq5d(c(11111, 12321, 32153, 55555), 'US', '5L')
Get EQ-5D-3L index values from individual responses to the five dimensions of the EQ-5D-3L.
eq5d3l(x, country = NULL, dim.names = c("mo", "sc", "ua", "pd", "ad"))
eq5d3l(x, country = NULL, dim.names = c("mo", "sc", "ua", "pd", "ad"))
x |
A vector of 5-digit EQ-5D-3L state indexes or a matrix/data.frame with columns corresponding to EQ-5D-3L state dimensions. |
country |
String vector indicating country names or ISO3166 Alpha 2 / 3 country codes. |
dim.names |
A character vector specifying the names of the EQ-5D-3L dimensions. Default is c("mo", "sc", "ua", "pd", "ad"). |
A vector of EQ-5D-3L values or data.frame with one column for each value set requested.
eq5d3l(c(11111, 12321, 32123, 33333), 'US') # US -3L value set eq5d3l(make_all_EQ_states('3L'), c('DK', 'CA')) # Danish and Canada -3L value sets
eq5d3l(c(11111, 12321, 32123, 33333), 'US') # US -3L value set eq5d3l(make_all_EQ_states('3L'), c('DK', 'CA')) # Danish and Canada -3L value sets
Get EQ-5D-5L index values from individual responses to the five dimensions of the EQ-5D-5L.
eq5d5l(x, country = NULL, dim.names = c("mo", "sc", "ua", "pd", "ad"))
eq5d5l(x, country = NULL, dim.names = c("mo", "sc", "ua", "pd", "ad"))
x |
A vector of 5-digit EQ-5D-5L state indexes or a matrix/data.frame with columns corresponding to EQ-5D-5L state dimensions. |
country |
String vector indicating country names or ISO3166 Alpha 2 / 3 country codes. |
dim.names |
A character vector specifying the names of the EQ-5D-5L dimensions. Default is c("mo", "sc", "ua", "pd", "ad"). |
A vector of EQ-5D-5L values or data.frame with one column for each value set requested.
eq5d5l(c(11111, 12321, 32423, 55555), 'IT') # Italy -5L value set eq5d5l(make_all_EQ_states('5L'), c('Japan', 'China')) # Japon and China -5L value sets
eq5d5l(c(11111, 12321, 32423, 55555), 'IT') # Italy -5L value set eq5d5l(make_all_EQ_states('5L'), c('Japan', 'China')) # Japon and China -5L value sets
Get EQ-5D-Y3L index values from individual responses to the five dimensions of the EQ-5D-Y3L.
eq5dy3l(x, country = NULL, dim.names = c("mo", "sc", "ua", "pd", "ad"))
eq5dy3l(x, country = NULL, dim.names = c("mo", "sc", "ua", "pd", "ad"))
x |
A vector of 5-digit EQ-5D-Y3L state indexes or a matrix / data frame with columns for each dimension. |
country |
String vector indicating country names or ISO3166 Alpha 2 / 3 country codes. |
dim.names |
A character vector specifying the names of the EQ-5D-Y3L dimensions. Default is c("mo", "sc", "ua", "pd", "ad"). |
A vector of EQ-5D-Y3L values or data.frame with one column for each value set requested.
# Slovenia -Y3L value set eq5dy3l(x = c(11111, 12321, 33333), country = 'SI') # Germany and Spain -Y3L value sets eq5dy3l(make_all_EQ_states('3L'), c('Germany', 'Spain'))
# Slovenia -Y3L value set eq5dy3l(x = c(11111, 12321, 33333), country = 'SI') # Germany and Spain -Y3L value sets eq5dy3l(make_all_EQ_states('3L'), c('Germany', 'Spain'))
Add user-defined EQ-5D value set and corresponding crosswalk option.
eqvs_add( df, version = "5L", country = NULL, saveOption = 1, savePath = NULL, description = NULL, code2L = NULL, code3L = NULL )
eqvs_add( df, version = "5L", country = NULL, saveOption = 1, savePath = NULL, description = NULL, code2L = NULL, code3L = NULL )
df |
A data.frame or file name pointing to csv file. The contents of the data.frame or csv file should be exactly two columns: state, containing a list of all 3125 (for 5L) or 243 (for 3L) EQ-5D health state vectors, and a column of corresponding utility values, with a suitable name. |
version |
Version of the EQ-5D instrument. Can take values 5L (default) or 3L. |
country |
Optional string. If not NULL, will be used as a country description for the user-defined value set. |
saveOption |
Integer indicating how the cache data should be saved. 1: Do not save (default), 2: Save in package folder, 3: Save in another path. |
savePath |
A path where the cache data should be saved when 'saveOption' is 3. Please use 'eqvs_load' to load it in your next session. |
description |
Optional string. If not NULL, will be used as a descriptive text for the user-defined value set. |
code2L |
Optional string. If not NULL, will be used as the two-digit code for the value set. Must be different from any existing national value set code. |
code3L |
Optional string. If not NULL, will be used as the three-digit code for the value set. Must be different from any existing national value set code. |
True/False, indicating success or error.
# make nonsense value set new_df <- data.frame(state = make_all_EQ_indexes(), TEST = runif(3125)) # Add as value set for Fantasia eqvs_add(new_df, version = "5L", country = 'Fantasia', saveOption = 1)
# make nonsense value set new_df <- data.frame(state = make_all_EQ_indexes(), TEST = runif(3125)) # Add as value set for Fantasia eqvs_add(new_df, version = "5L", country = 'Fantasia', saveOption = 1)
Display available value sets, which can also be used as (reverse) crosswalks.
eqvs_display(version = "5L", return_df = FALSE)
eqvs_display(version = "5L", return_df = FALSE)
version |
Version of the EQ-5D instrument. Can take values 5L (default) or 3L. |
return_df |
If set to TRUE, the function will return information on the names of the available value sets in a data.frame. Defaults to FALSE |
Default NULL, if return_df == TRUE, returns a data.frame with the displayed information.
# Display available value sets. eqvs_display
# Display available value sets. eqvs_display
Drop user-defined EQ-5D value set to reverse crosswalk options.
eqvs_drop(country = NULL, version = "5L", saveOption = 1, savePath = NULL)
eqvs_drop(country = NULL, version = "5L", saveOption = 1, savePath = NULL)
country |
Optional string. If NULL, a list of current user-defined value sets will be provided for selection. If set, and matching an existing user-defined value set, a prompt will be given as to whether the value set should be deleted. |
version |
Version of the EQ-5D instrument. Can take values 5L (default) or 3L. |
saveOption |
Integer indicating how the cache data should be saved. 1: Do not save (default), 2: Save in package folder, 3: Save in another path. |
savePath |
A path where the cache data should be saved when 'saveOption' is 3. Please use 'eqvs_load' to load it in your next session. |
True/False, indicating success or error.
# make nonsense value set new_df <- data.frame(state = make_all_EQ_indexes(), TEST = runif(3125)) # Add as value set for Fantasia eqvs_add(new_df, version = "5L", country = 'Fantasia', saveOption = 1) # Drop value set for Fantasia eqvs_drop('Fantasia', saveOption = 1)
# make nonsense value set new_df <- data.frame(state = make_all_EQ_indexes(), TEST = runif(3125)) # Add as value set for Fantasia eqvs_add(new_df, version = "5L", country = 'Fantasia', saveOption = 1) # Drop value set for Fantasia eqvs_drop('Fantasia', saveOption = 1)
Load cache data from a specified path.
eqvs_load(loadPath)
eqvs_load(loadPath)
loadPath |
The path from which to load the cache data. |
TRUE if loading is successful, FALSE otherwise.
Get crosswalk values
eqxw(x, country = NULL, dim.names = c("mo", "sc", "ua", "pd", "ad"))
eqxw(x, country = NULL, dim.names = c("mo", "sc", "ua", "pd", "ad"))
x |
A vector of 5-digit EQ-5D-5L state indexes or a matrix/data.frame with columns corresponding to EQ-5D state dimensions |
country |
String vector indicating country names or ISO3166 Alpha 2 / 3 country codes. |
dim.names |
A vector of dimension names to identify dimension columns |
A vector of reverse crosswalk values or data.frame with one column per reverse crosswalk set requested.
eqxw(c(11111, 12521, 32123, 55555), 'US') eqxw(make_all_EQ_states('5L'), c('DK', 'US'))
eqxw(c(11111, 12521, 32123, 55555), 'US') eqxw(make_all_EQ_states('5L'), c('DK', 'US'))
Get reverse crosswalk values
eqxwr(x, country = NULL, dim.names = c("mo", "sc", "ua", "pd", "ad"))
eqxwr(x, country = NULL, dim.names = c("mo", "sc", "ua", "pd", "ad"))
x |
A vector of 5-digit EQ-5D-3L state indexes or a matrix/data.frame with columns corresponding to EQ-5D state dimensions |
country |
String vector indicating country names or ISO3166 Alpha 2 / 3 country codes. |
dim.names |
A vector of dimension names to identify dimension columns |
A vector of reverse crosswalk values or data.frame with one column per reverse crosswalk set requested.
eqxwr(c(11111, 12321, 32123, 33333), 'US') eqxwr(make_all_EQ_states('3L'), c('DK', 'US'))
eqxwr(c(11111, 12321, 32123, 33333), 'US') eqxwr(make_all_EQ_states('3L'), c('DK', 'US'))
A dataset containing patient-level data in a long format.
data(example_data)
data(example_data)
A data frame with 6600 rows and 13 variables:
id
double Patient id
mo
double EQ-5D-5L Mobility dimension
sc
double EQ-5D-5L Self-care dimension
ua
double EQ-5D-5L Usual activities dimension
pd
double EQ-5D-5L Pain / discomfort dimension
ad
double EQ-5D-5L Anxiety/depression dimension
vas
double Value of the VAS scale measurememnt
fu
character Follow-up (baseline / follow-up)
year_range
character Time period for the follow-up (2009-2010 / 2010-2011 / 2011-2012); could be used as an alternative follow-up variable
month
double Another alternative follow-up variable (1, ..., 15)
surgtype
character Type of surgery (Cataract / Hernia / Hip / Knee / Veins)
gender
character Patient's gender (Female / Male)
age
double Patient's age in years
Figure 1.2.1: Paretian Classification of Health Change
figure_1_2_1(df, names_eq5d = NULL, name_fu = NULL, levels_fu = NULL, name_id)
figure_1_2_1(df, names_eq5d = NULL, name_fu = NULL, levels_fu = NULL, name_id)
df |
Data frame with the EQ-5D, follow-up and patient id columns |
names_eq5d |
Character vector of column names for the EQ-5D dimensions |
name_fu |
Character string for the follow-up column |
levels_fu |
Character vector containing the order of the values in the follow-up column. If NULL (default value), the levels will be ordered in the order of appearance in df. |
name_id |
Character string for the patient id column |
Summary plot and data used for plotting
tmp <- figure_1_2_1(df = example_data, name_fu = "surgtype", name_id = "id") tmp$p tmp$plot_data
tmp <- figure_1_2_1(df = example_data, name_fu = "surgtype", name_id = "id") tmp$p tmp$plot_data
Figure 1.2.2: Percentage of respondents who improved overall by the dimensions (%)
figure_1_2_2(df, names_eq5d = NULL, name_fu = NULL, levels_fu = NULL, name_id)
figure_1_2_2(df, names_eq5d = NULL, name_fu = NULL, levels_fu = NULL, name_id)
df |
Data frame with the EQ-5D, follow-up and patient id columns |
names_eq5d |
Character vector of column names for the EQ-5D dimensions |
name_fu |
Character string for the follow-up column |
levels_fu |
Character vector containing the order of the values in the follow-up column. If NULL (default value), the levels will be ordered in the order of appearance in df. |
name_id |
Character string for the patient id column |
Summary plot and data used for plotting
tmp <- figure_1_2_2(df = example_data, name_fu = "year_range", name_id = "id") tmp$p tmp$plot_data
tmp <- figure_1_2_2(df = example_data, name_fu = "year_range", name_id = "id") tmp$p tmp$plot_data
Figure 1.2.3: Percentage of respondents who worsened overall by the dimensions (%)
figure_1_2_3(df, names_eq5d = NULL, name_fu = NULL, levels_fu = NULL, name_id)
figure_1_2_3(df, names_eq5d = NULL, name_fu = NULL, levels_fu = NULL, name_id)
df |
Data frame with the EQ-5D, follow-up and patient id columns |
names_eq5d |
Character vector of column names for the EQ-5D dimensions |
name_fu |
Character string for the follow-up column |
levels_fu |
Character vector containing the order of the values in the follow-up column. If NULL (default value), the levels will be ordered in the order of appearance in df. |
name_id |
Character string for the patient id column |
Summary plot and data used for plotting
tmp <- figure_1_2_3(df = example_data, name_fu = "year_range", name_id = "id") tmp$p tmp$plot_data
tmp <- figure_1_2_3(df = example_data, name_fu = "year_range", name_id = "id") tmp$p tmp$plot_data
Figure 1.2.4: Percentage of respondents who had a mixed change by the dimensions in which they improved and worsened (%)
figure_1_2_4(df, names_eq5d = NULL, name_fu = NULL, levels_fu = NULL, name_id)
figure_1_2_4(df, names_eq5d = NULL, name_fu = NULL, levels_fu = NULL, name_id)
df |
Data frame with the EQ-5D, follow-up and patient id columns |
names_eq5d |
Character vector of column names for the EQ-5D dimensions |
name_fu |
Character string for the follow-up column |
levels_fu |
Character vector containing the order of the values in the follow-up column. If NULL (default value), the levels will be ordered in the order of appearance in df. |
name_id |
Character string for the patient id column |
Summary plot and data used for plotting
tmp <- figure_1_2_4(df = example_data, name_fu = "year_range", name_id = "id") tmp$p tmp$plot_data
tmp <- figure_1_2_4(df = example_data, name_fu = "year_range", name_id = "id") tmp$p tmp$plot_data
Figure 1.3.1: EQ-5D values plotted against LSS
figure_1_3_1(df, names_eq5d = NULL, eq5d_version = NULL, country)
figure_1_3_1(df, names_eq5d = NULL, eq5d_version = NULL, country)
df |
Data frame with the EQ-5D columns |
names_eq5d |
Character vector of column names for the EQ-5D dimensions |
eq5d_version |
Version of the EQ-5D instrument |
country |
A character string representing the name of the country. This could be in a 2-letter format, full name or short name, as specified in the country_codes datasets. |
Summary plot and data used for plotting
tmp <- figure_1_3_1(df = example_data, country = "USA") tmp$p tmp$plot_data
tmp <- figure_1_3_1(df = example_data, country = "USA") tmp$p tmp$plot_data
Figure 1.3.2: EQ-5D values plotted against LFS
figure_1_3_2(df, names_eq5d = NULL, eq5d_version = NULL, country)
figure_1_3_2(df, names_eq5d = NULL, eq5d_version = NULL, country)
df |
Data frame with the EQ-5D columns |
names_eq5d |
Character vector of column names for the EQ-5D dimensions |
eq5d_version |
Version of the EQ-5D instrument |
country |
A character string representing the name of the country. This could be in a 2-letter format, full name or short name, as specified in the country_codes datasets. |
Summary plot and data used for plotting
tmp <- figure_1_3_2(df = example_data, country = "USA") tmp$p tmp$plot_data
tmp <- figure_1_3_2(df = example_data, country = "USA") tmp$p tmp$plot_data
Figure 2.1: EQ VAS scores
figure_2_1(df, name_vas = NULL)
figure_2_1(df, name_vas = NULL)
df |
Data frame with the VAS column |
name_vas |
Character string for the VAS column |
Summary plot and data used for plotting
tmp <- figure_2_1(df = example_data) tmp$p tmp$plot_data
tmp <- figure_2_1(df = example_data) tmp$p tmp$plot_data
Figure 2.2: Mid-point EQ VAS scores
figure_2_2(df, name_vas = NULL)
figure_2_2(df, name_vas = NULL)
df |
Data frame with the VAS column |
name_vas |
Character string for the VAS column |
Summary plot and data used for plotting
tmp <- figure_2_2(df = example_data) tmp$p tmp$plot_data
tmp <- figure_2_2(df = example_data) tmp$p tmp$plot_data
Figure 3.1: EQ-5D values by timepoints: mean values and 95% confidence intervals
figure_3_1( df, names_eq5d = NULL, name_fu = NULL, levels_fu = NULL, eq5d_version = NULL, country )
figure_3_1( df, names_eq5d = NULL, name_fu = NULL, levels_fu = NULL, eq5d_version = NULL, country )
df |
Data frame with the VAS columns |
names_eq5d |
Character vector of column names for the EQ-5D dimensions |
name_fu |
Character string for the follow-up column |
levels_fu |
Character vector containing the order of the values in the follow-up column. If NULL (default value), the levels will be ordered in the order of appearance in df. |
eq5d_version |
Version of the EQ-5D instrument |
country |
A character string representing the name of the country. This could be in a 2-letter format, full name or short name, as specified in the country_codes datasets. |
Summary plot and data used for plotting
tmp <- figure_3_1(df = example_data, name_fu = "month", country = "USA") tmp$p tmp$plot_data
tmp <- figure_3_1(df = example_data, name_fu = "month", country = "USA") tmp$p tmp$plot_data
Figure 3.2: Mean EQ-5D values and 95% confidence intervals: all vs by groupvar
figure_3_2(df, names_eq5d = NULL, name_groupvar, eq5d_version = NULL, country)
figure_3_2(df, names_eq5d = NULL, name_groupvar, eq5d_version = NULL, country)
df |
Data frame with the EQ-5D and grouping columns |
names_eq5d |
Character vector of column names for the EQ-5D dimensions |
name_groupvar |
Character string for the grouping column |
eq5d_version |
Version of the EQ-5D instrument |
country |
A character string representing the name of the country. This could be in a 2-letter format, full name or short name, as specified in the country_codes datasets. |
Summary plot and data used for plotting
tmp <- figure_3_2(df = example_data, name_groupvar = "surgtype", country = "USA") tmp$p tmp$plot_data
tmp <- figure_3_2(df = example_data, name_groupvar = "surgtype", country = "USA") tmp$p tmp$plot_data
Figure 3.3: EQ-5D values: smoothed lines and confidence intervals by groupvar
figure_3_3( df, names_eq5d = NULL, name_fu = NULL, levels_fu = NULL, name_groupvar, eq5d_version = NULL, country )
figure_3_3( df, names_eq5d = NULL, name_fu = NULL, levels_fu = NULL, name_groupvar, eq5d_version = NULL, country )
df |
Data frame with the EQ-5D, follow-up and grouping columns |
names_eq5d |
Character vector of column names for the EQ-5D dimensions |
name_fu |
Character string for the follow-up column |
levels_fu |
Character vector containing the order of the values in the follow-up column. If NULL (default value), the levels will be ordered in the order of appearance in df. |
name_groupvar |
Character string for the grouping column |
eq5d_version |
Version of the EQ-5D instrument |
country |
A character string representing the name of the country. This could be in a 2-letter format, full name or short name, as specified in the country_codes datasets. |
Summary plot and data used for plotting
tmp <- figure_3_3(df = example_data, name_fu = "month", name_groupvar = "gender", country = "USA") tmp$p tmp$plot_data
tmp <- figure_3_3(df = example_data, name_fu = "month", name_groupvar = "gender", country = "USA") tmp$p tmp$plot_data
Figure 3.4: EQ-5D values: smoothed lines and confidence intervals by groupvar
figure_3_4(df, names_eq5d = NULL, eq5d_version = NULL, country)
figure_3_4(df, names_eq5d = NULL, eq5d_version = NULL, country)
df |
Data frame with the EQ-5D columns |
names_eq5d |
Character vector of column names for the EQ-5D dimensions |
eq5d_version |
Version of the EQ-5D instrument |
country |
A character string representing the name of the country. This could be in a 2-letter format, full name or short name, as specified in the country_codes datasets. |
Summary plot and data used for plotting
tmp <- figure_3_4(df = example_data, country = "USA") tmp$p tmp$plot_data
tmp <- figure_3_4(df = example_data, country = "USA") tmp$p tmp$plot_data
Figure 3.5: EQ-5D values: smoothed lines and confidence intervals by groupvar
figure_3_5( df, names_eq5d = NULL, name_vas = NULL, eq5d_version = NULL, country )
figure_3_5( df, names_eq5d = NULL, name_vas = NULL, eq5d_version = NULL, country )
df |
Data frame with the EQ-5D columns |
names_eq5d |
Character vector of column names for the EQ-5D dimensions |
name_vas |
Character string for the VAS column |
eq5d_version |
Version of the EQ-5D instrument |
country |
A character string representing the name of the country. This could be in a 2-letter format, full name or short name, as specified in the country_codes datasets. |
Summary plot and data used for plotting
tmp <- figure_3_5(df = example_data, country = "USA") tmp$p tmp$plot_data
tmp <- figure_3_5(df = example_data, country = "USA") tmp$p tmp$plot_data
Make a vector containing all 5-digit EQ-5D indexes for -3L or -5L version.
make_all_EQ_indexes( version = "5L", dim.names = c("mo", "sc", "ua", "pd", "ad") )
make_all_EQ_indexes( version = "5L", dim.names = c("mo", "sc", "ua", "pd", "ad") )
version |
Either "3L" or "5L", to signify whether 243 or 3125 states should be generated |
dim.names |
A vector of dimension names to be used as names for output columns. |
A vector with 5-digit state indexes for all 243 (-3L) or 3125 (-5L) EQ-5D health states
make_all_EQ_indexes('3L')
make_all_EQ_indexes('3L')
Make a data.frame with all health states defined by dimensions
make_all_EQ_states( version = "5L", dim.names = c("mo", "sc", "ua", "pd", "ad"), append_index = FALSE )
make_all_EQ_states( version = "5L", dim.names = c("mo", "sc", "ua", "pd", "ad"), append_index = FALSE )
version |
Either "3L" or "5L", to signify whether 243 or 3125 states should be generated |
dim.names |
A vector of dimension names to be used as names for output columns. |
append_index |
Boolean to indicate whether a column of 5-digit EQ-5D health state indexes should be added to output. |
A data.frame with 5 columns and 243 (-3L) or 3125 (-5L) health states
make_all_EQ_states('3L')
make_all_EQ_states('3L')
Make a data.frame of all EQ-5D dummies relevant for e.g. regression modeling.
make_dummies( df, version = "5L", dim.names = c("mo", "sc", "ua", "pd", "ad"), drop_level_1 = TRUE, add_intercept = FALSE, incremental = FALSE, prepend = NULL, append = NULL, return_df = TRUE )
make_dummies( df, version = "5L", dim.names = c("mo", "sc", "ua", "pd", "ad"), drop_level_1 = TRUE, add_intercept = FALSE, incremental = FALSE, prepend = NULL, append = NULL, return_df = TRUE )
df |
data.frame containing EQ-5D health states. |
version |
Either "3L" or "5L", to signify EQ-5D instrument version |
dim.names |
A vector of dimension names to be used as names for output columns. |
drop_level_1 |
If set to FALSE, dummies for level 1 will be included. Defaults to TRUE. |
add_intercept |
If set to TRUE, a column containing 1s will be appended. Defaults to FALSE. |
incremental |
If set to TRUE, incremental dummies will be produced (e.g. MO = 3 will give mo2 = 1, mo3 = 1). Defaults to FALSE. |
prepend |
Optional string to be prepended to column names. |
append |
Optional string to be appended to column names. |
return_df |
If set to TRUE, data.frame is returned, otherwise matrix. Defaults to TRUE. |
A data.frame of dummy variables
make_dummies(make_all_EQ_states('3L'), '3L') make_dummies(df = make_all_EQ_states('3L'), version = '3L', incremental = TRUE, add_intercept = TRUE, prepend = "d_")
make_dummies(make_all_EQ_states('3L'), '3L') make_dummies(df = make_all_EQ_states('3L'), version = '3L', incremental = TRUE, add_intercept = TRUE, prepend = "d_")
Table 1.1.1: Frequency of levels by dimensions, cross-sectional
table_1_1_1(df, names_eq5d = NULL, eq5d_version = NULL)
table_1_1_1(df, names_eq5d = NULL, eq5d_version = NULL)
df |
Data frame with the EQ-5D and follow-up columns |
names_eq5d |
Character vector of column names for the EQ-5D dimensions |
eq5d_version |
Version of the EQ-5D instrument |
Summary data frame.
table_1_1_1(df = example_data) table_1_1_1(df = example_data, eq5d_version = "3L")
table_1_1_1(df = example_data) table_1_1_1(df = example_data, eq5d_version = "3L")
Table 1.1.2: Frequency of levels by dimensions, separated by category
table_1_1_2( df, names_eq5d = NULL, name_cat = NULL, levels_cat = NULL, eq5d_version = NULL )
table_1_1_2( df, names_eq5d = NULL, name_cat = NULL, levels_cat = NULL, eq5d_version = NULL )
df |
Data frame with the EQ-5D and follow-up columns |
names_eq5d |
Character vector of column names for the EQ-5D dimensions |
name_cat |
Character string for the category column. If NULL, no grouping is used, and the table reports for the total population, i.e. equal to table 1.1.1. |
levels_cat |
Character vector containing the order of the values in the category column, if the wish is to have these presented in a particular order. If NULL (default value), unless the variable is a factor, the levels will be ordered in the order of appearance in df. |
eq5d_version |
Version of the EQ-5D instrument |
Summary data frame.
table_1_1_2(df = example_data, name_cat = "surgtype")
table_1_1_2(df = example_data, name_cat = "surgtype")
Table 1.1.3: Prevalence of the 10 most frequently observed self-reported health states
table_1_1_3(df, names_eq5d = NULL, eq5d_version = NULL, n = 10)
table_1_1_3(df, names_eq5d = NULL, eq5d_version = NULL, n = 10)
df |
Data frame with the EQ-5D columns |
names_eq5d |
Character vector of column names for the EQ-5D dimensions |
eq5d_version |
Version of the EQ-5D instrument |
n |
Number of most frequently observed states to display (default 10) |
Summary data frame
table_1_1_3(df = example_data) table_1_1_3(df = example_data, n = 5) table_1_1_3(df = example_data, eq5d_version = "3L")
table_1_1_3(df = example_data) table_1_1_3(df = example_data, n = 5) table_1_1_3(df = example_data, eq5d_version = "3L")
Table 1.2.1: Frequency of levels by dimensions, by follow-up
table_1_2_1( df, names_eq5d = NULL, name_fu = NULL, levels_fu = NULL, eq5d_version = NULL )
table_1_2_1( df, names_eq5d = NULL, name_fu = NULL, levels_fu = NULL, eq5d_version = NULL )
df |
Data frame with the EQ-5D and follow-up columns |
names_eq5d |
Character vector of column names for the EQ-5D dimensions |
name_fu |
Character string for the follow-up column. If NULL, the function will check if there is a column named "follow-up" or "fu", in which case the first of those will be used. |
levels_fu |
Character vector containing the order of the values in the follow-up column. If NULL (default value), the levels will be ordered in the order of appearance in df. |
eq5d_version |
Version of the EQ-5D instrument |
Summary data frame.
table_1_2_1(df = example_data) table_1_2_1(df = example_data, name_fu = "month")
table_1_2_1(df = example_data) table_1_2_1(df = example_data, name_fu = "month")
Table 1.2.2: Changes in health according to the PCHC (Paretian Classification of Health Change)
table_1_2_2( df, name_id, name_groupvar, names_eq5d = NULL, name_fu = NULL, levels_fu = NULL )
table_1_2_2( df, name_id, name_groupvar, names_eq5d = NULL, name_fu = NULL, levels_fu = NULL )
df |
Data frame with the EQ-5D, grouping, id and follow-up columns |
name_id |
Character string for the patient id column |
name_groupvar |
Character string for the grouping column |
names_eq5d |
Character vector of column names for the EQ-5D dimensions |
name_fu |
Character string for the follow-up column |
levels_fu |
Character vector containing the order of the values in the follow-up column. If NULL (default value), the levels will be ordered in the order of appearance in df. |
Summary data frame
table_1_2_2(df = example_data, name_groupvar = "surgtype", name_id = "id")
table_1_2_2(df = example_data, name_groupvar = "surgtype", name_id = "id")
Table 1.2.3: Changes in health according to the PCHC, taking account of those with no problems
table_1_2_3( df, name_id, name_groupvar, names_eq5d = NULL, name_fu = NULL, levels_fu = NULL )
table_1_2_3( df, name_id, name_groupvar, names_eq5d = NULL, name_fu = NULL, levels_fu = NULL )
df |
Data frame with the EQ-5D, grouping, id and follow-up columns |
name_id |
Character string for the patient id column |
name_groupvar |
Character string for the grouping column |
names_eq5d |
Character vector of column names for the EQ-5D dimensions |
name_fu |
Character string for the follow-up column |
levels_fu |
Character vector containing the order of the values in the follow-up column. If NULL (default value), the levels will be ordered in the order of appearance in df. |
Summary data frame
table_1_2_3(df = example_data, name_groupvar = "surgtype", name_id = "id")
table_1_2_3(df = example_data, name_groupvar = "surgtype", name_id = "id")
Table 1.2.4: Changes in levels in each dimension, percentages of total and of type of change
table_1_2_4(df, name_id, names_eq5d = NULL, name_fu = NULL, levels_fu = NULL)
table_1_2_4(df, name_id, names_eq5d = NULL, name_fu = NULL, levels_fu = NULL)
df |
Data frame with the EQ-5D, id and follow-up columns |
name_id |
Character string for the patient id column |
names_eq5d |
Character vector of column names for the EQ-5D dimensions |
name_fu |
Character string for the follow-up column |
levels_fu |
Character vector containing the order of the values in the follow-up column. If NULL (default value), the levels will be ordered in the order of appearance in df. |
Summary data frame
table_1_2_4(df = example_data, name_id = "id")
table_1_2_4(df = example_data, name_id = "id")
Table 1.3.1: Summary statistics for the EQ-5D values by all the different LSSs (Level Sum Scores)
table_1_3_1(df, names_eq5d = NULL, eq5d_version = NULL, country)
table_1_3_1(df, names_eq5d = NULL, eq5d_version = NULL, country)
df |
Data frame with the EQ-5D columns |
names_eq5d |
Character vector of column names for the EQ-5D dimensions |
eq5d_version |
Version of the EQ-5D instrument |
country |
A character string representing the name of the country. This could be in a 2-letter format, full name or short name, as specified in the country_codes datasets. |
Summary data frame
table_1_3_1(df = example_data, country = "USA") table_1_3_1(df = example_data, eq5d_version = "3L", country = "USA")
table_1_3_1(df = example_data, country = "USA") table_1_3_1(df = example_data, eq5d_version = "3L", country = "USA")
Table 1.3.2: Distribution of the EQ-5D states by LFS (Level Frequency Score)
table_1_3_2(df, names_eq5d = NULL, eq5d_version = NULL)
table_1_3_2(df, names_eq5d = NULL, eq5d_version = NULL)
df |
Data frame with the EQ-5D columns |
names_eq5d |
Character vector of column names for the EQ-5D dimensions |
eq5d_version |
Version of the EQ-5D instrument |
Summary data frame
table_1_3_2(df = example_data) table_1_3_2(df = example_data, eq5d_version = "3L")
table_1_3_2(df = example_data) table_1_3_2(df = example_data, eq5d_version = "3L")
Table 1.3.3: Number of observations in the LFS (Level Frequency Score) according to the EQ-5D values
table_1_3_3(df, names_eq5d = NULL, eq5d_version = NULL, country)
table_1_3_3(df, names_eq5d = NULL, eq5d_version = NULL, country)
df |
Data frame with the EQ-5D columns |
names_eq5d |
Character vector of column names for the EQ-5D dimensions |
eq5d_version |
Version of the EQ-5D instrument |
country |
A character string representing the name of the country. This could be in a 2-letter format, full name or short name, as specified in the country_codes datasets. |
Summary data frame
df <- example_data[example_data$surgtype == "Knee", ] table_1_3_3(df = df, names_eq5d = c("mo", "sc", "ua", "pd", "ad"), eq5d_version = "5L", country = "USA")
df <- example_data[example_data$surgtype == "Knee", ] table_1_3_3(df = df, names_eq5d = c("mo", "sc", "ua", "pd", "ad"), eq5d_version = "5L", country = "USA")
Table 1.3.4: Summary statistics of EQ-5D values by LFS (Level Frequency Score)
table_1_3_4(df, names_eq5d = NULL, eq5d_version = NULL, country)
table_1_3_4(df, names_eq5d = NULL, eq5d_version = NULL, country)
df |
Data frame with the EQ-5D columns |
names_eq5d |
Character vector of column names for the EQ-5D dimensions |
eq5d_version |
Version of the EQ-5D instrument |
country |
A character string representing the name of the country. This could be in a 2-letter format, full name or short name, as specified in the country_codes datasets. |
Summary data frame
table_1_3_4(df = example_data, country = "Denmark") table_1_3_4(df = example_data, eq5d_version = "3L", country = "Denmark")
table_1_3_4(df = example_data, country = "Denmark") table_1_3_4(df = example_data, eq5d_version = "3L", country = "Denmark")
Table 2.1: EQ VAS Score by timepoints
table_2_1(df, name_vas = NULL, name_fu = NULL, levels_fu = NULL)
table_2_1(df, name_vas = NULL, name_fu = NULL, levels_fu = NULL)
df |
Data frame with the VAS and the follow-up columns |
name_vas |
Character string for the VAS column |
name_fu |
Character string for the follow-up column |
levels_fu |
Character vector containing the order of the values in the follow-up column. |
Summary data frame
table_2_1(df = example_data)
table_2_1(df = example_data)
Table 2.2: EQ VAS Scores frequency of mid-points
table_2_2(df, name_vas = NULL, add_na_total = TRUE)
table_2_2(df, name_vas = NULL, add_na_total = TRUE)
df |
Data frame with the VAS column |
name_vas |
Character string for the VAS column |
add_na_total |
Logical, whether to add summary of the missing, and across the Total, data |
Summary data frame
table_2_2(df = example_data)
table_2_2(df = example_data)
Table 3.1: EQ-5D values: by timepoints
table_3_1( df, names_eq5d = NULL, name_fu = NULL, levels_fu = NULL, eq5d_version = NULL, country )
table_3_1( df, names_eq5d = NULL, name_fu = NULL, levels_fu = NULL, eq5d_version = NULL, country )
df |
Data frame with the EQ-5D and follow-up columns |
names_eq5d |
Character vector of column names for the EQ-5D dimensions |
name_fu |
Character string for the follow-up column |
levels_fu |
Character vector containing the order of the values in the follow-up column. If NULL (default value), the levels will be ordered in the order of appearance in df. |
eq5d_version |
Version of the EQ-5D instrument |
country |
A character string representing the name of the country. This could be in a 2-letter format, full name or short name, as specified in the country_codes datasets. |
Summary data frame
table_3_1(df = example_data, country = "USA") table_3_1(df = example_data, eq5d_version = "3L", country = "Denmark") table_3_1(df = example_data, country = "Denmark")
table_3_1(df = example_data, country = "USA") table_3_1(df = example_data, eq5d_version = "3L", country = "Denmark") table_3_1(df = example_data, country = "Denmark")
Table 3.2 EQ-5D values: by groupvar
table_3_2( df, names_eq5d = NULL, name_fu = NULL, levels_fu = NULL, name_groupvar, eq5d_version = NULL, country )
table_3_2( df, names_eq5d = NULL, name_fu = NULL, levels_fu = NULL, name_groupvar, eq5d_version = NULL, country )
df |
Data frame with the EQ-5D, follow-up and grouping columns |
names_eq5d |
Character vector of column names for the EQ-5D dimensions |
name_fu |
Character string for the follow-up column |
levels_fu |
Character vector containing the order of the values in the follow-up column. If NULL (default value), the levels will be ordered in the order of appearance in df. |
name_groupvar |
Character string for the grouping column |
eq5d_version |
Version of the EQ-5D instrument |
country |
A character string representing the name of the country. This could be in a 2-letter format, full name or short name, as specified in the country_codes datasets. |
Summary data frame
table_3_2(df = example_data, name_groupvar = "surgtype", country = "USA")
table_3_2(df = example_data, name_groupvar = "surgtype", country = "USA")
Table 3.3 EQ-5D values: by age and groupvar
table_3_3( df, names_eq5d = NULL, name_fu = NULL, levels_fu = NULL, name_groupvar, name_age, eq5d_version = NULL, country )
table_3_3( df, names_eq5d = NULL, name_fu = NULL, levels_fu = NULL, name_groupvar, name_age, eq5d_version = NULL, country )
df |
Data frame with the EQ-5D, age, follow-up and grouping columns |
names_eq5d |
Character vector of column names for the EQ-5D dimensions |
name_fu |
Character string for the follow-up column |
levels_fu |
Character vector containing the order of the values in the follow-up column. If NULL (default value), the levels will be ordered in the order of appearance in df. |
name_groupvar |
Character string for the grouping column |
name_age |
Character string for the age column |
eq5d_version |
Version of the EQ-5D instrument |
country |
A character string representing the name of the country. This could be in a 2-letter format, full name or short name, as specified in the country_codes datasets. |
Summary data frame
table_3_3(df = example_data, name_age = "age", name_groupvar = "surgtype", country = "USA")
table_3_3(df = example_data, name_age = "age", name_groupvar = "surgtype", country = "USA")
Generate dimension vectors based on state index
toEQ5Ddims(x, dim.names = c("mo", "sc", "ua", "pd", "ad"))
toEQ5Ddims(x, dim.names = c("mo", "sc", "ua", "pd", "ad"))
x |
A vector of 5-digit EQ-5D state indexes. |
dim.names |
A vector of dimension names to be used as names for output columns. |
A data.frame with 5 columns, one for each EQ-5D dimension, with names from dim.names argument.
toEQ5Ddims(c(12345, 54321, 12321))
toEQ5Ddims(c(12345, 54321, 12321))
Generate EQ-5D state vector from data.frame/matrix or named vector with dimensions.
toEQ5Dindex(x, dim.names = c("mo", "sc", "ua", "pd", "ad"))
toEQ5Dindex(x, dim.names = c("mo", "sc", "ua", "pd", "ad"))
x |
A data.frame, matrix, or vector containing dimension levels. Should have column names corresponding to the dim.names argument. |
dim.names |
A vector of dimension names in data.frame/matrix/vector x |
A vector of 5-digit EQ-5D health state indexes.
toEQ5Dindex(c(1,2,3,4,5)) example_data <- as.data.frame(matrix(data = c(1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 3, 2, 1, 2, 3), ncol = 5, byrow = TRUE, dimnames = list(NULL, c("mo", "sc", "ua", "pd", "ad")))) example_data$irrelevant <- c(6,5,3) toEQ5Dindex(example_data)
toEQ5Dindex(c(1,2,3,4,5)) example_data <- as.data.frame(matrix(data = c(1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 3, 2, 1, 2, 3), ncol = 5, byrow = TRUE, dimnames = list(NULL, c("mo", "sc", "ua", "pd", "ad")))) example_data$irrelevant <- c(6,5,3) toEQ5Dindex(example_data)