Skip to content

Commit

Permalink
update vignette
Browse files Browse the repository at this point in the history
  • Loading branch information
SpatLyu committed Dec 4, 2024
1 parent 1526e43 commit 1960e48
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 67 deletions.
132 changes: 66 additions & 66 deletions vignettes/HSAR.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ vignette: >


An application of HSAR for asking prices in the municipality of Athens
====================================================================
======================================================================

An application of `hsar()`, based on rel data, will be illustrated. The design of the weight matrices needed and the random effect design matrix will be explained.

Expand Down Expand Up @@ -206,43 +206,43 @@ summary(res)
##
## Coefficients:
## Mean SD
## (Intercept) 1.880461e+03 9.794419e+00
## size 4.301935e+00 4.713561e-01
## age -1.991273e+01 1.339089e+00
## greensp 7.790633e-04 7.862559e-04
## population -9.240542e-03 2.397341e-03
## museums -4.531282e+01 1.033345e+01
## airbnb 5.803532e-01 2.232756e-01
## (Intercept) 1.880275e+03 10.451464146
## size 4.329367e+00 0.513033746
## age -1.999349e+01 1.324229710
## greensp 1.025379e-03 0.001070125
## population -1.020677e-02 0.002522363
## museums -4.452665e+01 10.013196719
## airbnb 5.915438e-01 0.268172791
##
## Spatial Coefficients:
## rho lambda
## [1,] 0.201284 0.195202
## [1,] 0.189246 0.095438
##
## Diagnostics
## Deviance information criterion (DIC): 28197.36
## Effective number of parameters (pd): -1.635173
## Log likelihood: -14100.32
## Pseudo R squared: 0.3587075
## Deviance information criterion (DIC): 28198.27
## Effective number of parameters (pd): -1.504082
## Log likelihood: -14100.64
## Pseudo R squared: 0.3620759
##
## Impacts:
## direct indirect total
## (Intercept) 1.881108e+03 4.730904e+02 2.354198e+03
## size 4.303415e+00 1.082290e+00 5.385706e+00
## age -1.991958e+01 -5.009688e+00 -2.492927e+01
## greensp 7.793313e-04 1.959984e-04 9.753297e-04
## population -9.243721e-03 -2.324756e-03 -1.156848e-02
## museums -4.532841e+01 -1.139990e+01 -5.672831e+01
## airbnb 5.805528e-01 1.460065e-01 7.265593e-01
## (Intercept) 1.880841e+03 4.382206e+02 2.319062e+03
## size 4.330671e+00 1.009011e+00 5.339682e+00
## age -1.999951e+01 -4.659722e+00 -2.465924e+01
## greensp 1.025687e-03 2.389767e-04 1.264664e-03
## population -1.020984e-02 -2.378809e-03 -1.258865e-02
## museums -4.454006e+01 -1.037747e+01 -5.491752e+01
## airbnb 5.917219e-01 1.378663e-01 7.295883e-01
##
## Quantiles:
## 5% 25% 50% 75% 95%
## (Intercept) 1.863987e+03 1.874152e+03 1.881128e+03 1.887705e+03 1.894747e+03
## size 3.501653e+00 3.996034e+00 4.328532e+00 4.625902e+00 5.033293e+00
## age -2.205857e+01 -2.086760e+01 -1.991433e+01 -1.902301e+01 -1.773964e+01
## greensp -2.238065e-04 2.536224e-04 6.319674e-04 1.162900e-03 2.560007e-03
## population -1.313017e-02 -1.086792e-02 -9.282930e-03 -7.491176e-03 -5.489072e-03
## museums -6.251765e+01 -5.195792e+01 -4.486279e+01 -3.794775e+01 -2.997397e+01
## airbnb 1.780049e-01 4.327122e-01 6.070358e-01 7.323369e-01 9.083725e-01
## (Intercept) 1.862427e+03 1.873212e+03 1.880350e+03 1.887635e+03 1.896350e+03
## size 3.489378e+00 3.986492e+00 4.321245e+00 4.678758e+00 5.205164e+00
## age -2.229396e+01 -2.091545e+01 -1.998110e+01 -1.907934e+01 -1.799405e+01
## greensp -4.953357e-04 3.921906e-04 9.347588e-04 1.452994e-03 3.367750e-03
## population -1.446168e-02 -1.192027e-02 -1.031386e-02 -8.534997e-03 -5.796541e-03
## museums -6.060125e+01 -5.129784e+01 -4.486833e+01 -3.735308e+01 -2.862404e+01
## airbnb 1.890712e-01 4.267859e-01 5.849742e-01 7.457998e-01 1.096826e+00
```

and the two simpler models defined for rho = 0 and lambda=0.
Expand All @@ -263,33 +263,33 @@ summary(res_1)
##
## Coefficients:
## Mean SD
## (Intercept) 1.880969e+03 1.004751e+01
## size 4.299105e+00 4.215697e-01
## age -1.996865e+01 1.310667e+00
## greensp 5.304726e-04 6.544811e-04
## population -6.654456e-03 1.060707e-03
## museums -4.511823e+01 9.175141e+00
## airbnb 7.234227e-01 2.314932e-01
## (Intercept) 1.880563e+03 9.2553985121
## size 4.326023e+00 0.4325595027
## age -1.997018e+01 1.2471979927
## greensp 5.829718e-04 0.0006813374
## population -6.584233e-03 0.0011227284
## museums -4.534275e+01 9.5807150591
## airbnb 6.574944e-01 0.1764067282
##
## Spatial Coefficients:
## lambda
## 0.070876
## 0.111888
##
## Diagnostics
## Deviance information criterion (DIC): 28198.46
## Effective number of parameters (pd): -1.870333
## Log likelihood: -14101.1
## Pseudo R squared: 0.3582752
## Deviance information criterion (DIC): 28193.07
## Effective number of parameters (pd): -2.092455
## Log likelihood: -14098.63
## Pseudo R squared: 0.3569871
##
## Quantiles:
## 5% 25% 50% 75% 95%
## (Intercept) 1.864880e+03 1.874552e+03 1.880957e+03 1.887456e+03 1.897001e+03
## size 3.610783e+00 4.006603e+00 4.322592e+00 4.583691e+00 4.983597e+00
## age -2.207850e+01 -2.087071e+01 -1.995724e+01 -1.901799e+01 -1.790105e+01
## greensp -6.921436e-04 1.703272e-04 5.736104e-04 9.622126e-04 1.489968e-03
## population -8.359189e-03 -7.311060e-03 -6.666792e-03 -5.998892e-03 -4.847390e-03
## museums -6.003316e+01 -5.108847e+01 -4.522155e+01 -3.899018e+01 -2.960428e+01
## airbnb 3.630902e-01 5.791529e-01 7.000081e-01 8.588804e-01 1.159867e+00
## (Intercept) 1.865244e+03 1.874265e+03 1.881036e+03 1.886741e+03 1.895768e+03
## size 3.641719e+00 4.033250e+00 4.310376e+00 4.628015e+00 5.048434e+00
## age -2.200615e+01 -2.083570e+01 -1.996753e+01 -1.911833e+01 -1.802003e+01
## greensp -6.439277e-04 2.933380e-04 6.549234e-04 1.027634e-03 1.541188e-03
## population -8.302344e-03 -7.287608e-03 -6.676006e-03 -5.995643e-03 -4.711512e-03
## museums -6.123372e+01 -5.128380e+01 -4.534965e+01 -3.955427e+01 -2.992627e+01
## airbnb 3.592684e-01 5.376341e-01 6.620247e-01 7.804008e-01 9.272886e-01
```

