% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/bode_index.R
\name{bode_index}
\alias{bode_index}
\title{BODE Index (BMI, Obstruction, Dyspnea, Exercise capacity)}
\usage{
bode_index(
  data,
  col_map = NULL,
  na_action = c("keep", "omit", "error", "ignore", "warn"),
  verbose = TRUE
)
}
\arguments{
\item{data}{data.frame/tibble with required columns.}

\item{col_map}{named list with keys:
fev1_pct OR (fev1 and fev1_pred) OR fev1_pp; plus sixmwd, mmrc, bmi.
Example minimal: list(fev1_pct="FEV1pct", sixmwd="Walk_m", mmrc="mMRC", bmi="BMI")
Example derive: list(fev1="FEV1", fev1_pred="FEV1_pred", sixmwd="Walk_m", mmrc="mMRC", bmi="BMI")
Example from spirometry_markers: list(fev1_pp="fev1_pp", sixmwd="Walk_m", mmrc="mMRC", bmi="BMI")}

\item{na_action}{one of c("keep","omit","error","ignore","warn").}

\item{verbose}{logical; TRUE (default) emits messages.}
}
\value{
tibble with bode_index (integer). NA if any required input missing (unless omitted).
}
\description{
Computes the BODE index (0-10) using FEV1 \% predicted, 6-minute walk distance (6MWD),
mMRC dyspnea scale, and BMI. Higher scores indicate worse prognosis in COPD.
}
\details{
Scoring components:
FEV1 \% predicted: >=65 = 0; 50-64 = 1; 36-49 = 2; <=35 = 3
6MWD (meters): >=350 = 0; 250-349 = 1; 150-249 = 2; <=149 = 3
mMRC dyspnea: 0-1 = 0; 2 = 1; 3 = 2; 4 = 3
BMI: >21 = 0; <=21 = 1
}
\examples{
df <- data.frame(FEV1pct = c(68, 45, 30), Walk_m = c(400, 280, 140),
                 mMRC = c(1, 2, 3), BMI = c(24, 19, 18))
bode_index(df, col_map = list(fev1_pct = "FEV1pct", sixmwd = "Walk_m",
                              mmrc = "mMRC", bmi = "BMI"))
}
\references{
\insertRef{celli2004bode}{HealthMarkers}
}
