Re: [R-sig-Geo] INterpretation of AIC

2014-04-11 Thread Milan Sharma
 Thank you Bastien, and Dr. Bivand! I appreciate your suggestions. Milan On Friday, April 11, 2014 6:58 AM, Bastien Ferland-Raymond bastien.ferland-raym...@mrn.gouv.qc.ca wrote: Hello, I'm not familliar with SAR and CAR model, but smaller AIC is better than larger AIC.  The important thing

[R-sig-Geo] INterpretation of AIC

2014-04-10 Thread Milan Sharma
Hi all, I fitted three models (Ordinary least squares, CAR, and SAR) as follows.   W-nb2listw(nlist,style=B)  sar-spautolm(Y~X,data=data.df,listw=W)  car-spautolm(Y~X,listw=W,data=data.df, family=CAR)  ols-lm(Y~X,data=data.df)  AIC(ols,car,sar)       df        AIC ols  3      -124.4118 car  4    

Re: [R-sig-Geo] How to shrink a spatial shape ? Or calculate distances btw points and a polygon ?

2014-03-14 Thread Milan Sharma
Hi all, I know there are several postings on this problem, but that did not help to solve my problem sarlm-lagsarlm(Agr_2001~Gras_2001+For_2001,data=data1,listw=qw) Error in solve.default(inf, tol = tol.solve) : system is computationally singular: reciprocal condition number = 4.22828e-37 How

[R-sig-Geo] DIC of SAR model

2013-09-25 Thread Milan Sharma
Hi all, I read in a paper that has calculated the DIC (deviance information criteria) value of SAR model. Using spautolm (), I fitted SAR model, and DIC()  does give an error. sar-spautolm(Y~X1+X2,data=data,listw=listw) DIC(sar) Error: could not find function DIC How do I calculate DIC value

[R-sig-Geo] HI

2013-09-12 Thread Milan Sharma
Hi all, Just wondering why AIC of a predictive process model is not defined.  Can any body clarify? 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] Citation

2013-07-17 Thread Milan Sharma
Hi Roger, If I am using a number of packages from R, what is the general practice of citation (to cite all the packages individually or to cite R as a whole) in scientific journal  publications? Thanks, Milan ___ R-sig-Geo mailing list

[R-sig-Geo] Citation for spgwr

2013-07-15 Thread Milan Sharma
Hi Roger,  Please let me know if the following way of citing spgwr is incorect: In references:  Bivand, R., Yu, D. (2013) spgwr:  Geographically weighted regression. R package version 3.0 and within the text:  We usedthe spgwr package (Bivand and Yu 2013) for GWR in the statistical software

[R-sig-Geo] counties of montana

2013-06-16 Thread Milan Sharma
 Hi list, when I run the code     map1 - map(county,c(montana), fill=T, plot=F) I see that  R has 57 counties stored for Montana, USA. It shows separate counties montana.yellowstone   and  montana.yellowstone national in there. However, in fact,  Montana has only 56 counties. Has any one

[R-sig-Geo] SAR and car degrees of freedom

2013-04-13 Thread Milan Sharma
Dear all, I fitted a SAR model with a response and 3 predictors. The output has coefficients for an intercept and the three predictors. However, summary of the SAR model says that number of parameters estimated is 6. Can somebody clarify why number of parameters estimated is 6, instead of 4

[R-sig-Geo] GWR question

2013-04-10 Thread Milan Sharma
in place of 1 standard error? or why not 0.5 standard error? If you could clarify this to me, I would really appreciate that. Milan Sharma [[alternative HTML version deleted]] ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https

[R-sig-Geo] Mixed model for spatial data

2013-02-28 Thread Milan Sharma
Hi all, as of now, I have been fitting mixed models for longitudinal data (measurements repeated over time). I have spatial data (ID, response, predictors, longitude, latitude). Generally mixed model in R uses something like :   (1|Subject) in the argument. Now, my question is how do I take

[R-sig-Geo] counties plot in R

2013-02-18 Thread Milan Sharma
Hi list/ Roger, I tried just 3 states as you said, I merged state and county names to make sure the county names are different. Here is the error message. library(maptools) library(maps) library(spdep) library(rgdal) library(alr3)  data-read.csv(try3.csv,header=TRUE) attach(data) names(data)

[R-sig-Geo] different states have same county name, problem in spplot

2013-02-15 Thread Milan Sharma
Dear List, I fitted GWR, but different states have sane county names. Here is the code and error message. data-read.csv(C:GWRDATA1.csv,header=TRUE) library(spgwr) map = SpatialPointsDataFrame(data=data, coords=cbind(data$Longitude,data$Latitude)) SD.adapt.gauss -

[R-sig-Geo] residuals of gwr and ols

2013-02-12 Thread Milan Sharma
Dear all, I fitted gwr and ols and I was expecting that residuals for gwr will be smaller than that of ols. But, my result  (copied below) is kind of mixed. Some ols residuals are smaller than gwr, some are not. Is it because of small samples? or anything else? Milan -0.136016648 

[R-sig-Geo] spgwr (georgia)

2013-02-09 Thread Milan Sharma
Dear all, #the following is gwr code for georgia data. #Can somebody point out what is plotted by this code? #I want to plot residual plot (gwr and ols both) for this data. library(spgwr) data(georgia) g.adapt.gauss - gwr.sel(PctBach ~ TotPop90 + PctRural + PctEld + PctFB + PctPov + PctBlack,

[R-sig-Geo] GWR residual plot, state map did not appear