and secondly, given lambda = 0 (no interaction at the higher level) we get
Expand All @@ -308,32 +308,32 @@ summary(res_2)
## Type: hsar with lambda = 0
##
## Coefficients:
## Mean SD
## (Intercept) 1.880360e+03 9.638392003
## size 4.274640e+00 0.475946778
## age -2.000767e+01 1.416531702
## greensp 8.151624e-05 0.001316126
## population -8.668497e-03 0.002604684
## museums -4.511405e+01 9.814353408
## airbnb 6.302068e-01 0.318353574
## Mean SD
## (Intercept) 1.880265e+03 10.543140981
## size 4.308513e+00 0.525275852
## age -1.986549e+01 1.319366170
## greensp 1.371616e-03 0.001140316
## population -9.124421e-03 0.002675214
## museums -4.476371e+01 9.550375854
## airbnb 4.911532e-01 0.225534492
##
## Spatial Coefficients:
## rho
## 0.189216
## 0.173638
##
## Diagnostics
## Deviance information criterion (DIC): 28196.66
## Effective number of parameters (pd): -1.67705
## Log likelihood: -14100.01
## Pseudo R squared: 0.3591423
## Deviance information criterion (DIC): 28194.37
## Effective number of parameters (pd): -1.627506
## Log likelihood: -14098.81
## Pseudo R squared: 0.3590682
##
## Quantiles:
## 5% 25% 50% 75% 95%
## (Intercept) 1864.24515875 1.873775e+03 1.880736e+03 1.886645e+03 1.895744e+03
## size 3.50820040 3.921107e+00 4.282089e+00 4.580065e+00 5.067648e+00
## age -22.32636764 -2.097454e+01 -1.997216e+01 -1.902378e+01 -1.763772e+01
## greensp -0.00297142 -2.411191e-04 5.260136e-04 9.078372e-04 1.450913e-03
## population -0.01257212 -1.045538e-02 -8.815213e-03 -7.081089e-03 -4.074837e-03
## museums -61.04617221 -5.171848e+01 -4.530204e+01 -3.812907e+01 -2.869411e+01
## airbnb 0.20185017 4.330003e-01 5.837671e-01 7.511525e-01 1.288780e+00
## (Intercept) 1.863706e+03 1.873326e+03 1.879689e+03 1.887368e+03 1.897511e+03
## size 3.490029e+00 3.923317e+00 4.296004e+00 4.663584e+00 5.184349e+00
## age -2.200291e+01 -2.074799e+01 -1.982105e+01 -1.895658e+01 -1.769628e+01
## greensp 1.420867e-05 6.256490e-04 9.982406e-04 1.942325e-03 3.742835e-03
## population -1.315579e-02 -1.102766e-02 -9.232202e-03 -7.360224e-03 -4.491216e-03
## museums -5.960091e+01 -5.079269e+01 -4.475590e+01 -3.875467e+01 -2.831173e+01
## airbnb 6.098123e-02 3.628817e-01 5.108585e-01 6.384128e-01 8.167038e-01
```
2 changes: 1 addition & 1 deletion vignettes/HSAR.Rmd.orig
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ knitr::opts_chunk$set(
```

An application of HSAR for asking prices in the municipality of Athens
====================================================================
======================================================================

An application of `hsar()`, based on rel data, will be illustrated. The design of the weight matrices needed and the random effect design matrix will be explained.

Expand Down

0 comments on commit 1960e48

Please sign in to comment.