Michael833/EGRA---Intern-work — Issue #39: outtable: missing values in the table
Author: Alexandersax
Created: 2011-11-10 21:48:46+00:00
State: open

The missing values in the table were a result of sorting and collapsing. Outtable collapses each stratum down to one person in order to fill in information. However- if that selected person didn't take the test while all the rest of his stratum did, outtable would assume the rest of the stratum acted just as the selected person.

To fix this, I just made sure that outtable would only select a person who didn't take the test if there was no other option.
sort `subpops' `test' //makes sure missings go last
by `subpops': gen unique = _n // assigns uniquity to the first observation it encounters