Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 72764

spgrid problem - block should be at least 1 r(498)

$
0
0
I’m trying to implement with my own data a kernel density estimation like in Pissati 2008 (pag. 2008)

This are my data files.

Array Array

http://www.stata.com/meeting/italy12...t12_pisati.pdf

I’ve been stuck with the spgrid command. I‘m receiving an error while trying to use the command: spgrid in Stata SE v13. The error says: "block should be at least 1" r(498)
My code is like this:


Code:
shp2dta using distrito, database("pandb.dta") coordinates("pancoord.dta") genid(id) gencentroids(stub) replace

use pandb, clear

spmap using pancoord.dta, id(id) fcolor(eggshell) split

save coords, replace

spgrid using pancoord.dta, resolution(w500) dots compress unit(meters) cells("cells.dta") points("points.dta") mapid(spgrid_mapid) replace
* the rest of my code will be
*use "pandb", clear
* spkde PMUJ PTOT using "GridPoints.dta", xcoord(x_stub) ycoord(y_stub) bandwidth(fbw) fbw(100) dots saving("Kde.dta", replace)
* use "Kde.dta", clear
* generate ratio = PMUJ_lambda /PTOT_lambda * 100
* spmap ratio using "GridCells.dta", id(spgrid_id) clnum(15) fcolor(Heat) ocolor(none ..)

I can't figure out what is wrong… the spmap command correctly draws the map but when I try to use spgrid, the error appears.

Thank you for your help.

Viewing all articles
Browse latest Browse all 72764

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>