similar to: how to seperate " "? or how to do regression on each variable when I have multiple variables?

Displaying 20 results from an estimated 1000 matches similar to: "how to seperate " "? or how to do regression on each variable when I have multiple variables?"

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 Feb 25
2
error using pvcm() on unbalanced panel data
Dear all I am trying to fit Variable Coefficients Models on Unbalanced Panel Data. I managed to fit such models on balanced panel data (the example from the "plm" vignette), but I failed to do so on my real, unbalanced panel data. I can reproduce the error on a modified example from the vignette: > require(plm) > data("Hedonic") > Hed <- pvcm(mv ~ crim + zn + indus
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>
2003 Jun 17
1
User-defined functions in rpart
This question concerns rpart's facility for user-defined functions that accomplish splitting. I was interested in modifying the code so that in each terminal node, a linear regression is fit to the data. It seems that from the allowable inputs in the user-defined functions, that this may not be possible, since they have the form: function(y, wt, parms) (in the case of the
2008 Mar 03
2
Constrained regression
Dear list members, I am trying to get information on how to fit a linear regression with constrained parameters. Specifically, I have 8 predictors , their coeffiecients should all be non-negative and add up to 1. I understand it is a quadratic programming problem but I have no experience in the subject. I searched the archives but the results were inconclusive. Could someone provide suggestions
2004 Nov 18
1
Method dispatch S3/S4 through optimize()
I have been running into difficulties with dispatching on an S4 class defined in the SparseM package, when the method calls are inside a function passed as the f= argument to optimize() in functions in the spdep package. The S4 methods are typically defined as: setMethod("det","matrix.csr", function(x, ...) det(chol(x))^2) that is within setMethod() rather than by name before
2009 Jul 06
1
mlbench dataset question
Dear R-users, Recently, I am facing some problems when converting mlbench data into matrix format. library(mlbench) data(BostonHousing) X<- BostonHousing[,1:13] y<-BostonHousing[,14] I want to convert X and y into matrix form. I am getting these obvious errors... > t(X)%*%y Error in t(X) %*% y : requires numeric/complex matrix/vector arguments > t(as.matrix(X))%*%(as.matrix(y))
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
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>",
2011 Jul 29
1
help with predict.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) predict(fit,data[4,]) plot only reveals part of the tree in contrast to the results on obtains with CART or C5 -------- Original Message -------- Subject: Re: [R] help with rpart From: Sarah
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 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
2011 Apr 14
2
How to see a R code from a package?
Dear R users, Hi. I want know R code of a function: predict.cv.glmnet (which is included in glmnet package). Could you let me know how I can see the R code of the function? Thank you, Soyeon Kim
2012 Dec 18
2
how to get a value from a list (using paste function)?
Dear my R friends, I want to get a number from a list using paste function. In my example, lambda.rule <- "lambda.1se" cvtest is a list (result from cv.glmnet) and cvtest$lambda.1se [1] 1.308973 I want to call the value using paste function. I used get function but there was an error. test <- get(paste("cvtest$",lambda.rule, sep="")) Error in
2010 Dec 13
2
How to change leaf color by group in hclust plot or how to install A2R package in windows?
I want to change leaf color by group in hclust plot. I've seen several answers about A2R package but I cannot install A2R and Rtools in windows. Do you know how to install A2R package in windows or how to change leaf color by group in hclust plot? Thank you in advance, Soyeon
2011 Apr 15
2
prediction error in ROCR package when sampled y consists of only one class
Dear R users, Hi. I am using prediction function in ROCR package. y consists of two classes 0 and 1. However, since I am using cross-validation, a sampled small number of y may consist of only one class >y [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 In this case, prediction function gives an error: Error in prediction(predic, y) : Number of classes is not equal to 2. ROCR currently supports
2011 Aug 10
2
Opposite of paste function
Dear All, I have vn variable > vn [1] "V300" "V376" What I want to get is 300 376 without V and "" from vn variable. Could you help me about this issue? Thank you, Soyeon [[alternative HTML version deleted]]
2011 Jun 09
4
set.seed and for loop
Dear All, This is hard to describe so I made a simple example. set.seed(1001) total <- 0 data <- vector("list", 30) for(i in 1:30) { data[[i]] <- runif(50) } Let's call a data set runif(50). While the for loop is running, 100 data sets are generated. I want to restore 23th data set (the data set generated in 23th for loop) without the loop. I've tried set.seed(1023)
2010 Nov 17
1
Multiple plots in one window
Dear All, I made a function which gives 3 plots in one window(I used par(mfrow=c(1,3)) in the function). Using that function 3 times, I want to produce 9 plots in one window. I tried par(mfrow=c(3,1)) or par(mfrow=c(3,3)) but it didn't work. For example, pf <- function(p) { par(mfrow=c(1,3)) plot(c(p:(p+10)),c(1:11)) plot(c(p:(p+10)),c(2:12)) plot(c(p:(p+10)),c(3:13)) } p <-