Skip to content
Prev 28315 / 29559 Next

Doubt

Professor, thank you very much for the answers.

First issue resolved. Step1c = T means that ? is estimated via 2SLS instead of GS2SLS, in this case the default of spreg = GS2SLS.

Second: As you can see most of my problems arising due to the estimation of impacts.

As I reported, I was not able to estimate them, because I was having the same error that you discussed here (however, my estimation is done via spreg and not gstslshet):

https://stat.ethz.ch/pipermail/r-sig-geo/2019-January/027068.html

On my last attempt I upgraded to the package under development on R-Forge 1.7-6.

In this case, follow the pattern below that I used to estimate the impacts:

W <- as (as_dgRMatrix_listw (k2.listw), "CsparseMatrix")
trMatc <- trW (W, type = "mult")
effects <- summary (impacts (obj, tr = trMatc, R = 10000), zstats = TRUE, short = TRUE)
effects

Following this structure, in the development version, I can advance a little.

When I estimate a SAC (SARAR) model (with an option for heteroskedacticity) the results seem to be correct, and my results are built through the GSTSLS covariance matrix (practically all significant).

However when I try to verify the same issue for a SAR model, I have the error:

Error in UseMethod ("impacts", obj):  no applicable method for 'impacts' applied to an object of class "c ('sphet', 'stsls_sphet')".

One way to estimate was by specifying the spatial package

effects <- summary (spatialreg :: impacts (SARrobust, tr = trMatc, R = 10000), zstats = TRUE, short = TRUE)

however, as I said, for some reason, it is using an IV HAC variance matrix (I don't assign this in my model - which caused me the confusion about the possibility of HAC being applied in all SAR cases):

Another attempt was to use spatialreg::impacts.stsls

I am not sure if it is the way to estimate the impacts, but, again, the matrix used was IV HAC and in this specific case everything becomes insignificant.

Follow my sessionInfo()

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
 [1] sphet_1.7-6       plm_2.2-3         tseries_0.10-47   lmtest_0.9-37     zoo_1.8-8         car_3.0-8         carData_3.0-4     spdep_1.1-5
 [9] sf_0.9-5          maptools_1.0-1    xlsx_0.6.3        rgeos_0.5-3       rgdal_1.5-10      sp_1.4-2          shape_1.4.4       maps_3.3.0
[17] spDataLarge_0.4.1 spatialreg_1.1-5  Matrix_1.2-18     spData_0.3.8

loaded via a namespace (and not attached):
 [1] splines_3.6.2      gtools_3.8.2       Formula_1.2-3      Rdpack_0.11-1      expm_0.999-4       TTR_0.23-6         xlsxjars_0.6.1
 [8] cellranger_1.1.0   LearnBayes_2.15.1  pillar_1.4.4       lattice_0.20-41    glue_1.4.1         quadprog_1.5-8     digest_0.6.25
[15] sandwich_2.5-1     pkgconfig_2.0.3    bibtex_0.4.2.2     raster_3.3-7       haven_2.3.1        gmodels_2.18.1     purrr_0.3.4
[22] gdata_2.18.0       openxlsx_4.1.5     rio_0.5.16         tibble_3.0.1       generics_0.0.2     ellipsis_0.3.1     maxLik_1.3-8
[29] quantmod_0.4.17    magrittr_1.5       crayon_1.3.4       readxl_1.3.1       deldir_0.1-25      nlme_3.1-142       MASS_7.3-51.4
[36] forcats_0.5.0      xts_0.12-0         foreign_0.8-72     class_7.3-15       tools_3.6.2        data.table_1.12.8  hms_0.5.3
[43] gbRd_0.4-11        lifecycle_0.2.0    stringr_1.4.0      zip_2.0.4          compiler_3.6.2     e1071_1.7-3        rlang_0.4.7
[50] classInt_0.4-3     units_0.6-7        grid_3.6.2         miscTools_0.6-26   rstudioapi_0.11    boot_1.3-23        codetools_0.2-16
[57] abind_1.4-5        DBI_1.1.0          curl_4.3           R6_2.4.1           bdsmatrix_1.3-4    dplyr_1.0.0        KernSmooth_2.23-16
[64] rJava_0.9-12       stringi_1.4.6      Rcpp_1.0.5         vctrs_0.3.1        tidyselect_1.1.0   coda_0.19-3

Thank you.

Pietro Andre Telatin Paschoalino
Doutorando em Ci?ncias Econ?micas da Universidade Estadual de Maring? - PCE.