I'm trying to run code from a paper to replicate results, but I keep on running into an issue.
I keep getting the feedback that r(gini) is missing for the entire code and my suspicion is that either Stata keeps trying to run ineqdeco for all of the variables at once or that ineqdeco doesn't actually store the results in r(), but I can't seem to make any headway. The excel sheet gives Gini indices on a different page, so I thought making a query to turn the data and gini indices into one worksheet would help. It hasn't changed the error message and that's the only modification I've done. I'm very much a novice at this and any help would be appreciated. Thank you!
The code is below and in the excel everything listed in foreach is a variable:
I keep getting the feedback that r(gini) is missing for the entire code and my suspicion is that either Stata keeps trying to run ineqdeco for all of the variables at once or that ineqdeco doesn't actually store the results in r(), but I can't seem to make any headway. The excel sheet gives Gini indices on a different page, so I thought making a query to turn the data and gini indices into one worksheet would help. It hasn't changed the error message and that's the only modification I've done. I'm very much a novice at this and any help would be appreciated. Thank you!
The code is below and in the excel everything listed in foreach is a variable:
Code:
*Figure 1 . prog define Programma, rclass 1. ineqdeco distribution 2. ret scalar gini= $S_gini 3. ret scalar ge0 = $S_i0 4. end import excel "C:\Users\evang\Downloads\DataFigures.xlsx", sheet("Fig1(GINI+REG)") firstrow clear foreach distribution in SantaMariaImpruneta1307 SantaMariaImpruneta1319 SantaMariaImpruneta1330 SantaMariaImpruneta1350 SantaMariaImpruneta1365 SantaMariaImpruneta1373 SantaMariaImpruneta1384 SantaMariaImpruneta1395 SantaMariaImpruneta1402 SantaMariaImpruneta1414 SantaMariaImpruneta1427 Prato1325 Prato1356 Prato1365 Prato1373 Prato1394 Prato1402 Prato1414 Prato1428 { dis "Analyzing `distribution'" gen distribution =`distribution' sum distribution, detail drop if distribution<=0 ineqdeco distribution bootstrap gini = r(gini), reps(200): Programma drop distribution } program drop Programma
Comment