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.
Related Posts with Summing across variables with conditions
Non-Inferiority between two groups with no differenceThe statistical analysis I am wanting to run is for a non-inferiority study design, where treatment …
Survey data - using command svyHello, I´m using a survey data (example below). I´m trying to understand the number of individuals …
Reshape Long HelpI'm normally pretty competent when it comes to reshaping data. However, I am running into trouble he…
Calculation of the "T" statistic for High minus (-) Low double sort portfolioI have a double sort portfolio results based on two variables (X and Y). I would like to calculate t…
Multiple linear regression with specific to general approachHello everyone, I want to regress a multiple linear regression with specific-to-general approach. D…
Subscribe to:
Post Comments (Atom)
0 Response to Summing across variables with conditions
Post a Comment