if (FALSE) # Example 1
nona.xs.nz <- na.omit(xs.nz) # Overkill!! (Data in VGAMdata package)
nona.xs.nz$dmd <- with(nona.xs.nz, round(drinkmaxday))
nona.xs.nz$feethr <- with(nona.xs.nz, round(feethour))
nona.xs.nz$sleephr <- with(nona.xs.nz, round(sleep))
nona.xs.nz$beats <- with(nona.xs.nz, round(pulse))
p2 <- rrvglm(cbind(dmd, feethr, sleephr, beats) ~ age + smokenow +
depressed + embarrassed + fedup + hurt + miserable + # 11 psychological
nofriend + moody + nervous + tense + worry + worrier, # variables
noRRR = ~ age + smokenow, trace = FALSE, poissonff, data = nona.xs.nz,
Rank = 2)
cp2 <- calibrate(p2, newdata = head(nona.xs.nz, 9), trace = TRUE)
cp2
two.cases <- nona.xs.nz[1:2, ] # Another calibration example
two.cases$dmd <- c(4, 10)
two.cases$feethr <- c(4, 7)
two.cases$sleephr <- c(7, 8)
two.cases$beats <- c(62, 71)
(cp2b <- calibrate(p2, newdata = two.cases))
# Example 2
p1 <- rrvglm(cbind(dmd, feethr, sleephr, beats) ~ age + smokenow +
depressed + embarrassed + fedup + hurt + miserable + # 11 psychological
nofriend + moody + nervous + tense + worry + worrier, # variables
noRRR = ~ age + smokenow, trace = FALSE, poissonff, data = nona.xs.nz,
Rank = 1)
(cp1c <- calibrate(p1, newdata = two.cases, lr.confint = TRUE))
Run the code above in your browser using DataLab