Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: estimating spatial autocorrelation after creating a spatial neighbour weight matrix using -spmat-?


From   Maurizio Pisati <[email protected]>
To   [email protected]
Subject   Re: st: estimating spatial autocorrelation after creating a spatial neighbour weight matrix using -spmat-?
Date   Wed, 20 Nov 2013 08:08:08 +0100

Dear Dora,
you might try the following, based on datasets distributed with -spmap-:

use "Italy-RegionsData.dta", clear
drop if id>18
spmat contiguity TEST using "Italy-RegionsCoordinates.dta", id(id) replace
spmat summarize TEST, links
spmat export TEST using "TEST.txt", noid replace
insheet using "TEST.txt", delim(" ") clear
drop in 1
save "TEST.dta", replace
use "Italy-RegionsData.dta", clear
spatwmat using "TEST.dta", name(Ws) standardize
drop if id>18
spatgsa fortell, weights(Ws) moran


Note: regions 19 and 20 are dropped to simplify the example (they are islands).
Best wishes,
Maurizio



Il giorno 20/nov/2013, alle ore 07.12, Dora Pearce ha scritto:

> Dear Stata list,
> 
> I used -spmat- from SSC in Stata 12.1 to create a contiguity spatial-weight matrix identifying neighbouring areal units based on adjacency of boundaries.
> 
> As a result, 18 islands were identified, after which I used code kindly posted by Rafal Raciborski (StataCorp) [http://www.stata.com/statalist/archive/2013-09/msg00947.html] to fill these, and saved the spmat object:
> 
> . spmat save Q06sla_snmnn1 using Q06sla_snmnn1.spmat, replace
> 
> using the summarize command shows the details:
> . spmat summarize Q06sla_snmnn1, links
> 
> Summary of spatial-weighting object Q06sla_snmnn1
> --------------------------------------------------
>        Matrix |                      Description
> ---------------+----------------------------------
>    Dimensions |                        478 x 478
>     Stored as |                        478 x 478
> Links         |
>         total |                             2394
>           min |                                1
>          mean |                         5.008368
>           max |                               14
> --------------------------------------------------
> 
> 
> I would like to estimate local and global spatial autocorrelation of various health and demographic factors eg. FD_infpneum ( a continuous variable with some zeros)
> 
> Can matrices created using -spmat- be converted to the equivalent of matrices created using -spatwmat- so that I can use
> -spatgsa- and -spatlsa- [currently not compatible as shown below...]?
> 
> . spatgsa FD_infpneum, weights(Q06sla_snmnn1) moran
> ""Matrix Q06sla_snmnn1 does not exist""
> 
> In contrast 
> . spmap FD_infpneum using Qld06SLAcoord.dta, saving(Finfpneum_Q)  ///
> id(Qld06SLAid) clmethod(boxplot) ///
> title("Female influenza diagnoses 2003-2010")
> 
> works perfectly.
> 
> I would appreciate any advice to resolve this problem.
> 
> Thank you in advance,
> Dora
> 
> Dr Dora Pearce
> Research Fellow
> Modelling and Simulation
> Centre for Epidemiology and Biostatistics
> Melbourne School of Population and Global Health
> L3, 207 Bouverie Street
> University of Melbourne VIC 3010
> Phone: +61 3 9035 3343; Fax: +61 3 9349 5815     
> Email: [email protected]
> http://www.sph.unimelb.edu.au
> 
> 
> 
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index