Goodness of fit measures for a CJS open-population capture recapture model.
F.cjs.gof( cjsobj, resid.type="pearson", rule.of.thumb = 2, HL.breaks = "deciles" )
A CJS capture-recapture fitted object from a previous call to F.cjs.estim
Type of residual to return. resid.type
= 'pearson' produces
Pearson residuals. resid.type
= 'deviance' produces deviance residuals.
Anything other than 'deviance' gives you Pearson residuals.
Rule of thumb to include a cell in one of the chi-square statistics. For example,
if rule.of.thumb
= 2, the expected count in a cell has to be greater than
2 in order for the cell to be included in the overall Chi-square statistic for
that table. No pooling of cells is done. Cells with expected values less than
rule.of.thumb
are dropped.
vector of bin break points to use in the Hosmer-Lemeshow statistic. This must
be a partition of the interval [0,1], with 0 as lowest break and 1 as max.
E.g., if HL.breaks = c(.25,.75), the bins used are [0,.25),[.25,.75),[.75,1].
The default, "deciles", calculates breakpoints such that 10
values are in each. I.e., approximately 0.1 * n
expected values
are in each of 10 cells.
A CJS object equivalent to the input crobj, with additional components for GOF testing. Additional components are a variety of goodness of fit statistics. Goodness of tests included are: (1) "Overall" = Chi-square test of overall goodness of fit based on all "live" cells in the capture histories, (2) "Osius and Rojek" = Osius and Rojeck correction to the overall chi-square test, (3) "Test 4" = Chi-square of observed and expected captures by occasion, (4) "Test 5" = Chi-square of observed and expected captures by individual, summed over animals, (5) "Hosmer-Lemeshow" = Hosmer-Lemeshow Chi-square GOF over all occasions and animals, and (6) "ROC" = area under the curve overall classification accuracy of expected values for capture histories. Tests (2), (5), and (6) are based on methods in chapter 5 of Hosmer and Lemeshow (2000).
Specifically, the output object has class c("cjsgof", "cjs", "cr"), contains all the components of the original CJS object, plus the following components:
Chi-square statistic for overall goodness of fit based on all "live" cells in the capture-recapture histories.
Degrees of freedom for overall goodness of fit test.
P-value for overall goodness of fit.
Chi-square table for the Osius and Rojek correction to the overall GOF test (See p. 153 of Hosmer and Lemeshow (2000)).
Chi-square statistic for the Osius and Rojek test.
Degrees of freedom for the Osius and Rojek test.
Correction to the Osius and Rojek test. This is computed as number of unique expected values minus the sum of 1 over the individual cell counts.
Root sum-of-squares for the Osius and Rojek test, obtained from weighted regression.
Osius and Rojek Z statistic. This is computed as (or.chi - or.df) / sqrt( or.correction + or.rss )
2-tailed Osius and Rojek p-value computed from standard normal distribution and the Osius and Rojek Z statistic.
Chi-square table for Test 4, which sums observed and expected captures over individuals. This table has one cell for each occasion.
Chi-square statistic for Test 4, computed from t4.table
by
summing the chi-square contributions over cells that meet the rule.of.thumb
.
Degrees of freedom for Test 4. Equal to number of cells meeting rule.of.thumb
minus 1.
P-value for Test 4 computed from Chi-squared distribution.
Chi-square table for Test 5, which sums observed and expected captures over occasions. This table has one cell for each individual.
Chi-square statistic for Test 5, compute from t5.table
by
summing the chi-square contributions over cells that meet the rule.of.thumb
.
Degrees of freedom for Test 5. Equal to number of cells meeting rule.of.thumb
minus 1.
P-value for Test 5 computed from Chi-squared distribution.
Chi-square table for the Hosmer-Lemeshow test.
Chi-square statistic for the Hosmer-Lemeshow test.
Degrees of freedom for the Hosmer-Lemeshow test.
P-value for the Hosmer-Lemeshow test.
Area under the curve statistic for the ability of the "live" cell expected values to classify captures.
The "overall" Chi-square test computes the sum of [(h(ij) - Psi(ij))*(h(ij) - Psi(ij))] / Psi(ij) over all "live" cells in the capture-recapture problem. "Live" cells are those following initial captures, prior to and including the occasion when an animal was censoring (died on capture and removed). If an animal was not censored, the "live" cells for it extend from occasion following initial capture to the end of the study. In the above, h(ij) is the 0-1 capture indicator for animal i at occasion j. Psi(ij) is the expected value of h(ij), and is computed as the produce of survival estimates from initial capture to occasion j, times probability of capture at occasion j. Assuming animal i was initially captured at the a-th occasion, Psi(ij) is computed as phi(ia) * phi(i(a+1)) * ... * phi(i(j-1)) * p(ij), where phi(ij) is the modeled estimate of survival for animal i from occasion j to occasion j+1, and p(ij) is the probability of capturing animal i during occasion j.
The other derived GOF tests computed here use h(ij) and its expected value Psi(ij). Test 4 sums observed and expected over individuals. Test 5 sums observed and expected over occasions. The other 3 tests were borrowed from logistic regression by viewing h(ij) as a binary response, and Psi(ij) as its expected value.
Hosmer, D. W. and S. Lemeshow. 2000. Applied Logistic Regression, 2nd edition. New York: John Wiley and Sons.
# NOT RUN {
data(dipper.histories)
xy <- F.cjs.covars( nrow(dipper.histories), ncol(dipper.histories) )
for(j in 1:ncol(dipper.histories)){ assign(paste("x",j,sep=""), xy$x[,,j]) }
dipper.cjs <- F.cjs.estim( ~x2+x3+x4+x5+x6, ~x1+x2+x3+x4+x5, dipper.histories )
dipper.cjs.gof <- F.cjs.gof( dipper.cjs )
print(dipper.cjs.gof)
# }
Run the code above in your browser using DataLab