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]
st: Randomize points to map polygons using -spmap- ?
From
[email protected]
To
Statalist <[email protected]>
Subject
st: Randomize points to map polygons using -spmap- ?
Date
Tue, 16 Jul 2013 16:25:48 +0800
Hello Sergiy,
Yes, I would certainly prefer to use Stata; however there appear to be
quite a few options in R, eg -spatstat- and -rgdal- among others.
I am stymied on how to a) form a grid and b) assign properly
randomized points as you suggest. My sample frame is city data (at the
ADM3+ (commune) level).
Some typos in previous example.
******** Revised example starts here ********
* cd "User/Data/"
* open-source shapefile for Andorra(AND)
copy "http://gadm.org/data/shp/AND_adm.zip" AND_adm.zip, replace
unzipfile AND_adm.zip, replace
shp2dta using "AND_adm1", database(ADMdb) coordinates(ADMcoord) replace
use ADMdb, clear
gen cases = ceil(uniform() * 25)
desc
* use ADMcoord, clear
* desc
******** Example ends here ********
thanks for the suggestions and the Ukraine example-
cheers
Andrew Lover
___________________________________________________________
Epidemiologist
Centre for Infectious Disease Epidemiology Research (CIDER)
Saw Swee Hock School of Public Health
National University of Singapore
*
* 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/