% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/EQ_functions.R
\name{eq5d3l}
\alias{eq5d3l}
\title{eq5d3l}
\usage{
eq5d3l(x, country = NULL, dim.names = c("mo", "sc", "ua", "pd", "ad"))
}
\arguments{
\item{x}{A vector of 5-digit EQ-5D-3L state indexes, or a matrix/data.frame
with columns corresponding to the EQ-5D-3L dimensions.}

\item{country}{String vector indicating country names or ISO3166 Alpha 2 / 3
country codes.}

\item{dim.names}{A character vector specifying the names of the EQ-5D-3L
dimensions. Default is `c("mo", "sc", "ua", "pd", "ad")`.}
}
\value{
A numeric vector of EQ-5D-3L values, or a data.frame with one column
  for each requested value set.
}
\description{
Get EQ-5D-3L index values from individual responses to the five
dimensions of the EQ-5D-3L.
}
\examples{
# Example 1: utility values from EQ-5D-3L profile codes
eq5d3l(c(11111, 12321, 32123, 33333), country = "US")

# Example 2: request multiple value sets
eq5d3l(make_all_EQ_states("3L"), country = c("DK", "CA"))

# Example 3: use a data.frame with dimension columns
df3l <- data.frame(
  mo = c(1, 2, 3),
  sc = c(1, 2, 2),
  ua = c(1, 3, 1),
  pd = c(2, 2, 3),
  ad = c(1, 1, 2)
)
eq5d3l(df3l, country = "US")

# Example 4: use custom dimension column names
df3l_named <- data.frame(
  mobility = c(1, 2, 3),
  self_care = c(1, 2, 2),
  usual_activities = c(1, 3, 1),
  pain_discomfort = c(2, 2, 3),
  anxiety_depression = c(1, 1, 2)
)
eq5d3l(
  df3l_named,
  country = "US",
  dim.names = c(
    "mobility", "self_care", "usual_activities",
    "pain_discomfort", "anxiety_depression"
  )
)
}
