[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: RE: -forval- with -inequal7-

From   "Andreas, Peichl" <>
To   <>
Subject   st: RE: RE: -forval- with -inequal7-
Date   Tue, 15 Jul 2008 13:49:52 +0200

Hey Lola,

>These do work when limited to 'consecutive' dates (eg 19901/19904), the >problem arises when they span  'missing' dates as there is no 19905. The >programme runs and calculates the gini for the dates up until a 'missing' >date and then stops with an error. This is not a problem with other >commands using the same dataset, but has arisen with -inequal7-.

The problem is that not all dates exist and inequal7 returns an error message when you try to use it on a zero obs subsample.

You could follow Nick Cox's advice and have a look at:

or use capture to avoid Stata stopping with an error:

g gini=.
qui forval i = 19901/20071 {
capture inequal7 income [fw=wei] if date==`i', returns
replace gini=r(gini) if date==`i'


Dr. Andreas Peichl
Cologne Center for Public Economics
University of Cologne
Chair Prof. Dr. C. Fuest
50923 Köln (Cologne), Germany
Tel.: +49 (0) 221 470 6201
Fax: +49 (0) 221 470 5060
View my research on my Author page:

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index