#' Lung Cancer Trial Data
#'
#' Survival data from a clinical trial of lung cancer patients conducted
#'  by the Veteran's Administration.
#'
#' @format A data frame with 137 observations and 8 variables:
#' \describe{
#'   \item{trt}{Treatment group (1 = standard, 2 = test)}
#'   \item{celltype}{Cell type (squamous, smallcell, adeno, large)}
#'   \item{time}{Survival time (in days)}
#'   \item{status}{Censoring status (1 = died, 0 = censored)}
#'   \item{karno}{Karnofsky performance score (higher = better)}
#'   \item{diagtime}{Months from diagnosis to randomization}
#'   \item{age}{Age in years}
#'   \item{prior}{Prior therapy (0 = no, 10 = yes)}
#' }
#' @source \url{https://CRAN.R-project.org/package=survival}
#' @references Kalbfleisch JD and Prentice RL (1980).
#'  The Statistical Analysis of Failure Time Data.
"data_lungcancer"

#' Endometrial Cancer Histology Grade Data
#'
#' A classic endometrial cancer dataset used to demonstrate separation in
#' logistic regression. The outcome is high histology grade. Neovascularization
#' is completely absent among low-grade cases in this dataset, making it useful
#' for teaching Firth penalized logistic regression.
#'
#' @format A data frame with 79 observations and 4 variables:
#' \describe{
#'   \item{NV}{Neovascularization status (0 = absent, 1 = present)}
#'   \item{PI}{Pulsatility index of the uterine artery}
#'   \item{EH}{Endometrium height}
#'   \item{HG}{Histology grade (0 = low grade, 1 = high grade)}
#' }
#'
#' @source \pkg{brglm2} package. The packaged dataset was sourced from
#' \url{https://users.stat.ufl.edu/~aa/glm/data/}, the data repository used in
#' Agresti (2015). Originally analyzed in Heinze and Schemper (2002).
#' @references
#' Agresti A (2015). \emph{Foundations of Linear and Generalized Linear Models}.
#' Wiley.
#'
#' Heinze G, Schemper M (2002). A solution to the problem of separation in
#' logistic regression. \emph{Statistics in Medicine}, 21, 2409-2419.
#' \doi{10.1002/sim.1047}
"data_endometrial"

#' Diabetes Mediation Teaching Dataset
#'
#' A health-related teaching dataset prepared from synthetic diabetes data.
#' It is designed for the practical question: could part of the obesity
#' and diabetes relationship operate through plasma glucose, after adjustment
#' for basic clinical covariates?
#'
#' @format A data frame with variables:
#' \describe{
#'   \item{diabetes}{Diabetes status (\code{No}, \code{Yes})}
#'   \item{obesity}{Obesity status based on BMI >= 30 (\code{No}, \code{Yes})}
#'   \item{glucose}{Plasma glucose concentration}
#'   \item{bmi}{Body mass index}
#'   \item{age}{Age in years}
#'   \item{blood_pressure}{Diastolic blood pressure}
#'   \item{pregnancies}{Number of pregnancies}
#'   \item{diabetes_pedigree}{Diabetes pedigree function}
#' }
#'
#' @details
#' This dataset is intended for practice and teaching. Mediation estimates from
#' observational data should be interpreted causally only when the temporal
#' ordering and no-unmeasured-confounding assumptions are justified by study
#' design, DAGs, and subject-matter knowledge.
#'
#' @source Derived from \code{data_SynthDiabetes}, which is based on
#' \code{mlbench::SynthDiabetes2} (\pkg{mlbench} version 2.1-11 or later).
"data_diabetes_mediation"

#' Infertility Matched Case-Control Study
#'
#' investigating the relationship between infertility and abortions.
#'
#' @format A data frame with 248 observations and 8 variables:
#' \describe{
#'   \item{education}{Education level (0 = 0–5 years, 1 = 6–11 years,
#'   2 = 12+ years)}
#'   \item{age}{Age in years}
#'   \item{parity}{Number of prior pregnancies}
#'   \item{induced}{Number of induced abortions}
#'   \item{case}{Infertility case status (1 = case, 0 = control)}
#'   \item{spontaneous}{Number of spontaneous abortions}
#'   \item{stratum}{Matched set ID}
#'   \item{pooled.stratum}{Pooled stratum ID used for conditional regression}
#' }
#' @source
#' \url{https://stat.ethz.ch/R-manual/R-devel/library/datasets/html/infert.html}
"data_infertility"


