The tidykosmic R package estimates reference intervals from routinely collected laboratory data. It does this by fitting a normal distribution to the central part of the observed data. The original kosmic C++ library was written by Jakob Zierk and others.
The documentation can be found on the tidykosmic R package website.
Tidykosmic is still under development. You can install the development version from GitHub.
# install.packages("devtools") devtools::install_github("divinenephron/tidykosmic")
Here a reference interval is estimated for the simulated
haemoglobin dataset which contains randomly generated physiological results and contamination from randomly generated pathological result. The true reference interval for this data is 12.0-16.0 g/dL, and the estimates from kosmic are close.
summary(k) #> An estimated distribution of physiological results #> with the following quantiles: #> 2.5% 50.0% 97.5% #> 12.14464 13.94471 15.95217