2013-02-09 Thread Milan Sharma
  Dear list, I did GWR residual plot using the same technique as spgwr package. When I do for Georgia data, I get the nice plot (with the state map) with the residuals, but same code applied to my data gives residuals plot (without the state map). My code is given below, if someone can tell me

[R-sig-Geo] Simulation of spatial data

2013-02-07 Thread Milan Sharma
Dear list/ Professor Bivand, I have a curiosity about spatial data. We have seen fitting CAR and SAR models for county level data (real data). Is it possible to simulate such a county level data and then perform such CAR and SAR analysis for the simulated data?  I

Re: [R-sig-Geo] spatial regression for binary/dichotomous depend variable

2013-02-06 Thread Milan Sharma
Looks like you want autologistic regression. Just google autologistic modelling in R and you will get archieves of previous sessions. Best, Mitra Devkota From: Tanja Zinßer tanja.zins...@googlemail.com To: r-sig-geo@r-project.org Sent: Wednesday, February 6,

[R-sig-Geo] Spatio temporal modeling

2013-02-05 Thread Milan Sharma
Dear list,  I have a data set, with response=yield of crop, predictors=temperature and precipitation for all the counties of a state, repeatedly for many years. (i.e. for each year, I have the data with these three variables for each country for 4 years).My question is, how can I take time into

[R-sig-Geo] GWR

2013-02-05 Thread Milan Sharma
Dear list, what command in R gives all the local parameter estimates of a GWR? I just got minimum, max,of the coefficients. Any help would be appreciated. Milan [[alternative HTML version deleted]] ___ R-sig-Geo mailing list

[R-sig-Geo] Correlogram

2013-02-03 Thread Milan Sharma
Dear all, I see that moran's correlogram can be constructed by correlog() and also by sp.correlogram(). Do they have similar interpretations? Is there anything like these two should be used in different conditions? or Can anyone of these be used in all the conditions? Thanks, Milan

Re: [R-sig-Geo] Shape file problem

2013-01-30 Thread Milan Sharma
Here is my problem in R: readOGR(dsn=C:/Users/abc/desktop/shapfile,SD06) OGR data source with driver: ESRI Shapefile Source: C:/Users/abc/desktop/shapfile, layer: SD06 with 66 features and 36 fields Feature type: wkbPolygon with 2 dimensions  #Is the above program running correctly? Or, is this

[R-sig-Geo] Shape file problem

2013-01-29 Thread Milan Sharma
Dear all, my question is about shapefile and GIS, rather than R. If somebody could kindly help me, or can direct me to another site, I would appreciate that. I created my shapefile successfully, and the name of my shapefile is AZ. I have different name for the columns of my shape file, but shape

Re: [R-sig-Geo] Poisson regression spatial residual plot

2013-01-10 Thread Milan Sharma
@ Chris:  thanks! I just did spCbind to merge residuals  with my spatial data and the program worked just fine. Thanks :) Now, how can I add site locations on the plot (like the one Bivand et. al., figure 10.5)? Milan From: Chris Fowler csfow...@psu.edu

[R-sig-Geo] Poisson regression spatial residual plot

2013-01-09 Thread Milan Sharma
r-sig-geo@r-project.org Sent: Tuesday, January 8, 2013 1:42 PM Subject: Re: [R-sig-Geo] Poisson regression spatial residual plot Dear Milan, El mar, 08-01-2013 a las 06:48 -0800, Milan Sharma escribió: Dear list, I wanted to plot residuals from poisson regression model (like the figure

Re: [R-sig-Geo] Poisson regression spatial residual plot

2013-01-09 Thread Milan Sharma
Dear all,  may be this one is readable. I want to plot Poisson regression spatial residual plot, all the codes run but there is a small error  at the end in spplot command, which is shown below. Can someone figure out what is wrong? ## GLMp -

[R-sig-Geo] Poisson regression spatial residual plot

2013-01-08 Thread Milan Sharma
Dear list, I wanted to plot residuals from poisson regression model (like the figure 10.5 of  Applied spatial data analysis with R, Bivand et. al.). My data has response,Tcrash,  and  the covariates, 100MVMT, Alcohol PVMT Alignment  and longitude and latitude. I used their code, but what TCE

[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,

[R-sig-Geo] Shape file of USA land cover data

2012-12-05 Thread Milan Sharma
Hi List, I  wanted to download national land cover data of USA, 2006 which I could convert to shape file and do analysis. The website is http://www.mrlc.gov/nlcd01_data.php.  I got the following 6 files in it: 1. appendix1_nlcd2006_scene_list_by_path_row_txt 2. 

Re: [R-sig-Geo] Shape file of USA land cover data

2012-12-05 Thread Milan Sharma
data sessionInfo() will tell you what's loaded and install.packages(rgdal) in a fresh session will install latest, depending on your system On Thursday, December 6, 2012, Milan Sharma wrote: Mike, I just updated my R (I uninstalled the previous version of R and installed R version 2.15.2

[R-sig-Geo] read shapfile in R

2012-12-04 Thread Milan Sharma
Dear all, I have a shape file in my desktop. I could not read this file in R. The following are my codes, can somebody tell me how to do? None of these are working.. require(maptools) library(rgdal) ##my working directory is C:/Users/study/Desktop. ##name of my shape file is data. shape -

[R-sig-Geo] Fitting exponential variogram to lattice data

2012-11-12 Thread Milan Sharma
Dear all, I want to fit an exponential variogram for my lattice data. But, I  just have response variable (yield), and predictors: temperature and precipitation. I do not have longitude and latitude. This is the data of all the counties of a state of the USA. Is it possible to fit exponential