#' Epilepsy Treatment and Seizure Counts
#'
#' RCT on the effect of a drug on the seizures in patients with epilepsy.
#' Contains repeated measures data with treatment groups,
#' baseline seizure counts, and follow-up counts.
#'
#' @format A data frame with 236 observations and 9 variables:
#' \describe{
#'   \item{y}{Number of seizures in a 2-week period (count)}
#'   \item{trt}{Treatment group (factor): \code{placebo} or \code{progabide}}
#'   \item{base}{Seizure count during baseline period (numeric)}
#'   \item{age}{Age of patient (numeric)}
#'   \item{V4}{Indicator for 4th visit (binary)}
#'   \item{subject}{Patient ID (factor)}
#'   \item{period}{Follow-up period number (integer)}
#'   \item{lbase}{Log of baseline seizures (numeric)}
#'   \item{lage}{Log of age (numeric)}
#' }
#'
#' @source \pkg{MASS} package. Original data from Thall and Vail (1990)
"data_epilepsy"


#' Birth Weight Data
#'
#' A dataset from the \pkg{MASS} package containing risk factors
#' associated with low birth weight (LBW) in newborns.
#' Originally collected at Baystate Medical Center,
#' Springfield, Massachusetts, USA.
#'
#' The outcome variable is binary (`low`): birth weight < 2500g (yes = 1)
#' or not (no = 0).
#'
#' @format A data frame with 189 observations and 10 variables:
#' \describe{
#'   \item{low}{Indicator for birth weight < 2500g (binary):
#'   \code{0 = normal}, \code{1 = low birth weight}}
#'   \item{age}{Mother's age in years (numeric)}
#'   \item{lwt}{Mother's weight in pounds at last menstrual period (numeric)}
#'   \item{race}{Mother's race (factor): \code{1 = White}, \code{2 = Black},
#'   \code{3 = Other}}
#'   \item{smoke}{Smoking status during pregnancy (binary): \code{0 = No},
#'    \code{1 = Yes}}
#'   \item{ptl}{Number of previous premature labors (integer)}
#'   \item{ht}{History of hypertension (binary): \code{0 = No}, \code{1 = Yes}}
#'   \item{ui}{Presence of uterine irritability (binary): \code{0 = No},
#'   \code{1 = Yes}}
#'   \item{ftv}{no of physician visits during the 1st trimester (integer, 0–6)}
#'   \item{bwt}{Birth weight in grams (numeric)}
#' }
#'
#' @source Hosmer, D.W., Lemeshow, S. (1989). *Applied Logistic Regression.*
#' New York: Wiley.
#' Also available in \pkg{MASS} and described in detail in its documentation.
"data_birthwt"


#' Student Absenteeism in Rural Schools
#'
#' This dataset contains observations on the number of days absent from school
#' for children in rural Australia,
#' along with student characteristics. It's commonly used to demonstrate count
#' models such as Poisson and Negative Binomial regression.
#'
#' @format A data frame with 146 observations and 5 variables:
#' \describe{
#'   \item{Eth}{Ethnicity (\code{"A"} = Aboriginal,
#'   \code{"N"} = Non-Aboriginal)}
#'   \item{Sex}{Sex (\code{"F"} or \code{"M"})}
#'   \item{Age}{Age group (\code{"F0", "F1", "F2", "F3"})}
#'   \item{Lrn}{Learner status (\code{"AL"} = average learner,
#'    \code{"SL"} = slow learner)}
#'   \item{Days}{Number of days absent from school (count outcome)}
#' }
#'
#' @source \pkg{MASS} package. See also Venables and Ripley (2002),
#'  *Modern Applied Statistics with S*.
#'
"data_gt_quin"

#' Synthetic Diabetes Dataset
#'
#' A synthetic replacement for the former diabetes dataset from the
#' \pkg{mlbench} package. It has the same structure and number of observations
#' but does not represent real people.
#' Useful for demonstrating regression approaches for binary outcomes.
#'
#' @format A data frame with 768 observations and 9 variables:
#' \describe{
#'   \item{pregnant}{Number of times pregnant}
#'   \item{glucose}{Plasma glucose concentration (glucose tolerance test)}
#'   \item{pressure}{Diastolic blood pressure (mm Hg)}
#'   \item{triceps}{Triceps skin fold thickness (mm)}
#'   \item{insulin}{2-Hour serum insulin (mu U/ml)}
#'   \item{mass}{Body mass index (BMI)}
#'   \item{pedigree}{Diabetes pedigree function}
#'   \item{age}{Age in years}
#'   \item{diabetes}{Factor indicating diabetes status (pos/neg)}
#' }
#'
#' @source \code{mlbench::SynthDiabetes2}, available in \pkg{mlbench}
#' version 2.1-11 or later.
"data_SynthDiabetes"
