Copy variables between cases using an array
Posted: May 27th, 2013, 5:14 pm
Hi I just want to see if I'm doing the right thing.
In the survey I'm batch editing, I have some rented rooms within a house that were enumerated as separate households even though they are a part of the same building. This was done on purpose. The problem is that no information on the walls or roof was collected for these rooms although it was recorded for the main house. I know that the walls and roof would be the same as the main house.
The solution I came up with was to create an array for each missing variable where the indices are the ID items and the data is the missing info. I used the following code to accomplish this:
I repeat this for each variable. Just wondering if I'm on the right track
In the survey I'm batch editing, I have some rented rooms within a house that were enumerated as separate households even though they are a part of the same building. This was done on purpose. The problem is that no information on the walls or roof was collected for these rooms although it was recorded for the main house. I know that the walls and roof would be the same as the main house.
The solution I came up with was to create an array for each missing variable where the indices are the ID items and the data is the missing info. I used the following code to accomplish this:
Code: Select all
if H8 = 2 then //if separate house with rented room
RentedRoomsH11(ED,HOUSEHOLD) = $; //populate array with info
elseif H8 = 3 then //if rented room in separate house
impute($,RentedRoomsH11(ED,HOUSEHOLD)); //impute same wall as separate house with rented room
endif;