STATA: how does my loop replace values properly?
I am working on a scientific medical paper using the HADS-Score for assessing patients anxiety and depression.
This score consists of 14 items divided in two subscales (HADS-D, HADS-A) of 7 items with possible values from 0-3 points. I have missing data and want to replace them. According to the Score manual I have to drop the observation, if i have more than one missing item in one subscale. If only one item is missing per subscale, I can replace the missing item by the mean of the present six items.
i have the HADS-Score items per observation stored in following variables: