# Some undergraduate student enrolments at the University of Auckland in 1990
grc1 <- grc(auuc)
fitted(grc1)
summary(grc1)
grc2 <- grc(auuc, Rank = 2, Index.corner = c(2, 5))
fitted(grc2)
summary(grc2)
# 2008 Summer Olympic Games in Beijing
top10 <- head(olympic, n = 10)
oly1 <- with(top10, grc(cbind(gold, silver, bronze)))
round(fitted(oly1))
round(resid(oly1, type = "response"), dig = 1) # Response residuals
summary(oly1)
Coef(oly1)
# Roughly median polish
rcam0 <- rcam(auuc, fam = alaplace2(tau = 0.5, intparloc = TRUE), trace = TRUE)
round(fitted(rcam0), dig = 0)
round(100 * (fitted(rcam0) - auuc) / auuc, dig = 0) # Discrepancy
rcam0@y
round(coef(rcam0, matrix = TRUE), dig = 2)
print(Coef(rcam0, matrix = TRUE), dig = 3)
# constraints(rcam0)
names(constraints(rcam0))
# Compare with medpolish():
(med.a <- medpolish(auuc))
fv <- med.a$overall + outer(med.a$row, med.a$col, "+")
round(100 * (fitted(rcam0) - fv) / fv) # Hopefully should be all 0s
Run the code above in your browser using DataLab