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]

st: Some questions regarding spmap


From   "Francesco Pastore" <francesco.pastore@unina2.it>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Some questions regarding spmap
Date   Mon, 28 Jan 2013 12:59:14 +0100

Dear Statalists,

I have two little questions related to spmap.
I am using the attached data file. It is a panel of Italian regions observed
over the years from 2004 to 2010. For each region, we have a measure of the
Lilien index every year. In total, there are 3 variables: year, region,
lilien. 

1) I would like to make a figure with maps of regions by the value of the
Lilien index by years. I can make a figure for a single year, using the
following command:

spmap freq_li using "Italy-RegionsCoordinates.dta" if year==2005, id(reg)
fcolor(bluishgray cyan blue navy) title("Lilien index", size(*0.8))        
///
             subtitle("Italy, value relative to 2005" " ", size(*0.8))
legstyle(2) legend(region(lcolor(black))) clmethod(eqint) clnumber(5)

To get 6 small maps by year, I simply add by(year):

spmap freq_li using "Italy-RegionsCoordinates.dta" if year>2004, id(reg)
fcolor(bluishgray cyan blue navy) title("Lilien index", size(*0.8))        
///
             subtitle("Italy, value relative to 2005" " ", size(*0.8))
legstyle(2) legend(region(lcolor(black))) clmethod(eqint) clnumber(5)
by(year)

However, I get the following error message: 

Variable reg specified in option id() does not uniquely identify the
observations

I would very much appreciate if you could help me with this. I suppose that
the problem is that I need to tell stata that this is a panel. I have tried
running the following command:

sort reg year
tsset reg year

but the problem is not solved. 

2) How can I reduce down to two decimals the range of variation of the
Lilien index in the legend of the map? 

Thank you in advance for your attention
Francesco 

--
Dr. Francesco Pastore
Assistant Professor of Economics, Seconda Università di Napoli 
Palazzo Melzi, Piazza Matteotti, I-81055, Santa Maria Capua Vetere
(Caserta), Italy
Tel./Fax.: +39.0823.275530 (Office); and +39.081.199.72951 (Home1);
+39.081.5495276 (Home2); 
Mobile: +39.3498720406
Email: francesco.pastore@unina2.it;
www.giurisprudenza.unina2.it/news.php?nid=185&pagina=2

Research fellow, IZA (Institute for the Study of Labour)
www.iza.org/profile?key=692

Attachment: lilien_index.dta
Description: Binary data



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