MAJOR=8
MINOR=3
DEVNAME=sda3
DEVTYPE=partition
DISKSEQ=2
PARTN=3
PARTNAME=primary
 Ô    ‹      ­“]oÚ0†ïû+Î|±»ä¤|­´Ž§.A*D™¦iš&“˜ÄjbG¶3è~ý¡*›@ûÐ®œ8O^ŸçØ¦¯âY´ü4ÁûåýæÞMÆñc7BŒ—qû¡ç—ˆ£)’;W]#n6ÓõµÉp¹ÀÜ•E­32q~êRÂ.ènŽ] ÍO›¨“®l¬R±½Ôµ³2=¬­ÁB®p{5ø:èy…TõÖËT�•0öýîÀ�×Nci4Å6§IÆC4]éôi·âåHoBöÅòÕ~‘Ý£aÔåð�2S!qº"ŒÊ2k’� L´²¸*¸zô3¹&À’Ïãhö¥áÐå»¿å�±ÉÛ(œÞÌÂ˜°)/E~š¹o˜[Â&Ü:(u*×R¤gá‡~�ßÏÆ-›Y9©ÕŠ�â±j¢[ñÆµßäæ˜j‘ôwÝàÉOÍ˜ß.FÓe<^´-Iw/ÕýË^6çF(±4"qÚ<tÚì×je«›çW8kd–;Â <8Iþ…a­•Þ¨cÉ¦�'õšcå[MX;—ùK]� 3ð‚¡×BÐ½îÎ	tÞÜ�øÃ�ÄÃ§¸¿>Ûû1wM´    7   ˆl–Ü4ý(Ð?J�fà¸ËJbÑ¿�þYeæVlm‘—Û$€eà?È„!yßÇ¿Å 3ƒ    ### R code from vignette source 'countreg.Rnw'

###################################################
### code chunk number 1: preliminaries
###################################################
library("sandwich")
library("lmtest")
library("MASS")
library("car")
library("pscl")
load("DebTrivedi.rda")

clog <- function(x) log(x + 0.5)
cfac <- function(x, breaks = NULL) {
  if(is.null(breaks)) breaks <- unique(quantile(x, 0:10/10))
  x <- cut(x, breaks, include.lowest = TRUE, right = FALSE)
  levels(x) <- paste(breaks[-length(breaks)], ifelse(diff(breaks) > 1,
    c(paste("-", breaks[-c(1, length(breaks))] - 1, sep = ""), "+"), ""), sep = "")
  return(x)
}

options(prompt = "R> ")
refit_models <- TRUE


###################################################
### code chunk number 2: dt
###################################################
dt <- DebTrivedi[, c(1, 6:8, 13, 15, 18)]


###################################################
### code chunk number 3: dt2
###################################################
dt2 <- DebTrivedi[, -(2:6)]
dt2$region <- relevel(dt2$region, "other")


###################################################
### code chunk number 4: ofp-plot (eval = FALSE)
###################################################
## plot(table(dt$ofp))


###################################################
### code chunk number 5: ofp-plot2
###################################################
plot(table(dt$ofp), xlab = "Number of physician office visits", ylab = "Frequency", axes = FALSE)
axis(2)
axis(1, at = 0:18 * 5, labels = FALSE)
axis(1, at = 0:9 * 10)


###################################################
### code chunk number 6: bad-good
###################################################
par(mfrow = c(1, 2))
plot(ofp ~ numchron, data = dt)
plot(clog(ofp) ~ cfac(numchron), data = dt)


###################################################
### code chunk number 7: bad (eval = FALSE)
###################################################
## plot(ofp ~ numchron, data = dt)


###################################################
### code chunk number 8: clog
###################################################
clog <- function(x) log(x + 0.5)


###################################################
### code chunk number 9: cfac
###################################################
cfac <- function(x, breaks = NULL) {
  if(is.null(breaks)) breaks <- unique(quantile(x, 0:10/10))
  x <- cut(x, breaks, include.lowest = TRUE, right = FALSE)
  levels(x) <- paste(breaks[-length(breaks)], ifelse(diff(breaks) > 1,
    c(paste("-", breaks[-c(1, length(breaks))] - 1, sep = ""), "+"), ""),
    sep = "")
  return(x)
}


###################################################
### code chunk number 10: good (eval = FALSE)
###################################################
## plot(clog(ofp) ~ cfac(numchron), data = dt)


###################################################
### code chunk number 11: ofp2-plot1
###################################################
par(mfrow = c(3, 2))
plot(clog(ofp) ~ health, data = dt, varwidth = TRUE,
  ylab = "Physician office visits (in clogs)", xlab = "Self-perceived health status", main = "health")
plot(clog(ofp) ~ cfac(numchron), data = dt,
  ylab = "Physician office visits (in clogs)", xlab = "Number of chronic conditions", main = "numchron")
plot(clog(ofp) ~ privins, data = dt, varwidth = TRUE,
  ylab = "Physician office visits (in clogs)", xlab = "Covered by private insurance", main = "privins")
plot(