Coerce a data frame to an EQ5D object.
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 of these 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
as_eq5d5l(
x,
respondentID,
surveyID,
mobility,
self_care,
usual,
pain,
anxiety,
vas,
...
)
as_eq5d3l(
x,
respondentID,
surveyID,
mobility,
self_care,
usual,
pain,
anxiety,
vas,
...
)
as_eq5dy(
x,
respondentID,
surveyID,
mobility,
self_care,
usual,
pain,
anxiety,
vas,
...
)
Arguments
- x
An R object.
- respondentID
[character]
The name of a variable inx
that uniquely identifies respondents.- surveyID
[character]
Name of variablex
that uniquely identifies surveys over time.- mobility
[character]
Name of the 'mobility' dimension inx
.- self_care
[character]
Name of the 'self-care' dimension inx
.- usual
[character]
Name of the 'usual activities' dimension inx
.- pain
[character]
Name of the 'pain / discomfort' dimension inx
.- anxiety
[character]
Name of the 'anxiety / depression' dimension inx
.- vas
[character]
Name of the 'visual analogue score' variable inx
.- ...
Further arguments passed to or from other methods.
See also
new_eq5d
for more minimal, developer focussed, alternatives.
Examples
data("eq5d3l_example")
as_eq5d3l(
eq5d3l_example,
respondentID = "respondentID",
surveyID = "surveyID",
mobility = "MO",
self_care = "SC",
usual = "UA",
pain = "PD",
anxiety = "AD",
vas = "vas"
)
#> # EQ-5D-3L: 200 x 10
#> MO SC UA PD AD Group surveyID respondentID vas time
#> * <int> <int> <int> <int> <int> <chr> <fct> <int> <dbl> <dbl>
#> 1 1 1 2 2 1 Group1 survey01 1 67 0
#> 2 1 1 1 2 1 Group2 survey01 2 84 0
#> 3 2 2 3 3 1 Group1 survey01 3 17 0
#> 4 1 1 1 2 1 Group2 survey01 4 73 0
#> 5 1 2 2 2 1 Group1 survey01 5 60 0
#> 6 1 1 1 1 1 Group2 survey01 6 77 0
#> 7 2 1 2 2 1 Group1 survey01 7 74 0
#> 8 1 1 1 1 1 Group2 survey01 8 96 0
#> 9 1 2 2 2 1 Group1 survey01 9 69 0
#> 10 1 2 2 1 1 Group2 survey01 10 79 0
#> # … with 190 more rows
#> # ℹ Use `print(n = ...)` to see more rows