search for: medv

Displaying 20 results from an estimated 21 matches for "medv".

Did you mean: mdev
2010 Sep 20
2
how to seperate " "? or how to do regression on each variable when I have multiple variables?
...-squared colnames(boston) [1] "CRIM" "ZN" "INDUS" "CHAS" "NOX" "RM" "AGE" [8] "DIS" "RAD" "TAX" "PTRATIO" "B" "LSTAT" "MEDV" name <- colnames(boston) r <- rep(0, 13) for(i in 1: 13) { r[i] <- summary(lm(MEDV ~ name[i], data = boston))$r.squared } but this doesn't work because name have " " for each variable. How to remove " " for name of each variable? Or do you know the way I...
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) Residuals 505 42716 85 > > step(x0.lm, ~ CRIM + ZN + RM) Start: AIC= 2246.51 MEDV ~ 1 Error in eval(expr, envir, enclos) : Object "MED...
2011 Nov 07
2
help with programming
...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 response variable Y is the median value of owner-occupied homes (MEDV) in each of the 506 census tracts in the Boston Standard Metropolitan Statistical Areas, and there are thirteen predictor variables.  We are interested in the relationship between MEDV and the other predictor variables. >  Setup your parametric model and use rank-based regression methodology...
2003 Mar 24
2
Problem with the step() function
...) 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 <- step(l) + } > model <- my.fun(Boston) Start: AIC= 1589.64 medv ~ crim + zn + indus + chas + nox + rm + age + dis + rad + tax + ptratio + black + lstat Df Sum of Sq RSS AIC - age 1 0.1 11078.8 1587.6 - indus 1...
2000 Nov 29
0
Re: [R] Step function (PR#753)
...t 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 Variance Table > > Response: MEDV > Df Sum Sq Mean Sq F value Pr(>F) > Residuals 505 42716 85 > > > > step(x0.lm, ~ CRIM + ZN + RM) > Start: AIC= 2246.51 > MEDV ~ 1...
2000 Dec 05
0
Re: [R] Step function (PR#760)
...t 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 Variance Table > > Response: MEDV > Df Sum Sq Mean Sq F value Pr(>F) > Residuals 505 42716 85 > > > > step(x0.lm, ~ CRIM + ZN + RM) > Start: AIC= 2246.51 > MEDV ~ 1...
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 modification of update.default (from R 1.7.0) that fixes the problem. Tom update.default <- function (object, formula., ..., evaluate = TR...
2005 Feb 25
0
Problem using stepAIC/addterm (MASS package)
...pired by the "Lexical scoping" section in the R FAQ (http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html#Lexical-scoping). --- data(BostonHousing, package = "mlbench") my.MC <- function (f, env) f # make closure pred.function <- function (learndata) { my.model <- lm(medv ~ ., learndata) if (!require("MASS")) stop("Package MASS not loadable.") my.model <- stepAIC(my.model, scope = list(lower = medv ~ 1, upper = medv ~ .)) my.MC(function(newdata) { predict(my.model, newdata) }, list(my.model...
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 Sep 18
1
caret package: arguments passed to the classification or regression routine
Hi, I am having problems passing arguments to method="gbm" using the train() function. I would like to train gbm using the laplace distribution or the quantile distribution. here is the code I used and the error: gbm.test <- train(x.enet, y.matrix[,7], method="gbm", distribution=list(name="quantile",alpha=0.5), verbose=FALSE,
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
2012 Mar 05
1
Forward stepwise regression using lmStepAIC in Caret
I'm looking for guidance on how to implement forward stepwise regression using lmStepAIC in Caret. The stepwise "direction" appears to default to "backward". When I try to use "scope" to provide a lower and upper model, Caret still seems to default to "backward". Any thoughts on how I can make this work? Here is what I tried: itemonly <-
2010 Oct 31
2
Constrained Regression
Hello everyone, I have 3 variables Y, X1 and X2. Each variables lies between 0 and 1. I want to do a constrained regression such that a>0 and (1-a) >0 for the model: Y = a*X1 + (1-a)*X2 I tried the help on the constrained regression in R but I concede that it was not helpful. Any help is greatly appreciated -- Thanks, Jim. [[alternative HTML version deleted]]
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>
2016 Jul 08
3
llvm 3.8.1 Release
Hello Tom, Tom Stellard via llvm-dev <llvm-dev <at> lists.llvm.org> writes: > > Hi, > > I'm working on uploading all the packages now. I've downloaded them files several times from different locations (suspected my webgw might muck with the content) using different clients and the result is the same: $ gpg --verify ~/Downloads/cfe-3.8.1.src.tar.xz.sig
2005 Jan 27
0
how to evaluate the significance of attributes in tree gr owing
...lit[, "improve"] imp <- tapply(dev[, 2] * improve, dev$var, sum)[-1] if (any(is.na(imp))) imp[is.na(imp)] <- 0 imp } Here's an example using the Boston housing data: > library(rpart) > data(Boston, package="MASS") > boston.rp <- rpart(medv ~ ., Boston, control=rpart.control(maxsurrogate=0, maxcompete=0)) > varimp.rpart(boston.rp) crim zn indus chas nox rm age dis 1136.809 0.000 0.000 0.000 0.000 23825.922 0.000 1544.804 rad tax ptratio black lstat...
2011 Apr 27
0
Rule-based regression models: Cubist
...st changes can be extended. That said, we'd appreciate help if anyone wants to contribute. Here is an example cubist session: library(mlbench) data(BostonHousing) ## 1 committee and no instance-based correction, so just an M5 fit: mod1 <- cubist(x = BostonHousing[, -14], y = BostonHousing$medv) summary(mod1) ## example output: ## Cubist [Release 2.07 GPL Edition] Sun Apr 10 17:36:56 2011 ## --------------------------------- ## ## Target attribute `outcome' ## ## Read 506 cases (14 attributes) from undefined.data ## ## Model: ## ## Rule 1: [101 cases, mean 13.84, range 5...
2011 Apr 27
0
Rule-based regression models: Cubist
...st changes can be extended. That said, we'd appreciate help if anyone wants to contribute. Here is an example cubist session: library(mlbench) data(BostonHousing) ## 1 committee and no instance-based correction, so just an M5 fit: mod1 <- cubist(x = BostonHousing[, -14], y = BostonHousing$medv) summary(mod1) ## example output: ## Cubist [Release 2.07 GPL Edition] Sun Apr 10 17:36:56 2011 ## --------------------------------- ## ## Target attribute `outcome' ## ## Read 506 cases (14 attributes) from undefined.data ## ## Model: ## ## Rule 1: [101 cases, mean 13.84, range 5...
2009 Jul 09
2
Dovecot fails to deliver big messages
...edora release 11 (Leonidas) ext4 protocols: imap pop3 listen: * ssl: no login_dir: /var/run/dovecot/login login_executable(default): /usr/libexec/dovecot/imap-login login_executable(imap): /usr/libexec/dovecot/imap-login login_executable(pop3): /usr/libexec/dovecot/pop3-login login_greeting: PREVED MEDVED first_valid_uid: 8 last_valid_uid: 8 first_valid_gid: 12 last_valid_gid: 12 mail_location: maildir:/home/email/%d/%n mail_debug: yes mail_executable(default): /usr/libexec/dovecot/imap mail_executable(imap): /usr/libexec/dovecot/imap mail_executable(pop3): /usr/libexec/dovecot/pop3 mail_plugin_di...
2009 Nov 17
2
SVM Param Tuning with using SNOW package
Hello, Is the first time I am using SNOW package and I am trying to tune the cost parameter for a linear SVM, where the cost (variable cost1) takes 10 values between 0.5 and 30. I have a large dataset and a pc which is not very powerful, so I need to tune the parameters using both CPUs of the pc. Somehow I cannot manage to do it. It seems that both CPUs are fitting the model for the same values