Statalist


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

st: Looking up values in a 2 dimensional table


From   Mike Lacy <Michael.Lacy@colostate.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: Looking up values in a 2 dimensional table
Date   Thu, 17 Apr 2008 16:26:13 -0600

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?

Regards,

=-=-=-=-=-=-=-=-=-=-=-=-=
Mike Lacy
Fort Collins CO USA
(970) 491-6721 office






*
* 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/




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