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