Displaying 20 results from an estimated 32 matches for "listw".
Did you mean:
list
2003 Nov 16
3
an object of class lm returned by lm?
...m means? I
assumed it mean the regression model - but I'm not sure how to enter
this in. I have tried
y~a+b
but this is not working. I have also tried saving the regression
results and entering these, but again this is incorrect.
This language is from the following:
lm.LMtests(model, listw, zero.policy=FALSE, test="LMerr", spChk=NULL)
Arguments
model - an object of class lm returned by lm
listw - a listw object created for example by nb2listw, expected to be
row-standardised (W-style)
Any help is welcomed. Thanks.
-Jill
***********************************************...
2003 Jun 30
2
spatial correlation test
hello,
I want to do a test for spatial correlation.
I tried it with geary.test() but I don't understand the required input.
x= a numeric vector the same length as the neighbours list in listw (my
sampled data, I assume)
listw= a listw object created for example by nb2listw (well when I check
nb2listw() I get to "neighbours - an object of class nb" - but I couldn't
figure out, what nb is or how I create such a class
with sp.mantel.mc {spdep} I have the same problem: lis...
2005 Feb 11
3
How to solve error : "cannot allocate vector of size 1208235 Kb"
...en I run R
I got the follwoing memory error.
My physical memory size is 3 Gb.
My R got the memory problem when it reached to
about 2 Gb.
Thanks in advance,
> library(spdep)
> sfr.lagsarlm <- lagsarlm(sfr.data$Bldgsqft ~ sfr.data$Ncounty + sfr.data$Nugb + sfr.data$Ngroup, data=sfr.data, listw=sfr.listw, method="eigen")
Error: cannot allocate vector of size 1208235 Kb
> memory.size(max=FALSE)
[1] 17862584
> memory.limit(size=NA)
[1] 3145728000
>
--
Kum-Hoe Hwang, Ph.D.
Kyonggi Research Institute, Korea (ROK)
(Urban Planning and GIS)
Phone : 82-31-250-3283
Email :...
2009 Jun 06
1
large numbers of observations using ME() of spdep
...lumns
coords<-coordinates(taimin.xy);
library(spdep);
TaiminGabrielGraph<-gabrielneigh(coords, nnmult = 12);
tai.gab.nb<-graph2nb(TaiminGabrielGraph,sym=TRUE);
nbtaim_distsg <- nbdists(tai.gab.nb, coords);
nbtaim_simsg <- lapply(nbtaim_distsg, function(x) (1-((x/(4*50))^2)) );
MEtaig.listw <- nb2listw(tai.gab.nb, glist=nbtaim_simsg, style="B");
sevmtaig <- ME(Presabs
~Age+Curv+Zon2005+ZoneMeiji+Wi+Sol+Slope+Seadist+Elev+Basin,data=taimin,
family=binomial,listw=MEtaig.listw)
Any help is welcome!
Thanks
Lucero Mariani, Yokohama National University, Japan.
2009 Oct 09
1
svy / weighted regression
...imple, but
I?m a R newbie. Code to illustrate my problem below.
Thanks
Laust
# loading survey
library(survey)
# creating data
listc <- c("Denmark","Finland","Norway","Sweden","Denmark","Finland","Norway","Sweden")
listw <- c(1,2,1,1,1,1,1,1)
listd <- c(0,0,0,0,1000,1000,1000,2000)
listt <- c(750000,500000,900000,1900000,5000,5000,5000,10000)
list.cwdt <- c(listc, listw, listd, listt)
country <- data.frame(country=listc,weight=listw,deaths=listd,yrs_at_risk=listt)
# running a frequency weighted regr...
2011 May 04
1
Instrumental variable quantile estimation of spatial autoregressive models
...ind attached a small sample of my data and matrix.
R codes:
library(foreign)
library(lmtest)
library(spdep)
library(quantreg)
data<-read.table("DataSample.txt",header=TRUE, sep="")
attach(data)
matrix<-read.gwt2nb("matrixsample.gwt" ,region.id=no_Trans)
matrix.listw<-nb2listw(matrix)
OLS model
OLS<-lm(lnprice~surface+d2007+LUX+tsect_ci, data=data)
summary(OLS)
SAR model
SAR<-lagsarlm(lnprice~surface+d2007+LUX+tsect_ci, data=data, listw = matrix.listw)
summary(SAR)
I hope that this information is sufficient and will help you to help me :)
Many than...
2007 Feb 06
2
How to do "moran's I test"?
I want to do "moran's I test" in R language. I try to use "gearymoran" in
Package "ade4","moran" in Package "spdep", and Moran.I in Package "ape". But
I do not know how to do it because data format is different.
My data:
x y dbh
111.03 10.7 7
118.11 0.28 1.2
165.36 0.36 8.4
2003 Jul 01
0
RE: question about spatial correlation with Xs and Ys
...z.ch
Subject: R-help Digest, Vol 5, Issue 1
At 18:48 30/06/2003, Martin Wegmann wrote:
>hello,
>
>I want to do a test for spatial correlation.
>I tried it with geary.test() but I don't understand the required input.
>x= a numeric vector the same length as the neighbours list in listw (my
>sampled data, I assume)
>listw= a listw object created for example by nb2listw (well when I check
>nb2listw() I get to "neighbours - an object of class nb" - but I couldn't
>figure out, what nb is or how I create such a class
>
>with sp.mantel.mc {spdep} I have...
2013 Apr 16
1
Spatial Ananlysis: zero.policy=TRUE doesn't work for no neighbour regions??
...6 1391 1416 1456 1478 1485 1545 1546 1548 1558
1612 1621 1663 1672 1675 1760 1794 1795 2924 2925 2952 3107 with 1 link
1 most connected region:
1385 with 14 links
*As there are some regions without neighbours in my data I use the following
code to create the Weights Matrix:*
> W_Matrix<- nb2listw(location_nbq, style="W", zero.policy=TRUE)
>W_Matrix
*And get this Output:*
Fehler in print.listw(list(style = "W", neighbours = list(c(23L, 31L, 42L :
regions with no neighbours found, use zero.policy=TRUE
/("Error in print.listw(list(style = "W", neighb...
2011 Feb 04
1
Error in solve.default(inf, tol = tol.solve) :
...system is computationally singular: reciprocal condition number = 4.20137e-12
I get the same message when I try to run de lagsarlm with a bigger data set (4333 regions).
The command I used:
TestLag<-lagsarlm( mean_price ~ transcount+ C1_5_1+ C1_5_2+ C1_5_3+ C1_5_4, data=DataB,transcecB.listw)
summary(transcecB.listw)
Characteristics of weights list object:
Neighbour list object:
Number of regions: 521
Number of nonzero links: 2904
Percentage nonzero weights: 1.069846
Average number of links: 5.573896
Link number distribution:
1 2 3 4 5 6 7 8 9 10 11 13...
2004 Nov 18
1
Method dispatch S3/S4 through optimize()
...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.mix.f.sM() in R/lag.spsarlm.R).
sar.lag.mi...
2008 Apr 18
1
spdep question - Moran's I
Dear all,
I would like to calculate a Moran's I statistic using the moran function in the spdep package. The problem I'm having deals with how to create the listw object.
My data stems from the area of social network analysis. I have list of poeple and for each pair of them I have a measure of their relationship strength. So my dataset looks like: Jim; Bob; 0.5
This measure of relationship strength can be interpreted like a distance measure in a spatial mo...
2008 Jul 14
0
Moran's I- Ordinal Logistic Regression
...0
0
1
1
0
0
0
0
1
1
0
1
1
0
0
0
0
1
1
0
0
0
1
1
1
1
0
0
0
0
0
1
1
1
1
0
0
0
0
0
1
1
1
1
0
0
0
0
0
1
1
1
1
0
0
0
1
1
0
0
0
0
1
1
0
0
1
0
0
0
0
1
1
I try to run the test as follows-
moran.test(order$resid, Y). It then gives me an error- "Error in moran.test(resid(order), y) : y is not a listw object"
Can I transform my matrix into a listw object or use some other test where I can use my simple matrix to perform the test? Also, is using $resid for the ordinal logistic regression the proper way to run the moran's I test?
Thanks for any help you can provide me.
Lisa
______...
2009 Feb 08
1
Help on computing Geary's C statistic to test for Spatial Autocorrelation
Dear Users:
I have been trying to use the geary.test() function in *R*, but am having
slight difficulty understanding how I am to apply it in my context.
I have 2 matrices:
1) *n x p* matrix of *n* observations with *p* measurements each. It may be
noted that this matrix has a spatial dimension to it, as the
*n*observations are at different geographical locations on a map.
2) *n x n* spatial
2012 Jul 12
0
How to handle NA-values in raster-based Geary´s C test?
...ces along the links in the neighbous list
dist <- nbdists(nb, coordinates(subset), longlat=TRUE)
# Converting the distances to inverse distance values
inv.dist <- lapply(dist, function (x) 1/(x*100))
# Supplementing the neighbors list with spatial weights for a coding scheme
nb.idw <- nb2listw(nb, glist=inv.dist, style="W")
summary(unlist(nb.idw$weights))
# Moran's test (two-sided)
moran.global <- moran.test(value, listw=nb.idw, zero.policy = TRUE,
na.action=na.pass, alternative="two.sided")
moran.global
# Geary's test (two-sided)
geary.global <- gea...
2007 Oct 15
1
Distance matrix in SpDep-package
Hello everybody,
I would like to use the SpDep-package (especially the Local Moran index
analysis and the Getis-Ord statistics) in R for analysing my data. However,
I don't have x-y coordinates, but my data is in a distance matrix format. Is
it possible to use the SpDep package with predefined distances as well
instead of letting the program determining the distance itself by the
function
2009 Jul 15
1
Simulation code error
...e(V, collapse="+")
+ V <- paste("SBA~", V)
+ rd <- round(nrow(data)*(2/3))
+ d <- sample(seq(1:nrow(data)),rd)
+ dat1 <- data[d,]
+ dat2 <- data[-d,]
+ crd <- cbind(dat1$Longitude,dat1$Latitude)
+ dist80 <- dnearneigh(crd,0,100,longlat=F)
+ dist80sw <- nb2listw(dist80, style="B")
+ fm <- errorsarlm(as.formula(V), data=dat1, listw=dist60sw)
+ pred <- predict(fm,dat2)
+ C[i,1] <- cor(dat2$SBA,pred)
+ out <- cbind(C)
+ }
+ colMeans(out)
+ }
>
> sim.sp(df2007.5k.s2,CM,1,1000)
Error in nb2listw(dist80, style = "B") : Empty...
2008 Oct 08
1
Error in spdep: system is computationally singular
...**I built an XY matrix extracting the two colums from matriz**
coords1<-matriz[matriz$casos1==1, c(4,5)]
coords1<-as.matrix(coords1)
**I identify neighbours of region points**
nb20<-dnearneigh(coords1,0,20,longlat=TRUE)
** I build a neighbours list with spatial weights**
nb20.w<-nb2listw(nb20, glist=NULL, style="W", zero.policy=TRUE)
**I run a glm**
glm1<-glm(matriz$sp~poly(matriz$iso,3)+poly(matriz$tmax,3)+poly(matriz$mdr,3)+poly(matriz$twq,3)+poly(matriz$tmin,3)+poly(matriz$pdq,3)+poly(matriz$trng,3),data=matriz, subset=matriz$casos1>0, family=binomial)
glm.scop...
2009 Jul 15
1
Error in simulation R-code
...ste("SBA~", V)
rd <- round(nrow(data)*(2/3))
d <- sample(seq(1:nrow(data)),rd)
dat1 <- data[d,]
dat2 <- data[-d,]
crd <- cbind(dat1$Longitude,dat1$Latitude)
dist60 <- dnearneigh(crd,0,60,longlat=F)
dist60sw <- nb2listw(dist60, style="B")
fm <- errorsarlm(as.formula(V), data=dat1, listw=dist60sw)
pred <- predict(fm,dat2)
C[i,1] <- cor(dat2$SBA,pred)
out <- cbind(C)
}
colMeans(out)
}
sim.sp(df2007.5k.s2,CM,1,1000)
Error in nb2listw(dist60, style = "...
2007 Oct 22
3
Spatial autocorrelation
Hi,
I have collected data on trees from 5 forest plots located within the
same landscape. Data within the plots are spatially autocorrelated
(calculated using Moran's I). I would like to do a ANCOVA type of
analysis combining these five plots, but the assumption that there is no
autocorrelation in the residuals is obviously violated. Does anyone have
any ideas how to incorporate these spatial