[R-sig-Geo] sarorderedprobit panel data

Roger Bivand Roger@B|v@nd @end|ng |rom nhh@no
Mon Apr 19 11:51:42 CEST 2021


On Mon, 19 Apr 2021, Ryan, Alex wrote:

> Hi Roger,
>
> Thank you for the recommendation, I see now that you have previously shared
> similar advice on the r-sig-geo forum. The kronecker calculation worked
> well and resolved the error message previously shared.

OK, so this fits a pooled model, so like MASS::polr() for the aspatial 
case, I think.

> Regarding your recommendation to include an ordinal response: is your 
> recommendation to include explanatory variables representing the time 
> period for each observation in the model? I do not see similar variables 
> included in the examples reported by the splm documentation as you have 
> referenced.

The idea was to take a data set used in the plm or splm packages, which 
only handle Gaussian responses by design, fit that example in splm as 
pooled, then convert the response to ordinal and fit in spatialprobit. If 
the outcomes are similar, you then have a framework to try to accommodate 
time fixed effects (try first FE in splm with Gaussian response, then 
manual FE with a year factor (year dummies) - which should be similar (do 
read the plm JSS article then the splm JSS article which builds on the 
former).

I might also look at other packages, like bayesm. I think that you need to 
have a strong micro model supporting the direct inclusion of the spatially 
lagged ordinal response; if you do not, a mixed effects ordinal probit 
regression with an MRF random effect for space and a temporal RE (not 
econometric, see the plm JSS article for the translation to statistics, 
but this worries referees, I'm afraid) may be the best way of extracting 
the structure in the data.

Roger

>
> On Sun, Apr 18, 2021 at 11:52 AM Roger Bivand <Roger.Bivand using nhh.no> wrote:
>
>> On Sat, 17 Apr 2021, Ryan, Alex via R-sig-Geo wrote:
>>
>>> I am attempting to use the sarorderedprobit function (within the
>>> "spatialprobit" package) to perform a SAR Ordered Probit estimation using
>>> panel data.
>>>
>>> I have imported my spatial weight matrix (representing the 50 states of
>> the
>>> US) using the following script:
>>>
>>> Weight_GAL<- read.gal(File, override.id=TRUE)
>>> Weight_List<nb2listw(Weight_GAL,style="W", zero.policy=TRUE)
>>> W<-listw2mat(Weight_List)
>>>
>>> which successfully imports the 50x50 sparse matrix.
>>>
>>> The following sarorderedprobit is run:
>>>
>>> sarorderedprobit(formula, W=W, showProgress=TRUE)
>>>
>>> When using cross-sectional data with 50 observations, the script
>>> successfully estimates the sarorderedprobit model. However, when panel
>> data
>>> is used with 3 years (i.e., 150 observations), the script returns the
>>> following error:
>>>
>>> "Error: Matrices must have same dimensions in .Arith.Csparse(e1,e2,
>>> .Generic, class. = dgCMatrix")".
>>>
>>> The issue here seems to be related to the use of a 50x50 weight matrix
>> with
>>> 150 observations. Unfortunately, I have not found any references to using
>>> the sarorderedprobit function with panel data. Can anyone provide
>> guidance
>>> on whether the sarorderedprobit function supports estimation using panel
>> or
>>> timeseries datasets?
>>
>> Perhaps use a Kronecker product to provide W with three block-diagonal
>> cross sectional spatial weights matrices (assuming that your data is
>> ordered with time varying slower than space?). Could you work up a data
>> set such as those used in splm and add an ordinal response?
>>
>> Roger
>>
>>>
>>>       [[alternative HTML version deleted]]
>>>
>>> _______________________________________________
>>> R-sig-Geo mailing list
>>> R-sig-Geo using r-project.org
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>>
>>
>> --
>> Roger Bivand
>> Emeritus Professor
>> Department of Economics, Norwegian School of Economics,
>> Postboks 3490 Ytre Sandviken, 5045 Bergen, Norway.
>> e-mail: Roger.Bivand using nhh.no
>> https://orcid.org/0000-0003-2392-6140
>> https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en
>>
>

-- 
Roger Bivand
Emeritus Professor
Department of Economics, Norwegian School of Economics,
Postboks 3490 Ytre Sandviken, 5045 Bergen, Norway.
e-mail: Roger.Bivand using nhh.no
https://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en



More information about the R-sig-Geo mailing list