[R-sig-Geo] specifying time period for splm

Maryia Bakhtsiyarava bakht013 at umn.edu
Thu Jan 7 04:58:55 CET 2016


Hello,

I would be very thankful for any help with my issue. I am relatively new to
R and would greatly appreciate your help.

I am trying to run spatial panel data models using the "splm," package. I
studied the manual and have been closely following the article by G. Millo
and G. Piras in the Journal of Statistical Software titled "splm: Spatial
Panel Data Models in R" to create my own models. What I don't seem to
understand is how R understands that the data are arranged in time series..
I have repeated observations for spatial units for 5 years, however, I have
not found where in the script I need to specify the periods. I looked at
the data Millo used in the article, and even though the data are arranged
by years, there is no explicit mention in the code or article of how to
pass the time periods to R.

Let's assume I have the following:
I construct a spatial weights matrix (sp_weightsm) from the shapefile of my
spatial units.
my formula is: fm1<-y~x1+x2+x3
mod1<-spml(formula = fm2, data = sids, index=NULL, listw=sp_weightsm,
lag=TRUE, spatial.error = "b", model = "within", effect = "individual",
method = "eigen", na.action = na.fail, quiet = TRUE, zero.policy = NULL,
tot.solve = 1e-10, control=list(), legacy=FALSE)

my data has the following structure:
                        Year   X1   X2
Spatial Unit 1  2000   ....   .....
Spatial Unit 1  2001
Spatial Unit 2  2000
Spatial Unit 2  2001
Spatial Unit n  .....

This model runs without errors however I am pretty sure the results are not
meaningful because how would R know the time periods?
So, my question is: How do I pass on the time periods to R? Do I need to
subset my dataset into different parts based on years?

Thank you in advance,
Maria

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list