nb2.obs.pred: Table of negative binomial counts: observed vs predicted...

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

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

Usage

1
nb2.obs.pred(len, model)

Arguments

len

highest count for the table

model

name of the negative binomial model created

Details

nb2.obs.pred is used to determine where disparities exist in the mean observed and predicted proportions in the range of model counts. nb2.obs.pred is used in Table 9.28 and other places in Hilbe (2011). nb2.obs.pred follows glm.nb(), 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

1
2
3
4
5
library(MASS)

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

Example output

Loading required package: msme
Loading required package: MASS
Loading required package: lattice
Loading required package: sandwich
   Count  propObsv  propPred         Diff
1      0 0.0000000 2.4849072 -2.484907169
2      1 8.4280936 4.4766688  3.951424878
3      2 4.7491639 5.8328619 -1.083697971
4      3 5.0167224 6.6322404 -1.615518016
5      4 6.9565217 6.9926449 -0.036123144
6      5 8.2274247 7.0271129  1.200311813
7      6 6.4882943 6.8316130 -0.343318731
8      7 7.7591973 6.4829581  1.276239249
9      8 6.1538462 6.0403185  0.113527629
10     9 4.9498328 5.5478840 -0.598051219
11    10 5.9531773 5.0376833  0.915493948
12    11 4.6822742 4.5321676  0.150106642
13    12 4.6822742 4.0464205  0.635853797
14    13 2.8762542 3.5899752 -0.713720973
15    14 3.2775920 3.1682695  0.109322491
16    15 2.7424749 2.7837867 -0.041311751
17    16 2.8762542 2.4369352  0.439319004
18    17 1.9397993 2.1267165 -0.186917175
19    18 1.5384615 1.8512242 -0.312762698
20    19 1.6053512 1.6080108 -0.002659629
21    20 1.2709030 1.3943519 -0.123448936
22    21 1.2040134 1.2074331 -0.003419686
23    22 1.0033445 1.0444765 -0.041132062
24    23 0.6688963 0.9028253 -0.233928929
25    24 0.7357860 0.7799938 -0.044207818
26    25 0.2675585 0.6736964 -0.406137888

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

Related to nb2.obs.pred in COUNT...