inst/HILBE_NBR2_FIGURES/hilbe.NBR2.F9.4.r

# hilbe.NBR2.F9.4.r
# From Hilbe, Negative Binomial regression, 2nd ed, Cambridge Univ. Press
# Figure 9.4     user may amend as required for own model
# Table 9.32
#
load("c://source/azpro.RData")
attach(azpro)
myTable <- function(x) {
myDF <- data.frame( table(x) )
myDF$Prop <- prop.table( myDF$Freq )
myDF$CumProp <- cumsum( myDF$Prop )
myDF
}
by(los, procedure, myTable)
windows(record=TRUE)      # set so graphs both show
by(los, procedure, hist)  # produces histograms
# OR
library("ggplot2")
qplot(los,geom="histogram",facets=procedure~.)

Try the COUNT package in your browser

Any scripts or data that you put into this service are public.

COUNT documentation built on May 2, 2019, 2:37 a.m.