This is more of a forvaues question, but since I am using it with maptile, I figured I would provide information about both for full context.
I have a dataset that looks something like this:
year | county | var |
1980 | 01001 | 0.4 |
1990 | 01001 | 0.3 |
1990 | 31205 | 0.5 |
1980 | 31205 | 0.6 |
I want to loop through every 5 years from 1980-2000 and create a map of var for each year. The issue I am having is not with maptile (I know that works), but with the loop. I want to display the year and the year + 4 as a range in the title of the map.
So I want the title to read "Var by County 1990 to 1994" for year =1990
This is the code I have so far:
forval i = 1980(5)2000 {
preserve
keep if year == `i'
maptile var, geo(county2014) twopt (title("Var by County,"`i' to`i+4'")legend(position(4) size (2.5)))
restore
}
Thank you!
0 Response to twopt title with for values loop--how to display range of values?
Post a Comment