[R] Spatial Durbin (mixed) Model Inquery

Pham,Chi Chi.Pham at colostate.edu
Tue Jun 21 20:30:24 CEST 2016


Hi,
I am trying to run a Spatial Durbin Model but I need to incorporate a robust standard error in it since the data have heteroskedasticity, I don’t know how to return the results with robust standard error. One other thing I would like to do is to also return the Direct and Indirect effects with the robust standard error. I managed to get R to show the Direct and Indirect coeffients but could not see their standard error. If you have some insight about this, I would be really thankful. Below are the commands I used:

#LOADING DATA FILE
> nonadj <- read.csv("C:/Users/Chi/OneDrive/Thesis/R/nonadj-percent.csv", 1)
> attach(nonadj)

#CREATING DEPENDENT AND INDEPENDENT MATRICES
> Y1 <- cbind(growth)
> X1 <- cbind(pop, Net.Migra, FDI.capita, Retail.sale.thou, Vol.Freight.N, Labor.in.business, Turnover.of.biz, Coll.Stu.pcnt, highschool, secondprim, Hospital, cereal, fishaqua, cattlepoul)

#CREATING THE WEIGHT MATRIX (376x376)
> weight1 <- read.csv("C:/Users/Chi/OneDrive/Thesis/R/nonadjW.csv", 1)
> attach(weight1)
> W1 <- cbind(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28, A29, A30, A31, A32, A33, A34, A35, A36, A37, A38, A39, A40, A41, A42, A43, A44, A45, A46, A47, A48, A49, A50, A51, A52, A53, A54, A55, A56, A57, A58, A59, A60, A61, A62, A63, A64, A65, A66, A67, A68, A69, A70, A71, A72, A73, A74, A75, A76, A77, A78, A79, A80, A81, A82, A83, A84, A85, A86, A87, A88, A89, A90, A91, A92, A93, A94, A95, A96, A97, A98, A99, A100, A101, A102, A103, A104, A105, A106, A107, A108, A109, A110, A111, A112, A113, A114, A115, A116, A117, A118, A119, A120, A121, A122, A123, A124, A125, A126, A127, A128, A129, A130, A131, A132, A133, A134, A135, A136, A137, A138, A139, A140, A141, A142, A143, A144, A145, A146, A147, A148, A149, A150, A151, A152, A153, A154, A155, A156, A157, A158, A159, A160, A161, A162, A163, A164, A165, A166, A167, A168, A169, A170, A171, A172, A173, A174, A175, A176, A177, A178, A179, A180, A181, A182, A183, A184, A185, A186, A187, A188, A189, A190, A191, A192, A193, A194, A195, A196, A197, A198, A199, A200, A201, A202, A203, A204, A205, A206, A207, A208, A209, A210, A211, A212, A213, A214, A215, A216, A217, A218, A219, A220, A221, A222, A223, A224, A225, A226, A227, A228, A229, A230, A231, A232, A233, A234, A235, A236, A237, A238, A239, A240, A241, A242, A243, A244, A245, A246, A247, A248, A249, A250, A251, A252, A253, A254, A255, A256, A257, A258, A259, A260, A261, A262, A263, A264, A265, A266, A267, A268, A269, A270, A271, A272, A273, A274, A275, A276, A277, A278, A279, A280, A281, A282, A283, A284, A285, A286, A287, A288, A289, A290, A291, A292, A293, A294, A295, A296, A297, A298, A299, A300, A301, A302, A303, A304, A305, A306, A307, A308, A309, A310, A311, A312, A313, A314, A315, A316, A317, A318, A319, A320, A321, A322, A323, A324, A325, A326, A327, A328, A329, A330, A331, A332, A333, A334, A335, A336, A337, A338, A339, A340, A341, A342, A343, A344, A345, A346, A347, A348, A349, A350, A351, A352, A353, A354, A355, A356, A357, A358, A359, A360, A361, A362, A363, A364, A365, A366, A367, A368, A369, A370, A371, A372, A373, A374, A375, A376)
> W1 <- mat2listw(W1)

#RUNNING SPATIAL DURBIN REGRESSION
> library(spdep)
> SDM1 <- lagsarlm(Y1~X1,data=nonadj,W1, type="mixed")
> summary (SDM1)

Call:lagsarlm(formula = Y1 ~ X1, data = nonadj, listw = W1, type = "mixed")

Residuals:
      Min        1Q    Median        3Q       Max
-0.245203 -0.054391 -0.010243  0.037691  0.650065

Type: mixed
Coefficients: (asymptotic standard errors)
    (1 not defined because of singularities)
                           Estimate  Std. Error  z value  Pr(>|z|)
