shannon | R Documentation |
Calculate Shannon's H' (diversity) index, H' max and Shannon's J' (evenness) index for an EQ-5D data set. This can be calculated both by dimension and for health states as a whole.
shannon(
scores,
version = NULL,
by.dimension = TRUE,
ignore.invalid = TRUE,
dimensions = .get_dimension_names(),
base = 2,
digits = 2,
permutations = TRUE
)
scores |
data.frame, numeric or character. For data.frame default column names should be MO, SC, UA, PD and AD representing Mobility, Self-care, Usual activities, Pain/discomfort and Anxiety/depression. Vector using five digit format can also be used. |
version |
string of value "3L" or "5L" to indicate instrument version. |
by.dimension |
boolean whether to calculate scores by EQ-5D dimensions or for the whole dataset. Defaults to TRUE. |
ignore.invalid |
boolean whether to ignore invalid scores. TRUE returns NA, FALSE throws an error. |
dimensions |
character vector, specifying "dimension" column names. Defaults are "MO", "SC", "UA", "PD" and "AD". |
base |
numeric base of logarithm to use. Defaults to base 2. |
digits |
numeric specifying the number of decimal places. Defaults to 2. |
permutations |
boolean whether to use maximum number of permutations for H' max or the number of observed unique profiles. Default is TRUE. |
a single list or list of dimensions containing H' H' max and J' scores.
dat <- read.csv(system.file("extdata", "eq5d3l_example.csv", package="eq5d"))
shannon(dat, version="3L", by.dimension=FALSE)
shannon(dat, version="3L", by.dimension=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.