Displaying 20 results from an estimated 3000 matches similar to: "Re: [R] Step function (PR#753)"
2000 Dec 05
0
Re: [R] Step function (PR#760)
On Wed, 29 Nov 2000, Matt Pocernich wrote:
> I am having problem using the step function for a linear regression model. I've created an initial model containing only the intercept. Then using the step function, I've selected three variables to be considered for the model.
>
>
> > x0.lm<- lm(MEDV~1, data = x)
> >
> > anova(x0.lm)
> Analysis of
2000 Nov 29
1
Step function
I am having problem using the step function for a linear regression model. I've created an initial model containing only the intercept. Then using the step function, I've selected three variables to be considered for the model.
> x0.lm<- lm(MEDV~1, data = x)
>
> anova(x0.lm)
Analysis of Variance Table
Response: MEDV
Df Sum Sq Mean Sq F value Pr(>F)
2003 Mar 24
2
Problem with the step() function
Dear all,
I'm having some problems with using the step() function inside another
function. I think it is an environment problem but I do not know how to
overcome it. Any suggestions are appreciated.
I've prepared a simple example to illustrate my problem:
> library(MASS)
> data(Boston)
> my.fun <- function(dataset) {
+ l <- lm(medv ~ .,data=dataset)
+ final.l <-
2010 Sep 20
2
how to seperate " "? or how to do regression on each variable when I have multiple variables?
Dear All,
I have data which contains 14 variables. And I have to regress one of
variables on each variable (simple 13 linear regressions)
I try to make a loop and store only R-squared
colnames(boston)
[1] "CRIM" "ZN" "INDUS" "CHAS" "NOX" "RM" "AGE"
[8] "DIS" "RAD"
2011 Apr 27
0
Rule-based regression models: Cubist
Cubist is a rule-based machine learning model for regression. Parts of the
Cubist model are described in:
Quinlan. Learning with continuous classes. Proceedings
of the 5th Australian Joint Conference On Artificial
Intelligence (1992) pp. 343-348
Quinlan. Combining instance-based and model-based
learning. Proceedings of the Tenth International Conference
on Machine Learning
2011 Apr 27
0
Rule-based regression models: Cubist
Cubist is a rule-based machine learning model for regression. Parts of the
Cubist model are described in:
Quinlan. Learning with continuous classes. Proceedings
of the 5th Australian Joint Conference On Artificial
Intelligence (1992) pp. 343-348
Quinlan. Combining instance-based and model-based
learning. Proceedings of the Tenth International Conference
on Machine Learning
2003 Jun 18
3
update.default bugfix (PR#3288)
According to the man page for formula, "a formula object has an associated
environment". However, update.default doesn't use this environment, which
creates problems like the following:
make.model <- function(x) { lm(medv~.,x) }
library(MASS)
data(Boston)
fit = make.model(Boston)
fit = update(fit,".~.-crim")
# Object "x" not found
Here is a
2005 Jan 27
0
how to evaluate the significance of attributes in tree gr owing
FWIW, I wrote a little function to extract variable importance as defined in
the CART book a while ago. It's rather limited: Only works for regression
problem, and you need to set maxsurrogate=0 and maxcompete=0. It may (or
may not) help you:
varimp.rpart <- function(x) {
dev <- x$frame[, c("var", "dev")]
dev <- dev[dev$var != "<leaf>",
2008 May 14
0
Problems with step function
Dear List Members,
I have encountered two problems when using the step function to
select models. To better illustrate the problems, an R image
(step.add1.test.RData)
which includes the objects needed to run the code (step.add1.test.R) can be
found at
www.biostat.wisc.edu/~pwang/r-help/<http://www.biostat.wisc.edu/%7Epwang/r-help/>
lm.data.frame have factor variables with 3 levels.
The
2008 May 13
1
R help: problems with step function
Dear List Members,
I have encountered two problems when using the step function to
select models. To better illustrate the problems, attached is an
R image which includes the objects needed to run the code attached.
lm.data.frame have factor variables with 3 levels.
The following run shows the first problem. AICs (* and **) are different.
I noticed that the Df for rs13482096:rs13483699 is 4,
2011 Jul 29
3
help with plot.rpart
? data=read.table("http://statcourse.com/research/boston.csv", , sep=",",
header = TRUE)
? library(rpart)
? fit=rpart (MV~ CRIM+ZN+INDUS+CHAS+NOX+RM+AGE+DIS+RAD+TAX+ PT+B+LSTAT)
Please: Show me the tree.
Mark
-------- Original Message --------
Subject: Re: [R] help with rpart
From: "Stephen Milborrow" <[1]milbo at sonic.net>
2000 Nov 14
2
atlas for R1.1.1 and R1.2 different?
Dear R'ers,
when I e.g. install the integrate2.2-2 package under R1.1.1 (debian2.2)
atlas is linked into the library:
Installing package `integrate' ...
libs
gcc -shared -lc -shared -o
/usr/lib/R/library/integrate/libs/integrate.so adapt.o adapt_callback.o
bsrl.o flfm.o nxprt.o symrl.o wht.o -L/usr/local/lib -lf77blas -lcblas
-latlas -lg2c -lm -L/usr/lib/gcc-lib/i386-linux/2.95.2
2010 Sep 22
1
Newey West and Singular Matrix
dear R experts: ?I am writing my own little newey-west standard error
function, with heteroskedasticity and arbitrary x period
autocorrelation corrections. ?including my function in this post here
may help others searching for something similar. it is working quite
well, except on occasion, it complains that
Error in solve.default(crossprod(x.na.omitted, x.na.omitted)) :
system is
2010 Sep 23
1
Newey West and Singular Matrix + library(sandwich)
thank you, achim. I will try chol2inv.
sandwich is a very nice package, but let me make some short
suggestions. I am not a good econometrician, so I do not know what
prewhitening is, and the vignette did not explain it. "?coeftest" did
not work after I loaded the library. automatic bandwidth selection
can be a good thing, but is not always.
as to my own little function, I like the
2010 Feb 10
1
using step() with package geepack
I'm using the package geepack to fit GEE models.
Does anyone know of methods for add1 and drop1 for a 'geeglm' model object, or perhaps a method for extractAIC based on the QIC of Pan 2001? I see there has been some mention of this on R-help a few years ago (RSiteSearch("QIC")).
The package does provide an anova method for its model objects, and update() seems to work:
2005 May 09
1
question about k in step
>?step
....
'step' uses 'add1' and 'drop1' repeatedly; it will work for any
method for which they work, and that is determined by having a
valid method for 'extractAIC'. When the additive constant can be
chosen so that AIC is equal to Mallows' Cp, this is done and the
tables are labelled appropriately.
so my question is :what constant
2005 Feb 25
0
Problem using stepAIC/addterm (MASS package)
Hello,
I'm currently dealing with a rather strange problem when using the
function "stepAIC" ("MASS" package). The setting is the following: From
model learning data sets ("learndata"), I want to be able to build
prediction functions (in order to save them in a file for further use).
This is done by the function "pred.function" (see below). Therein,
2011 Nov 07
2
help with programming
>
>
Dear moderators,
Please help me encode the program instructed by follows.
Thank u!
Apply the methods introduced in Sections 4.2.1 and 4.2.2, say the
> rank-based variable selection and BIC criterions, to the Boston housing
> data.
>
The Boston housing data contains 506 observations, and is publicly
available in the R package mlbench (dataset “BostonHousing”).
The
2005 Aug 05
0
(PR#8049) add1.lm and add1.glm not handling weights and
David,
Thanks.
The reason add1.lm (and drop1.lm) do not support offsets is that lm did
not when they were written, and the person who added offsets to lm did not
change them. (I do wish they had not added an offset arg and just used the
formula as in S's glm.) That is easy to add.
For the other point, some care is needed if 'x' is supplied and the upper
scope reduces the number
2005 Aug 04
0
add1.lm and add1.glm not handling weights and offsets properly (PR#8049)
I am using R 2.1.1 under Mac OS 10.3.9.
Two related problems (see notes 1. and 2. below) are illustrated by
results of the following:
y <- rnorm(10)
x <- z <- 1:10
is.na(x[9]) <- TRUE
lm0 <- lm(y ~ 1)
lm1 <- lm(y ~ 1, weights = rep(1, 10))
add1(lm0, scope = ~ x) ## works ok
add1(lm1, scope = ~ x) ## error
lm2 <- lm(y ~ 1, offset = 1:10)
add1(lm0, scope = ~ z) ##