% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fracreg.reset.R
\name{fracreg.reset}
\alias{fracreg.reset}
\title{RESET Test for Fractional Response Regressions}
\usage{
fracreg.reset(object, lastpower.vec = 3, version = "LM", table = FALSE, ...)
}
\arguments{
\item{object}{an object containing the results of an \code{fracreg} command.}

\item{lastpower.vec}{a numeric vector containing the maximum powers of the linear predictors to be used in RESET tests.}

\item{version}{a vector containing the test versions to use. Available options: \code{Wald}, \code{LM} (the default) and, only for the binary component of two-part models, \code{LR}. More than one option may be chosen.}

\item{table}{a logical value indicating whether a summary table with the test results should be printed.}

\item{\dots}{Arguments to pass to \link[stats]{glm}, which is used to estimate the model under the alternative hypothesis when \code{version} is a vector containing \code{"Wald"} or \code{"LR"}.}
}
\value{
\code{fracreg.reset} returns a named vector with the test results.
}
\description{
\code{fracreg.reset} is used to perform the Regression Equation Specification Error Test (RESET) to check the functional form and specification of fractional response models.
}
\details{
\code{fracreg.reset} applies the RESET test statistic to fractional response
models estimated via \code{fracreg}. \code{fracreg.reset} may be used to test the link specification of: (i) one-part fractional response models; (ii) the binary
components of two-part and three-part fractional response models; and (iii) the fractional components of two-part and three-part fractional response models. 

\strong{RESET Test Framework:}
The Regression Equation Specification Error Test (RESET) assesses whether the link function \eqn{G(\cdot)} and the linear index \eqn{x\beta} are correctly specified. It tests the null hypothesis \eqn{H_0: \gamma = 0} in the augmented model:
\deqn{E(y|x) = G(x\beta + \sum_{k=2}^P \gamma_k (x\hat{\beta})^k)}
where \eqn{P} is the maximum power of the linear predictor (specified by \code{lastpower.vec}) and \eqn{\hat{\beta}} are the estimated parameters from the baseline model.

When the \code{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 \code{LM} version, a robust version is computed in cases (i) and (iii) and a conventional version in case (ii). See Ramalho, Ramalho and Murteira (2011) for details on the application of the RESET test in the fractional response framework.
}
\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")
reset_res <- fracreg.reset(m)
summary(reset_res)

### 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 RESET test, based on 1 or 2 fitted powers of
#the linear predictor
mod <- fracreg(y,X,linkfrac="logit")
reset_res <- fracreg.reset(mod,2:3,c("Wald","LM"))
summary(reset_res)

#Testing the probit specification of the binary component of a two-part fractional
#regression model using LR-based RESET tests with quadratic and cubic fitted 
#powers of the linear predictor
mod <- fracreg(y,X,linkbin="probit",type="2Pbin",inf=1)
reset_res <- fracreg.reset(mod,3,"LR")
summary(reset_res)
}
\references{
Ramalho, E.A., J.J.S. Ramalho and J.M.R. Murteira (2011), "Alternative
estimating and testing empirical strategies for fractional response models",
\emph{Journal of Economic Surveys}, 25(1), 19-68.

Ramsey, J.B. (1969), "Tests for Specification Errors in Classical Linear Least-Squares Regression Analysis", \emph{Journal of the Royal Statistical Society: Series B (Methodological)}, 31(2), 350-371.
}
\seealso{
\code{\link{fracreg}}, for fitting fractional response models.\cr
\code{\link{fracreg.ggoff}}, for asymptotically equivalent specification tests.\cr
\code{\link{fracreg.ptest}}, for non-nested hypothesis tests.\cr
\code{\link{fracreg.pe}}, for computing partial effects.
}
\author{
Sulman Olieko Owili <oliekosulman@gmail.com>
}
