par.gof {PLRModels} | R Documentation |
Goodness-of-Fit tests in linear regression models
Description
This routine tests the equality of the vector of coefficients, \beta
, in a linear regression model and a given parameter vector, \beta_0
, from a sample {(Y_i, X_{i1},...,X_{ip}): i=1,...,n}
, where:
\beta = (\beta_1,...,\beta_p)
is an unknown vector parameter and
Y_i = X_{i1}*\beta_1+ ... + X_{ip}*\beta_p + \epsilon_i.
The random errors, \epsilon_i
, are allowed to be time series. The test statistic used for testing the null hypothesis, H0: \beta = \beta_0
, derives from the asymptotic normality of the ordinary least squares estimator of \beta
, this result giving a \chi^2
-test.
Usage
par.gof(data = data, beta0 = NULL, time.series = FALSE,
Var.Cov.eps = NULL, p.max = 3, q.max = 3, ic = "BIC",
num.lb = 10, alpha = 0.05)
Arguments
data |
|
beta0 |
the considered parameter vector in the null hypothesis. If |
time.series |
it denotes whether the data are independent (FALSE) or if data is a time series (TRUE). The default is FALSE. |
Var.Cov.eps |
|
p.max |
if |
q.max |
if |
ic |
if |
num.lb |
if |
alpha |
if |
Details
If Var.Cov.eps=NULL
and the routine is not able to suggest an approximation for Var.Cov.eps
, it warns the user with a message saying that the model could be not appropriate and then it shows the results. In order to construct Var.Cov.eps
, the procedure suggested in Domowitz (1982) can be followed.
The implemented procedure particularizes the parametric test in the routine plrm.gof
to the case where is known that the nonparametric component in the corresponding PLR model is null.
Value
A list with a dataframe containing:
Q.beta |
value of the test statistic. |
p.value |
p-value of the corresponding statistic test. |
Moreover, if data
is a time series and Var.Cov.eps
is not especified:
pv.Box.test |
p-values of the Ljung-Box test for the model fitted to the residuals. |
pv.t.test |
p-values of the t.test for the model fitted to the residuals. |
ar.ma |
ARMA orders for the model fitted to the residuals. |
Author(s)
German Aneiros Perez ganeiros@udc.es
Ana Lopez Cheda ana.lopez.cheda@udc.es
References
Domowitz, J. (1982) The linear model with stochastic regressors and heteroscedastic dependent errors. Discussion paper No 543, Center for Mathematical studies in Economic and Management Science, Northwestern University, Evanston, Illinois.
Judge, G.G., Griffiths, W.E., Carter Hill, R., Lutkepohl, H. and Lee, T-C. (1980) The Theory and Practice of Econometrics. Wiley.
Seber, G.A.F. (1977) Linear Regression Analysis. Wiley.
See Also
Other related functions are np.gof
and plrm.gof
.
Examples
# EXAMPLE 1: REAL DATA
data(barnacles1)
data <- as.matrix(barnacles1)
data <- diff(data, 12)
data <- cbind(data[,1],1,data[,-1])
## Example 1.1: false null hypothesis
par.gof(data)
## Example 1.2: true null hypothesis
par.gof(data, beta0=c(0,0.15,0.4))
# EXAMPLE 2: SIMULATED DATA
## Example 2a: dependent data
set.seed(1234)
# We generate the data
n <- 100
beta <- c(0.05, 0.01)
x <- matrix(rnorm(200,0,1), nrow=n)
sum <- x%*%beta
epsilon <- arima.sim(list(order = c(1,0,0), ar=0.7), sd = 0.01, n = n)
y <- sum + epsilon
data <- cbind(y,x)
## Example 2a.1: true null hypothesis
par.gof(data, beta0=c(0.05, 0.01))
## Example 2a.2: false null hypothesis
par.gof(data)