|
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: Looking up values in a 2 dimensional table
At 06:26 PM 4/17/2008, Mike Lacy wrote:
A colleague of mine has a data file with family income and family
size for a large sample, with real family income for each of a
series of years, in the wide format, e.g., something like:
famid FamSize1985 FamSize1987 FamSize1991 ... Inc1985 inc1987 Inc1991 ...
with family sizes and family incomes recorded for about 20 different
year, not at fixed intervals.
He needs to create a poverty status indicator corresponding to each
year, based on a 2 dimensional table giving poverty thresholds for
each value of year and family size. All the ways I can imagine
doing this seem relatively clumsy. (Among other things, I thought
about ways of doing this with a matrix but they would require using
the value of the family size variable as an index into the matrix,
which is beyond my ken.)
I also considered something involving reshape and merge, but that
seemed awkward as well.
Suggestions?
[...]
First, you probably mean Poverty Guideline.
Poverty Guideline is a simple, rough calculation based on family
size, income, and year.
Poverty Threshold is a more complex calculation that considers number
of children and number of elderly in addition to the other factors.
It is the "officially correct" measure, but is more complicated to compute.
Those are U.S. government standards. (USDA, I believe.)
I have ado files to calculate both of these. But for the threshold,
it works for 1997 & 1998 only.
For the guideline, it does 1982-2007.
Either of them can be "filled in" to handled other years. (And BTW,
the poverty guideline program uses a matrix.)
Write me privately if you want these. But note that there are no help
files yet.
--David Kantor
[email protected]
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/