Skip to contents

new_eq5d3l(), new_eq5d5l() and new_eq5dy() are developer facing functions for the construction of EQ5D objects that perform minimal checking of input data. They should normally be followed by a call to validate_eq5d() to ensure assumptions about the underlying data are valid.

The EQ5D class

We define an EQ5D object as a data frame that meets the following criteria:

  • It contains columns that represent dimensions from the EQ5D survey specification as well as a column representing the Visual Analogue Score.

  • It contains a column that acts as a unique respondent identifier and another that identifies different surveys over time. Together these should uniquely identify a response and no combination should be duplicated within the data frame.

EQ5D3L, EQ5D5L and EQ5DY objects are defined as a subclass of EQ5D objects with the additional restriction that the corresponding dimension columns in x are either NA or whole numbers bounded below by 1 and above by 3 or 5 (depending on the survey type).

Usage

new_eq5d3l(
    x,
    respondentID, surveyID,
    mobility, self_care, usual, pain, anxiety,
    vas
)

new_eq5d3l(
    x,
    respondentID, surveyID,
    mobility, self_care, usual, pain, anxiety,
    vas
)

new_eq5dy(
    x,
    respondentID, surveyID,
    mobility, self_care, usual, pain, anxiety,
    vas
)

validate_eq5d(x, version)

validate_eq5d3l(x)

validate_eq5d5l(x)

validate_eq5dy(x)

Arguments

x

[data.frame] EQ5D survey data.

respondentID

[character] The name of a variable in x that uniquely identifies respondents.

surveyID

[character] Name of variable in x that uniquely identifies surveys over time.

mobility

[character] Name of the 'mobility' dimension in x.

self_care

[character] Name of the 'self-care' dimension in x.

usual

[character] Name of the 'usual activities' dimension in x.

pain

[character] Name of the 'pain / discomfort' dimension in x.

anxiety

[character] Name of the 'anxiety / depression' dimension in x.

vas

[character] Name of the 'visual analogue score' variable in x.

version

[character] The EQ5D version. One of "3L", "5L" or "Y".

Value

An EQ5D3L, EQ5D5L or EQ5D3Y object (invisibly for the corresponding validation functions).

See also

as_eq5d for user-facing alternatives.

Examples


data("EQ5D5L_surveys")
dat <- EQ5D5L_surveys
dat$surveyID <- factor(dat$surveyID)

res <- new_eq5d5l(dat,
    respondentID = "respondentID",
    surveyID = "surveyID",
    mobility = "mobility",
    self_care = "self_care",
    usual = "usual",
    pain = "pain",
    anxiety = "anxiety",
    vas = "vas"
)

validate_eq5d(res, version = "5L")
validate_eq5d5l(res)
try(validate_eq5d3l(res))
#> Error in validate_eq5d(x, version = "3L") : 
#>   Dimensions must be bounded by 1 and 3 or, NA.
try(validate_eq5d(res, version = "3L"))
#> Error in validate_eq5d(res, version = "3L") : 
#>   Dimensions must be bounded by 1 and 3 or, NA.