(Intercept)              8.4752e-02  1.0352e-01   0.8187 0.4129595
X1pop                    8.1888e-01  8.0222e-01   1.0208 0.3073616
X1Net.Migra              1.4557e-04  5.4679e-04   0.2662 0.7900713
X1FDI.capita             1.0825e-04  7.9579e-05   1.3603 0.1737211
X1Retail.sale.thou       3.5921e-01  4.7799e-02   7.5150 5.684e-14
X1Vol.Freight.N         -1.5598e-01  2.1753e-02  -7.1705 7.472e-13
X1Labor.in.business     -6.2889e-01  5.2969e-02 -11.8728 < 2.2e-16
X1Turnover.of.biz       -1.0088e-01  2.8196e-02  -3.5778 0.0003465
X1Coll.Stu.pcnt         -2.3874e-03  1.6242e-03  -1.4699 0.1415996
X1highschool             9.7207e-02  6.0762e-02   1.5998 0.1096474
X1secondprim            -2.0255e-02  1.2884e-01  -0.1572 0.8750760
X1Hospital               2.5882e-03  6.3570e-02   0.0407 0.9675240
X1cereal                -3.2210e-03  6.1418e-02  -0.0524 0.9581746
X1fishaqua               2.4810e-02  3.2659e-02   0.7596 0.4474674
X1cattlepoul             4.9122e-02  3.9470e-02   1.2445 0.2133005
lag.(Intercept)                  NA          NA       NA        NA
lag.X1pop                3.1168e-02  2.1213e-01   0.1469 0.8831907
lag.X1Net.Migra         -1.0739e-04  3.3696e-04  -0.3187 0.7499517
lag.X1FDI.capita         2.8408e-05  9.2314e-05   0.3077 0.7582897
lag.X1Retail.sale.thou  -6.2861e-02  5.8775e-02  -1.0695 0.2848380
lag.X1Vol.Freight.N      2.6938e-02  2.5154e-02   1.0709 0.2842134
lag.X1Labor.in.business -4.2901e-03  4.2330e-02  -0.1013 0.9192736
lag.X1Turnover.of.biz   -5.3610e-02  2.7632e-02  -1.9401 0.0523647
lag.X1Coll.Stu.pcnt     -2.6502e-03  1.5856e-03  -1.6714 0.0946416
lag.X1highschool        -4.9215e-03  7.5851e-02  -0.0649 0.9482666
lag.X1secondprim        -2.2008e-01  1.5629e-01  -1.4082 0.1590763
lag.X1Hospital           1.0957e-02  6.4151e-02   0.1708 0.8643748
lag.X1cereal            -1.9200e-02  4.8177e-02  -0.3985 0.6902360
lag.X1fishaqua           5.3577e-02  2.4049e-02   2.2279 0.0258902
lag.X1cattlepoul        -9.2296e-03  5.1168e-02  -0.1804 0.8568547

Rho: 0.021541, LR test value: 0.64222, p-value: 0.42291
Asymptotic standard error: 0.020742
    z-value: 1.0385, p-value: 0.29903
Wald statistic: 1.0785, p-value: 0.29903

Log likelihood: 362.6504 for mixed model
ML residual variance (sigma squared): 0.0084969, (sigma: 0.092178)
Number of observations: 376
Number of parameters estimated: 31
AIC: -663.3, (AIC for lm: -664.66)
LM test for residual autocorrelation
test value: 1.0739, p-value: 0.30008

#DIRECT AND INDIRECT EFFECT
> DirectIndirect <- impacts(SDM1, listw=W1)
> print(DirectIndirect, zstats=T)
Impact measures (mixed, exact):
                           Direct      Indirect         Total
X1pop                0.8216413667  0.4689926598  1.2906340265
X1Net.Migra          0.0001396760 -0.0010017906 -0.0008621146
X1FDI.capita         0.0001099911  0.0002953802  0.0004053713
X1Retail.sale.thou   0.3560995192 -0.5296852825 -0.1735857633
X1Vol.Freight.N     -0.1546482688  0.2265607787  0.0719125099
X1Labor.in.business -0.6298927708 -0.1713948301 -0.8012876009
X1Turnover.of.biz   -0.1040310437 -0.5360237512 -0.6400547949
X1Coll.Stu.pcnt     -0.0025399984 -0.0259598778 -0.0284998762
X1highschool         0.0970468278 -0.0271707229  0.0698761049
X1secondprim        -0.0327121352 -2.1189667965 -2.1516789317
X1Hospital           0.0032102908  0.1058274395  0.1090377303
X1cereal            -0.0043095229 -0.1851649223 -0.1894744453
X1fishaqua           0.0278662464  0.5199654674  0.5478317137
X1cattlepoul         0.0486605830 -0.0785212636 -0.0298606805



Thank you for any information that you have on this!
Chi Pham

	[[alternative HTML version deleted]]



More information about the R-help mailing list