anovarIntReg {intRegGOF} | R Documentation |
Integrated Regression Goodness of Fit
Description
Integrated Regression Goodness of Fit to test the adequacy of different model to represent the regression function for a given data.
Usage
anovarIntReg(objH0, ..., covars = NULL, B = 499,
LINMOD = FALSE, INCREMENTAL = FALSE)
## S3 method for class 'anovarIntReg'
print(x,...)
Arguments
objH0 |
An object of class |
.
... |
|
covars |
Names of continuous (numerical) variates used to
compute Integrated Regression. They should be variables contained
in the data frame used to compute the regression fit. When NULL it
is obtained as the max. number of different covariates in all tested
models. It also can be a |
B |
Bootstrap resampling size. |
LINMOD |
When |
INCREMENTAL |
When is |
x |
An object of class |
Details
This function implements the test
for two different models ,
using the
Integrated Regression Goodness of Fit as os done in
intRegGOF
,
but instead of the accumulation of the residual of a givem model, in
this case, the accumuation of the difference in the fits is considered:
The test statistics considered are $K_n$ and $W^2_n$.
If objH0
and objH1
are lm
, glm
or nls
fits for the models in classes and
respectively, then
anovarIntReg(objH0,objH1)
computes
test vs
. When
anovarIntReg(objH0,objH1,...,objHk)
is executed (notice
that by default INCREMENTAL=FALSE
) we obtain a table with
the statistics and
and its associated
-values for each of the tests
vs
being
. On the other hand,
if the parameter
INCREMENTAL
is set to TRUE
, the
command returns the results for the tests vs
being
.
Value
This function returns an object of class anovarIntReg
, a
matrix like structure
whose rows refers to models and
columns to statistics and its -values. It also has
an attribute
heading
to support printing the object.
Note
This method requires more testing, and careful study of the effect of factors (discrete random variables) when fitting the model.
Author(s)
Jorge Luis Ojeda Cabrera (jojeda@unizar.es).
See Also
Examples
n <- 50
d <- data.frame( X1=runif(n),X2=runif(n))
d$Y <- 1 - 2*d$X1 - 5*d$X2 + rnorm(n,sd=.125)
a0 <- lm(Y~1,d)
a1 <- lm(Y~X1,d)
a2 <- lm(Y~X1+X2,d)
anovarIntReg(a0,a1,a2,B=50)
anovarIntReg(a0,a1,a2,B=50,INCREMENTAL=TRUE)