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
Rowtotal of Multiple Variables Conditional on Other Variables being equalHi all, Below is my data: Code: dataex ID emplperjob1 job1 input str8 ID int emplperjob1 str80 jo…
Question about marginal effects for interaction terms in probit modelHi all, I am trying to use a probit model to analyze a bunch of interaction effects for a binary de…
Multiple continuous stays into single claimHi, everyone The following claims data may include multiple stays for each person, but some stays a…
Collinearity issue for difference-in-differenceHello, I am trying to obtain signficance levels for a synthetic control method (SCM) result that I …
CRSP Wharton ResearchHi guys, I know this thread is kind of offtopic, but I think my chance is quite hight to get an ans…
Subscribe to:
Post Comments (Atom)
0 Response to Summing across variables with conditions
Post a Comment