[R-sig-Geo] analysis on .dbf file instead of .shp
aniruddha ghosh
aniru123 at gmail.com
Mon Jun 11 12:46:00 CEST 2012
Hello list,
I am trying to perform a regression analysis on a vector data (shape
file). Some of the attributes of the shape files are the potential
explanatory variables (lets say X1 and X2) and response variable (Y).
Now instead of reading the shapefile, I'm using the associated .dbf
file and performing the analysis.
This looks like,
----------------------------------------
>data<-read.dbf("test.dbf")
>names(data)
"FID" "X1" "X2" "Y" "POINT_X" "POINT_Y"
>X<-cbind(data$X1,data$x2)
>Y<-data$Y
>summary(lm(Y~X))
----------------------------------------
Question: Is it a good practice to use the .dbf file instead of the .shp file?
Can I use the model developed here to predict some unknown Y with
known X (obtained from another .dbf file), and combine the predicted Y
as attribute to this .dbf file?
I'm using the .dbf file beacuse it is allowing me to apply diiferent
methods from different packages for prediction which I couldn't apply
to the .shp files due to my limited knowledge in using R!
Thanks,
Aniruddha Ghosh
More information about the R-sig-Geo
mailing list