search for: ptratio

Displaying 11 results from an estimated 11 matches for "ptratio".

2010 Feb 25
2
error using pvcm() on unbalanced panel data
...ple 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 + chas + nox + rm + age + dis +rad + tax + ptratio + blacks + lstat, Hedonic, model = "within",index = "townid") Error in FUN(X[[1L]], ...) : insufficient number of observations > ##it fails for both FE and RE cases > Hed <- pvcm(mv ~ crim + zn + indus + chas + nox + rm + age + dis +rad + tax + ptratio + blacks + lstat,...
2011 Apr 27
0
Rule-based regression models: Cubist
...e `outcome' ## ## Read 506 cases (14 attributes) from undefined.data ## ## Model: ## ## Rule 1: [101 cases, mean 13.84, range 5 to 27.5, est err 1.98] ## ## if ## nox > 0.668 ## then ## outcome = -1.11 + 2.93 dis + 21.4 nox - 0.33 lstat + 0.008 b ## - 0.13 ptratio - 0.02 crim - 0.003 age + 0.1 rm ## ## Rule 2: [203 cases, mean 19.42, range 7 to 31, est err 2.10] ## ## if ## nox <= 0.668 ## lstat > 9.59 ## then ## outcome = 23.57 + 3.1 rm - 0.81 dis - 0.71 ptratio - 0.048 age ## - 0.15 lstat + 0.01 b - 0.0041 tax -...
2011 Apr 27
0
Rule-based regression models: Cubist
...e `outcome' ## ## Read 506 cases (14 attributes) from undefined.data ## ## Model: ## ## Rule 1: [101 cases, mean 13.84, range 5 to 27.5, est err 1.98] ## ## if ## nox > 0.668 ## then ## outcome = -1.11 + 2.93 dis + 21.4 nox - 0.33 lstat + 0.008 b ## - 0.13 ptratio - 0.02 crim - 0.003 age + 0.1 rm ## ## Rule 2: [203 cases, mean 19.42, range 7 to 31, est err 2.10] ## ## if ## nox <= 0.668 ## lstat > 9.59 ## then ## outcome = 23.57 + 3.1 rm - 0.81 dis - 0.71 ptratio - 0.048 age ## - 0.15 lstat + 0.01 b - 0.0041 tax -...
2003 Mar 24
2
Problem with the step() function
...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 2.5 11081.3 1587.8 <none> 11078.8 1589.6 - chas 1 219.0 11297.8 1597.5 - tax 1 242.3 11321.0 1598.6 - crim 1 243.2 11322.0 1598.6 -...
2010 Sep 20
2
how to seperate " "? or how to do regression on each variable when I have multiple variables?
...3 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" "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 " &...
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
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>
2004 Nov 18
1
Method dispatch S3/S4 through optimize()
...gument to optimize, the S3 generics for det() and chol() get picked up, not the S4 generics for the S4 SparseM classes. This looks for instance like (from example(boston)): > gp2 <- lagsarlm(log(CMEDV) ~ CRIM + ZN + INDUS + CHAS + I(NOX^2) + I(RM^2) + + AGE + log(DIS) + log(RAD) + TAX + PTRATIO + B + log(LSTAT), + data=boston.c, nb2listw(boston.soi), method="SparseM") matrix.csr Error in chol(tmp1) : non-numeric argument to chol (this is the error message in chol.R in base). tmp1 is of class "matrix.csr", but is being sent to the S3 class (error in function sar.lag...
2005 Jan 27
0
how to evaluate the significance of attributes in tree gr owing
...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 0.000 0.000 0.000 0.000 7988.955 Both gbm and randomForest has analogous measures. Andy > From: WeiWei Shi > > Hi, there: > > I am wondering if there is a package in R (doing decison trees) which > can provide some methods to evaluate t...
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))
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