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)
# 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
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)
print(Coef(rcim0, matrix = TRUE), dig = 3)
# 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