Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Time Adjusting Survey Data

    Hi all,

    I have a general question about Stata's ability to time adjust survey data. I am currently using the PSID, where some respondents answer income variables in units other than a year (hours, days, months, etc.). With each variable where this happens, PSID also provides a time unit variable that is categorical. For example, "Professional Practice Income" is a variable, and "Professional Practice Income - Time Units" is another variable where responses are generally categorized as

    1 - Hourly
    2 - Daily
    3 - Weekly
    4 - Bi-weekly
    5 - Monthly
    6 - Yearly

    In order to adjust each income source variable to be yearly, will I need to 'manually' do this in Stata?

    Example:

    replace profinc = profinc*12 if profinc_time == 5

    This seems like a very slow way to do things, considering I have many variables that need time adjusting for several years each. Is there a way to do this more quickly in Stata for about 30 variables over 15 years?


    Below is a data example using two variables:

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float ID int year long hprofincrep byte hprofincrept long hssitranrep byte hssitranrept
    4006 2005 0 0      0 0
    4006 2007 0 0      0 0
    4006 2009 0 0      0 0
    4006 2011 0 0      0 0
    4006 2013 0 0      0 0
    4006 2015 0 0      0 0
    4006 2017 0 0      0 0
    4006 2019 0 0      0 0
    4031 2005 0 0      0 0
    4031 2007 0 0      0 0
    4031 2009 0 0      0 0
    4031 2011 0 0      0 0
    4031 2013 0 0      0 0
    4031 2015 0 0      0 0
    4031 2017 0 0    735 5
    4031 2019 0 0    740 5
    5002 2005 0 0      0 0
    5002 2007 0 0      0 0
    5002 2009 0 0      0 0
    5002 2011 0 0 999999 9
    5002 2013 0 0      0 0
    5002 2015 0 0 999999 9
    5002 2017 0 0      0 0
    5002 2019 0 0      0 0
    5003 2005 0 0      0 0
    5003 2007 0 0      0 0
    5003 2009 0 0      0 0
    5003 2011 0 0      0 0
    5003 2013 0 0      0 0
    5003 2015 0 0      0 0
    5003 2017 0 0      0 0
    5003 2019 0 0      0 0
    5004 2005 0 0      0 0
    5004 2007 0 0    479 5
    5004 2009 0 0      0 0
    5004 2011 0 0      0 0
    5004 2013 0 0      0 0
    5004 2015 0 0      0 0
    5004 2017 0 0      0 0
    5004 2019 0 0      0 0
    5005 2005 0 0      0 0
    5005 2007 0 0      0 0
    5005 2009 0 0      0 0
    5005 2011 0 0      0 0
    5005 2013 0 0      0 0
    5005 2015 0 0      0 0
    5005 2017 0 0      0 0
    5005 2019 0 0      0 0
    5170 2005 0 0      0 0
    5170 2007 0 0      0 0
    5170 2009 0 0      0 0
    5170 2011 0 0      0 0
    5170 2013 0 0      0 0
    5170 2015 0 0      0 0
    5170 2017 0 0      0 0
    5170 2019 0 0      0 0
    5177 2005 0 0      0 0
    5177 2007 0 0      0 0
    5177 2009 0 0      0 0
    5177 2011 0 0      0 0
    5177 2013 0 0      0 0
    5177 2015 0 0      0 0
    5177 2017 0 0      0 0
    5177 2019 0 0      0 0
    5181 2005 0 0      0 0
    5181 2007 0 0      0 0
    5181 2009 0 0      0 0
    5181 2011 0 0      0 0
    5181 2013 0 0      0 0
    5181 2015 0 0      0 0
    5181 2017 0 0      0 0
    5181 2019 0 0      0 0
    6004 2005 0 0      0 0
    6004 2007 0 0      0 0
    6004 2009 0 0      0 0
    6004 2011 0 0      0 0
    6004 2013 0 0      0 0
    6004 2015 0 0      0 0
    6004 2017 0 0      0 0
    6004 2019 0 0      0 0
    6006 2005 0 0      0 0
    6006 2007 0 0      0 0
    6006 2009 0 0      0 0
    6006 2011 0 0      0 0
    6006 2013 0 0      0 0
    6006 2015 0 0      0 0
    6006 2017 0 0      0 0
    6006 2019 0 0      0 0
    6032 2005 0 0      0 0
    6032 2007 0 0      0 0
    6032 2009 0 0      0 0
    6032 2011 0 0      0 0
    6032 2013 0 0      0 0
    6032 2015 0 0      0 0
    6032 2017 0 0      0 0
    6032 2019 0 0      0 0
    6170 2005 0 0      0 0
    6170 2007 0 0      0 0
    6170 2009 0 0      0 0
    6170 2011 0 0      0 0
    end
    label values hprofincrept ER73090L
    label def ER73090L 0 "Inap.:  no income from professional practice or trade in 2018 (ER73088=5); DK, NA, or RF whether had income from professional practice or trade in 2018 (ER73088=8 or 9); amount of income from professional practice or trade in 2018 i
    > s zero (ER73089=0)", modify
    label values hssitranrept ER73195L
    label def ER73195L 0 "Inap.:  Reference Person wages/salary in 2018 greater than $25,000 (ER73175=5); did not receive income from SSI in 2018 (ER73192=5); DK, NA, or RF whether received income from SSI in 2018 (ER73192=8 or 9); received SSI for someone e
    > lse only in 2018 (ER73193=1)", modify
    label def ER73195L 5 "Month", modify
    label def ER73195L 9 "NA; refused", modify
    Many thanks!
    Cora
Working...
X