Dataset: livertests | R Documentation |
Example data showing eight different biomarkers (laboratory tests), which are frequently measured in healthy controls and patients with liver diseases.
livertests
A data frame with 612 rows and 11 columns:
healthy reference individual or patient
age in years
sex f = female or m = male
albumin, g/L
alanine aminotransferase, U/L
aspartate aminotransferase, U/L
bilirubin, µmol/l
choline esterase, kU/L
creatinine, µmol/L
gamma-glutamyl transferase, U/L
total protein, mg/L
<https://archive.ics.uci.edu/ml/datasets/HCV+data>
summary(livertests)
pie(table(livertests$Category), labels = c("patients", "controls"))
plot(livertests$Age, livertests$ALB, xlab = "Age [yr]", ylab = "ALB [g/L]")
grid()
abline(lm(livertests$ALB ~ livertests$Age))
che <- livertests$CHE
ref <- livertests$CHE[livertests$Category == "reference"]
pat <- livertests$CHE[livertests$Category == "patient"]
hist(che, breaks = 1 : 20, col = "white", main = "cholinesterase", xlab = "kU/L")
hist(ref, breaks = 1 : 20, col = rgb(0, 1, 0, 0.5), add = TRUE)
hist(pat, breaks = 1 : 20, col = rgb(1, 0, 0, 0.5), add = TRUE)
legend("topright", fill = c(rgb(1,1,1,1), rgb(0,1,0,0.5), rgb(1,0,0,0.5)),
legend = c("all", "controls", "patients"))
t.test(ref, pat)
var.test(ref, pat)
che.f <- livertests$CHE[livertests$Sex == "f"]
che.m <- livertests$CHE[livertests$Sex == "m"]
plot(density(che.f), xlim = c(0, 20), col = "red",
main = "cholinesterase", xlab = "kU/L")
lines(density(che.m), col = "blue")
legend("topright", lty = 1, col = c("red", "blue"), legend = c("females", "males"))
reflim(che.m, main = "CHE (m)", xlab = "kU/L")
reflim(livertests$AST[livertests$Sex == "m"], main = "AST (m)", xlab = "U/L")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.