test_fit: Goodness of Fit for GPT Models

test_fitR Documentation

Goodness of Fit for GPT Models

Description

The continuous variable of a GPT model is categorized into discrete bins to compute Pearsons X^2 between the predicted and observed bin frequencies.

Usage

test_fit(gpt_fit, breaks, bins = 6, statistic = "dn", lambda = 1)

Arguments

gpt_fit

a fitted GPT model (see gpt_fit)

breaks

a list giving the breakpoints per category or a vector, in which case the same bounds are used for each category. By default, model-implied quantiles are used for each category.

bins

number of bins used to compute model-implied boundaries/quantiles.

statistic

a vector with labels of the statistic to be computed.

  • "dn" the Dzhaparidze-Nikulin statistic

  • "pf" the Pearson-Fisher test (refitting the model to the binned data)

  • "pd" the power-divergence statistic with parameter lambda. Since the asymptotic distribution is not chi^2, this statistic requires a parametric or nonparametric bootstrap (not implemented).

lambda

Only relevant for statistic = "pf" and "pd". Lambda is the parameter of the power-divergence statistic by Read & Cressie (1988). lambda=1 is equivalent to Pearson's X^2, and lambda=0 is equivalent to the likelihood-ratio statistic G^2.

References

Dzhaparidze, K., & Nikulin, M. (1974). On a modification of the standard statistics of Pearson. Theory of Probability & Its Applications, 19(4), 851-853. https://doi.org/10.1137/1119098

Read, T. R. C., & Cressie, N. A. C. (1988). Goodness-of-fit statistics for discrete multivariate data. New York, NY: Springer.

D'Agostino, R. B., & Stephens, M. A. (1986). Goodness-of-fit techniques. New York, NY: Marcel Dekker, Inc.


danheck/gpt documentation built on March 29, 2025, 1:17 p.m.