mutilevel dictionary
Posted: June 27th, 2020, 8:06 am
Is there a paper on working with multilevel dictionaries?
I´ve never done that before, all the dictionaries I´ve worked with had a single level, even if the multilevel was "embedded", or hidden, like in a dwelling/household/person structure.
What I´ve used to do was having three variables, one for each record type, occupying the same position in their specific records, to store the household number. So, the dwelling record would have a dummy_variable (not needed, just to maintain or reserve that space for sorting purposes, filling it with "00" for instance, supposing we use 2 positions for the household), then another H_HHNUMBER in the household record, and then a third variable in the person record, P_HHNUMBER.
By doing that, when processing the questionnaire, for a dwelling having more than one household, we could tie the persons to their household, and loop thru them to do some structure checking, like more that one head of the household, etc.
Now I´m starting to play with a multilevel record, and define the first level as the dwelling, and the second level as the household/person.
By doing that, the household number is the ID of the second level, and I do not have it mirrored in the two record types. So, in a batch program, as the whole questionnaire (case) in memory, how can I tie the persons to their household? I would still need another variable to do the trick, or else?
So, how the multilevel structure helps me on that?
Besides that, I do not know what I´m doing wrong, but the count and totocc seem not to be working properly, both get 0 for the fist case in the file, and then get 1 for the rest of the cases. See attached file.
I´ve never done that before, all the dictionaries I´ve worked with had a single level, even if the multilevel was "embedded", or hidden, like in a dwelling/household/person structure.
What I´ve used to do was having three variables, one for each record type, occupying the same position in their specific records, to store the household number. So, the dwelling record would have a dummy_variable (not needed, just to maintain or reserve that space for sorting purposes, filling it with "00" for instance, supposing we use 2 positions for the household), then another H_HHNUMBER in the household record, and then a third variable in the person record, P_HHNUMBER.
By doing that, when processing the questionnaire, for a dwelling having more than one household, we could tie the persons to their household, and loop thru them to do some structure checking, like more that one head of the household, etc.
Now I´m starting to play with a multilevel record, and define the first level as the dwelling, and the second level as the household/person.
By doing that, the household number is the ID of the second level, and I do not have it mirrored in the two record types. So, in a batch program, as the whole questionnaire (case) in memory, how can I tie the persons to their household? I would still need another variable to do the trick, or else?
So, how the multilevel structure helps me on that?
Besides that, I do not know what I´m doing wrong, but the count and totocc seem not to be working properly, both get 0 for the fist case in the file, and then get 1 for the rest of the cases. See attached file.