Last data update: 2014.03.03

R: Table of Poisson counts: observed vs predicted proportions...
poi.obs.predR Documentation

Table of Poisson counts: observed vs predicted proportions and difference

Description

poi.obs.pred is used to produce a table of a Poisson model count response with mean observed vs mean predicted proportions, and their difference.

Usage

poi.obs.pred(len, model)

Arguments

len

highest count for the table

model

name of the Poisson model created

Details

poi.obs.pred is used to determine where disparities exist in the mean observed and predicted proportions in the range of model counts. poi.obs.pred is used in Table 6.15 and other places in Hilbe (2011). poi.obs.pred follows glm(), where both y=TRUE and model=TRUE options must be used.

Value

Count

count value

obsPropFreq

Observed proportion of counts

avgp

Predicted proportion of counts

Diff

Difference in observed vs predicted

Author(s)

Joseph M. Hilbe, Arizona State University, and Jet Propulsion Laboratory, California Institute of Technology Andrew Robinson, University of Melbourne, Australia

References

Hilbe, J.M. (2011), Negative Binomial Regression, second edition, Cambridge University Press.

See Also

myTable

Examples


data(medpar)
mdpar <- glm(los ~ hmo+white+type2+type3, family=poisson, data=medpar, y=TRUE, model=TRUE)
poi.obs.pred(len=25, model=mdpar)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(COUNT)
Loading required package: msme
Loading required package: MASS
Loading required package: lattice
Loading required package: sandwich
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/COUNT/poi.obs.pred.Rd_%03d_medium.png", width=480, height=480)
> ### Name: poi.obs.pred
> ### Title: Table of Poisson counts: observed vs predicted proportions and
> ###   difference
> ### Aliases: poi.obs.pred
> ### Keywords: table
> 
> ### ** Examples
> 
> 
> data(medpar)
> mdpar <- glm(los ~ hmo+white+type2+type3, family=poisson, data=medpar, y=TRUE, model=TRUE)
> poi.obs.pred(len=25, model=mdpar)
   Count  propObsv    propPred        Diff
1      0 0.0000000  0.01232337 -0.01232337
2      1 8.4280936  0.10762585  8.32046779
3      2 4.7491639  0.47139243  4.27777145
4      3 5.0167224  1.38115828  3.63556412
5      4 6.9565217  3.04698914  3.90953260
6      5 8.2274247  5.40212742  2.82529733
7      6 6.4882943  8.02399229 -1.53569797
8      7 7.7591973 10.28025575 -2.52105843
9      8 6.1538462 11.61173076 -5.45788461
10     9 4.9498328 11.76554185 -6.81570907
11    10 5.9531773 10.85170376 -4.89852651
12    11 4.6822742  9.23142648 -4.54915223
13    12 4.6822742  7.33676973 -2.65449548
14    13 2.8762542  5.52299460 -2.64674042
15    14 3.2775920  4.00092252 -0.72333055
16    15 2.7424749  2.84168874 -0.09921382
17    16 2.8762542  2.02017115  0.85608303
18    17 1.9397993  1.46481459  0.47498474
19    18 1.5384615  1.09549436  0.44296718
20    19 1.6053512  0.84458043  0.76077074
21    20 1.2709030  0.66418032  0.60672269
22    21 1.2040134  0.52497701  0.67903637
23    22 1.0033445  0.41144798  0.59189650
24    23 0.6688963  0.31658609  0.35231023
25    24 0.7357860  0.23766411  0.49812185
26    25 0.2675585  0.17348510  0.09407342
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>