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
Dora Pearce <[email protected]>
To
"[email protected]" <[email protected]>
Subject
RE: st: estimating spatial autocorrelation after creating a spatial neighbour weight matrix using -spmat-?
Date
Wed, 20 Nov 2013 23:30:22 +0000
Dear Maurizio,
Thank you so much, you have solved my problem perfectly!
And it was finding your overview of spatial data analysis in Stata on the web [http://www.stata.com/meeting/italy12/abstracts/materials/it12_pisati.pdf] that made me aware that spatial data analysis was possible using Stata - so thank you again.
Best wishes
Dora
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Maurizio Pisati
Sent: Wednesday, 20 November 2013 6:08 PM
To: [email protected]
Subject: Re: st: estimating spatial autocorrelation after creating a spatial neighbour weight matrix using -spmat-?
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/
*
* 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/