Hello,
I am working with a data set where the variables represent questions from a survey that used a Likert scale. The values for each variable are integers ranging from 1-4 for responses ranging from strongly disagree to strongly agree. The number 5 is used for the response N/A and 6 was used when there was no response (i.e. missing). I need to find the sum of the responses for all of the questions/variables but only if the response is between 1 and 4. I know the rowtotal command will give me the sum for each observation across all the variables but I only want the total to include the values 1, 2, 3 and 4, not the values 5 or 6. For instance, using the numbers in the image below, the sum for the first row should be 16, but the sum for the fifth row should be 7 (because I'm not including the 5s). I know I can't use an if statement so, is there any way to do this?
Thanks.
0 Response to Summing across variables with conditions
Post a Comment