source("http://192.38.117.59/~linearpredictors/datafiles/readFibrosis.R") table(fibrosis$stage) ## the quantiles in R are defined a bit different than in SAS, hence ## the deviation from the book tapply(fibrosis$ha, fibrosis$stage, quantile, probs = c(.5, 0.25,.75), na.rm = T) tapply(fibrosis$p3np, fibrosis$stage, quantile, probs = c(.5, 0.25,.75), na.rm = T) tapply(fibrosis$ykl40, fibrosis$stage, quantile, probs = c(.5, 0.25,.75), na.rm = T)