Spatial Durbin Model di R

Berikut adalah contoh syntax SDM di R

library(spdep)
library(lattice)
library(maptools)

#Import data .shp

bh <- readShapePoly(“D:/Binus/Skripsi dan Tesis/Gita/Peta Bekasi/theme1.shp”)
plot(bh)

#Import data .txt yang urutannya sama dengan .shp
Dataset <- read.table(“D:/Binus/Skripsi dan Tesis/Gita/data.txt”,
header=TRUE, sep=””, na.strings=”NA”, dec=”.”, strip.white=TRUE)

#Menyusun pembobot/neighboring
w<- poly2nb(bh)

#Membuat model SDM
sdmmodel<-lagsarlm(Diare~Buta, data=Dataset, listw=nb2listw(w), type=”mixed”)
summary(sdmmodel)

Detail syntax dan ouput dapat didownload di contoh syntax

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s