Hours Worked Pseudocode
Note: PEHRUSL1, PEHRUSL2, and PEHRUSLT have a value of -4 for some individuals that indicates “Hours Vary”. If you are looking for average hours worked for a population, this value does not provide a number, so we exclude it.
Variables: HRMONTH, HRYEAR4, PWSSWGT, PEMLR, PEHRUSLT, PEHRACTT
If PEMLR is 1 or 2 and PEHRUSLT>0
Average usual hours worked = total(PWSSWGT * PEHRUSLT)/sum(PWSSWGT) by HRMONTH and HRYEAR4
If PEMLR is 1 or 2 and PEHRACTT>0
Average actual hours worked=total(PWSSWGT * PEHRACTT)/sum(PWSSWGT) by HRMONTH and HRYEAR4