
GGOFF Tests for Fractional Response Regressions
fracreg.ggoff.Rdfracreg.ggoff is used to perform Generalised Goodness-Of-Functional-Form (GGOFF) tests to check the adequacy of the functional form and link specification of fractional response models.
Arguments
- object
an object containing the results of an
fracregcommand.- version
a vector containing the test versions to use. Available options:
Wald,LM(the default) and, only for the binary component of two-part models,LR. More than one option may be chosen.- table
a logical value indicating whether a summary table with the test results should be printed.
- ...
Arguments to pass to glm, which is used to estimate the model under the alternative hypothesis when
versionis a vector containing"Wald"or"LR".
Details
fracreg.ggoff applies the GGOFF, GOFF1 and GOOFF2 test statistics to fractional response
models estimated via fracreg. fracreg.ggoff may be used to test the link
specification of: (i) one-part fractional response models; (ii) the binary
component of two-part fractional response models; and (iii) the fractional
component of two-part fractional response models.
GGOFF Test Framework: The Generalised Goodness-of-Functional Form (GGOFF) test evaluates the adequacy of the link function \(G(\cdot)\). It is based on augmenting the baseline model with specific directions of departure. The auxiliary testing equation takes the form: $$E(y|x) = G\left(x\beta + \gamma_1 \frac{g'(x\hat{\beta})}{g(x\hat{\beta})} + \gamma_2 x\hat{\beta} \right)$$ where \(g(\cdot)\) and \(g'(\cdot)\) are the first and second derivatives of \(G(\cdot)\) evaluated at the linear predictor \(x\hat{\beta}\). The test checks \(H_0: \gamma_1 = 0, \gamma_2 = 0\). GOFF1 and GOFF2 are variants testing individual components.
When the Wald version is implemented, it is taken into account the option that was chosen for computing standard errors in the model under evaluation. For the LM version, a robust version is computed in cases (i) and (iii) and a conventional version in case (ii). See Ramalho, Ramalho and Murteira (2014) for details on the application of the GGOFF, GOFF1 and GOOFF2 tests in the fractional response framework.
References
Ramalho, E.A., J.J.S. Ramalho and J.M.R. Murteira (2014), "A generalized goodness-of-functional form test for binary and fractional response models", Manchester School, 82(4), 488-507.
Pregibon, D. (1980), "Goodness of Link Tests for Generalized Linear Models", Journal of the Royal Statistical Society: Series C (Applied Statistics), 29(1), 15-24.
See also
fracreg, for fitting fractional response models.fracreg.reset, for asymptotically equivalent specification tests.fracreg.ptest, for non-nested hypothesis tests.fracreg.pe, for computing partial effects.
Examples
### Empirical 401(k) Examples
data("fracreg_k401k")
y <- fracreg_k401k$prate
X <- cbind(mrate = fracreg_k401k$mrate, age = fracreg_k401k$age,
totemp = fracreg_k401k$totemp, sole = fracreg_k401k$sole)
m <- fracreg(y, X, type="1P", linkfrac="logit")
#>
#> --------------------------------------------------------------------------------
#> Fractional logit regression
#> --------------------------------------------------------------------------------
#> Estimator: QML
#> Data type: Cross-sectional
#> Number of observations: 1534
#> Pseudo R-squared: 0.14667
#> Log pseudolikelihood: -553.1626
#> Wald chi2(4): 147.3049
#> Prob > chi2: 0.0000
#> Standard errors: robust
#> Small sample correction: FALSE
#> Convergence: Successful
#> --------------------------------------------------------------------------------
#> Final Quasi-Maximum Likelihood estimates
#> --------------------------------------------------------------------------------
#> Coefficient Robust Std.Err. z value [95% Conf. Interval] Pr(>|z|)
#> Constant 9.316e-01 8.408e-02 1.108e+01 7.668e-01 1.096 < 2e-16
#> mrate 9.531e-01 1.371e-01 6.951e+00 6.843e-01 1.222 3.62e-12
#> age 2.791e-02 4.877e-03 5.723e+00 1.835e-02 0.037 1.05e-08
#> totemp -8.182e-06 3.061e-06 -2.673e+00 -1.418e-05 0.000 0.00751
#> sole 3.405e-01 8.066e-02 4.222e+00 1.824e-01 0.499 2.43e-05
#>
#> Constant ***
#> mrate ***
#> age ***
#> totemp **
#> sole ***
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#> --------------------------------------------------------------------------------
#> Run Date: 2026-07-06 15:19:35
#> --------------------------------------------------------------------------------
#>
fracreg.ggoff(m)
#>
#> --------------------------------------------------------------------------------
#> GGOFF test
#> --------------------------------------------------------------------------------
#> H0: Fractional logit regression
#> --------------------------------------------------------------------------------
#> Statistic p-value
#> GOFF1 - LM 8.838 0.00295 **
#> GOFF2 - LM 9.828 0.00172 **
#> GGOFF - LM 10.351 0.00565 **
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#> --------------------------------------------------------------------------------
#> Run Date: 2026-07-06 15:19:35
#> --------------------------------------------------------------------------------
### Simulated Examples
N <- 250
u <- rnorm(N)
X <- cbind(rnorm(N),rnorm(N))
dimnames(X)[[2]] <- c("X1","X2")
ym <- exp(X[,1]+X[,2]+u)/(1+exp(X[,1]+X[,2]+u))
y <- rbeta(N,ym*20,20*(1-ym))
y[y > 0.9] <- 1
#Testing the logit specification of a standard fractional response model
#using LM and Wald versions of the GGOFF test, based on 1 or 2 fitted powers of
#the linear predictor
res <- fracreg(y,X,linkfrac="logit",table=FALSE)
fracreg.ggoff(res,c("Wald","LM"))
#>
#> --------------------------------------------------------------------------------
#> GGOFF test
#> --------------------------------------------------------------------------------
#> H0: Fractional logit regression
#> --------------------------------------------------------------------------------
#> Statistic p-value
#> GOFF1 - LM 0.119 0.7302
#> GOFF1 - Wald 0.119 0.7306
#> GOFF2 - LM 0.083 0.7732
#> GOFF2 - Wald 0.083 0.7739
#> GGOFF - LM 6.307 0.0427 *
#> GGOFF - Wald 5.519 0.0633 .
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#> --------------------------------------------------------------------------------
#> Run Date: 2026-07-06 15:19:35
#> --------------------------------------------------------------------------------
#Testing the probit specification of the binary component of a two-part fractional
#regression model using a LR-based GGOFF test
res <- fracreg(y,X,linkbin="probit",type="2Pbin",inf=1,table=FALSE)
fracreg.ggoff(res,"LR")
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#>
#> --------------------------------------------------------------------------------
#> GGOFF test
#> --------------------------------------------------------------------------------
#> H0: Binary probit component of a two-part regression
#> --------------------------------------------------------------------------------
#> Statistic p-value
#> GOFF1 - LR 0.002 0.966
#> GOFF2 - LR 0.038 0.845
#> GGOFF - LR 0.733 0.693
#> --------------------------------------------------------------------------------
#> Run Date: 2026-07-06 15:19:35
#> --------------------------------------------------------------------------------