add1.speedlm | R Documentation |
add1
and drop1
methods for speedlm and speedglm objectsThese are adviced to be used for speedlm
and speedglm
models fitted on moderately large data sets. It is also possible to use stepAIC function from package MASS
.
## S3 method for class 'speedlm'
## S3 method for class 'speedlm'
add1(object, scope, scale = 0, test = c("none", "Chisq","F"),
x = NULL, k = 2, data, ...)
## S3 method for class 'speedlm'
drop1(object, scope, scale = 0, all.cols = TRUE,
test = c("none","Chisq", "F"), k = 2, data, ...)
## S3 method for class 'speedlm'
extractAIC(fit, scale = 0, k=2,...)
## S3 method for class 'speedlm'
nobs(object, use.fallback = FALSE, ...)
## S3 method for class 'speedglm'
## S3 method for class 'speedglm'
add1(object, scope, scale = 0, test = c("none", "LRT",
"Chisq", "F"), x = NULL, k = 2, ...)
## S3 method for class 'speedglm'
drop1(object, scope, scale = 0, test = c("none", "LRT",
"Chisq", "F"), k = 2, ...)
## S3 method for class 'speedglm'
extractAIC(fit, scale = 0, k=2,...)
## S3 method for class 'speedglm'
nobs(object, use.fallback = FALSE, ...)
object |
a |
fit |
a |
scope |
see add1 from package |
scale |
see add1 from package |
all.cols |
see drop1 from package |
test |
see add1 from package |
x |
see add1 from package |
k |
see add1 from package |
data |
the data that the model was previously fitted to. If not provided, these will be searched in the parent environment. |
use.fallback |
logical. Should fallback methods be used to try to guess the value? |
... |
further optional arguments. |
It is possible to use functions step() and stepAIC() for both speedlm and speedglm objects but objects fitted using updateWithMoreData().
An object of classes "anova
" and "data.frame
" summarizing the differences in fit between the models.
Note that these functions have been poorly tested and need to be checked out more carefully.
Ronen Meiri and Marco Enea
set.seed(10)
n <- 50
k <- 3
x <- round(matrix(rnorm(n * k), n, k), digits = 3)
beta <- c(0.05,0.5,0.8,1.3,1.8)
y <- drop(tcrossprod(cbind(1,x,x[,2]*x[,3]),t(beta))) + rnorm(n,,0.2)
colnames(x) <- c("s1", "s2", "s3")
da <- data.frame(y, x)
m0 <- speedlm(y ~ 1, data = da,model=TRUE, y=TRUE)
m0.1 <- add1(m0,scope=~s1+s2+s3, data = da)
m1 <- step(m0,scope=~s1+s2+s3)
m1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.