Displaying 20 results from an estimated 22 matches for "crim".
Did you mean:
cram
2010 Feb 25
2
error using pvcm() 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 + 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 + ch...
2003 Mar 24
2
Problem with the step() function
...y 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 2.5 11081.3 1587.8
<none> 11078.8 1589.6
- chas 1 219.0 11297.8 1597.5
- tax...
2011 Apr 27
0
Rule-based regression models: Cubist
...##
## 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 - 5.2 nox + 0....
2011 Apr 27
0
Rule-based regression models: Cubist
...##
## 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 - 5.2 nox + 0....
2004 Jun 28
2
PRNG is not seeded
...sh software that I received
from www.sunfreeware.com
I following the installation instruction see attachment but when I get to
ssh-keygen -t rsa1 -f /usr/local/etc/ssh_host_key -N ""
I get a PRNG is not seeded could you help me in this matter. Thank you for
your cooperation.
Spencer Crim
2003 Jun 18
3
update.default bugfix (PR#3288)
..., "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 = TRUE)
{
call <- object$call
if (is.null(call))
stop("need an object with call com...
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>
Date: Fri, July 29, 2011 7:54 am
To: <[2]mark at statcour...
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" "TAX" "PTRATIO" "B" "LSTAT" "MEDV"
name <- colnames(boston)
r...
2003 Dec 01
2
Re: Asterisk European Tour: was RE: * Party in Paris
...t
> and GPL preamble on back) which no amount of effort has managed to find a
> replacement for and it's *that* part i've never really gotten over.
> Mark
Well the Aussie's recently announced an additional travel warning for The Netherlands due to the increased level of petty crime although I feel it was a little extreme. The petty crime problem is very much specific to Amsterdam and foreign crims come into the city specifically to target tourists and their valuables.
I've lived out here for 3 years now and enjoy exceptional safety where I live in Haarlem so perhaps an...
2000 Nov 29
1
Step function
...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 "MEDV" not found
>
I am not clear as to why the MEDV object ( the variable I am trying to predict) is not found. I receive an identical message using the command > step(x0.lm).
I am using R...
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
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 Goslee <sarah.goslee at gmail.com>
Date:...
2004 Nov 18
1
Method dispatch S3/S4 through optimize()
...by name before the setMethod().
When called from within functions passed as the f= argument 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 cl...
2005 Jan 27
0
how to evaluate the significance of attributes in tree gr owing
...mp)))
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
0.000 0.000 0.000 0.000 7988.955
Both gbm and randomForest has analogous measures....
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))
2003 Dec 02
0
Re: Asterisk European Tour: was RE: * Party in Paris
...:00 PM
To: asterisk-users@lists.digium.com
Subject: RE: [Asterisk-Users] Re: Asterisk European Tour: was RE: *
Party in Paris
At 16:46 1-12-2003 +0100, you wrote:
>Well the Aussie's recently announced an additional travel warning for The
>Netherlands due to the increased level of petty crime although I feel it
>was a little extreme. The petty crime problem is very much specific to
>Amsterdam and foreign crims come into the city specifically to target
>tourists and their valuables.
>
>I've lived out here for 3 years now and enjoy exceptional safety where I
>li...
2000 Nov 29
0
Re: [R] Step function (PR#753)
...d 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 "MEDV" not found
> >
>
> I am not clear as to why the MEDV object ( the variable I am trying to
> predict) is not found. I receive an identical message using the
&...
2000 Dec 05
0
Re: [R] Step function (PR#760)
...d 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 "MEDV" not found
> >
>
> I am not clear as to why the MEDV object ( the variable I am trying to
> predict) is not found. I receive an identical message using the
&...
2011 Aug 09
1
lavaan: how to analyse residuals of a latent variable
Hi r-help,
I use lavaan:sem() for structural equation modelling with latent
variables. Below is a reproducible example (the code requires a
working installation of lavaan) where the latent variable criminality
is in focus. Besides criminality in general, I am specifically
interested one of the manifest variables that make up the latent
variable criminality, namely fire.setting.
My question is: how can I analyse the part of the variation in
fire.setting that is not included in the latent variable...
2006 Jul 18
1
Reproducible Research - Examples
All,
Recently I ran across a URL documenting published research using R:
http://www.cgd.ucar.edu/ccr/ammann/millennium/CODES_MBH.html
A note on the site indicates that the code is being revised. The code and
data are provided, so that one could reproduce the results without having to
buy a proprietary software program. In poking around the R website it is
clear that a lot of thought has gone