[R-sig-Geo] fitting lag model in R

2012-12-29 Thread Milan Sharma


Hi all,
can any one of you see whats wrong in the code below?
  model-lm(Tcrash~X100MVMT+Alcohol+Alignment+PVMT, data=data)#works
 sar-spautolm(Tcrash~X100MVMT+Alcohol+Alignment+PVMT,listw=WI_queenW, 
 data=data)#works
 lag - lagsarlm(Tcrash~X100MVMT+Alcohol+Alignment+PVMT, data=data, 
 listw=listwW)#shows error
Error in solve.default(inf, tol = tol.solve) : 
  system is computationally singular: reciprocal condition number = 2.44638e-12
 lag - lagsarlm(Tcrash~X100MVMT+Alcohol+Alignment+PVMT, data=data, 
 listw=WI_queenW)
Error in solve.default(inf, tol = tol.solve) : 
  system is computationally singular: reciprocal condition number = 1.51647e-13
 WI_queenW
Characteristics of weights list object:
Neighbour list object:
Number of regions: 71 
Number of nonzero links: 364 
Percentage nonzero weights: 7.22079 
Average number of links: 5.126761 

Weights style: B 
Weights constants summary:
   n   nn  S0  S1   S2
B 71 5041 364 728 8160
.
 Milan
[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] back to variogram

2012-12-29 Thread Hodgess, Erin
Hello yet again:

I have a little data set that I want to get a variogram for.  However, I keep 
getting an error.

 str(z1.df)
Formal class 'SpatialPointsDataFrame' [package sp] with 5 slots
  ..@ data   :'data.frame':5 obs. of  1 variable:
  .. ..$ x: num [1:5] 1.4228 0.0275 -0.3738 0.2812 0.2328
  ..@ coords.nrs : int [1:2] 2 3
  ..@ coords : num [1:5, 1:2] 146.9 133.8 -85.8 -99.9 -91.1 ...
  .. ..- attr(*, dimnames)=List of 2
  .. .. ..$ : NULL
  .. .. ..$ : chr [1:2] lon lat
  ..@ bbox   : num [1:2, 1:2] -99.9 -31.3 146.9 38.3
  .. ..- attr(*, dimnames)=List of 2
  .. .. ..$ : chr [1:2] lon lat
  .. .. ..$ : chr [1:2] min max
  ..@ proj4string:Formal class 'CRS' [package sp] with 1 slots
  .. .. ..@ projargs: chr NA
 variogram(z1.df)
Error in variogram.default(z1.df) :
  argument object and locations should be lists


Does this make any sense, please?

Thanks,
Erin


[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] function to convert 3D geographical coordinates to Cartesian?

2012-12-29 Thread Tom Roche

Is there packaged code to convert geographical coordinates (e.g.,
longitude, latitude, elevation) to Cartesian coordinates in 3-space?
The spherical-to-Cartesian math is straightforward enough, but there's
certainly scope for error, so I'd prefer to use tested, previously-used
code if available.

TIA, Tom Roche tom_ro...@pobox.com

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo