Hi, I am new to Stata, so please appologize my basic question - any help would be highly appreciated!
I have a dataset from a questionnaire on musculoskeletal disorders.
The questionnaire repeat itself in case of multiple injuries- and my question is how I can sum up these scores by creating a new variable with the total sum.
Example: q15: Was it an acute injury, or did it develop over time? 1= acute, 2= overuse injury
question q25 is identical conserning a second injury
question q35 is identical conserning a third injury and same with the forth and fifth injury
So I want to create a varible with the total sum 3 acute and 7 overuse injuries.
I have tried without any luck (or more precise; I manage to create the variable, but it doesn't give me the sum I am looking for):
generate OceruseAcuteALL = q15+q25+q35+q45+q55
egen OceruseAcuteALL= concat (q15 q25 q35 q45 q55)
egen byte OceruseAcuteALL= anycount( q15 q25 q35 q45 q55), values (1 2)
They all seem to sum up, mixing 1'ers and 2'ers, treating them as continous? - but I want to separate 1'ers (acute) and 2'ers (overuse)
I have the same problem for example with the question on witch bodypart that is injured: q16+q26+q36+q46+q56 where each bodypart have the same value label for each question, i.e. low back pain have value 8. I want to find how many problems in total wiht low back pain, how many shoulder etc.
I am superhappy if anyone can give me a hint on how to do it.
Best regards
Rannveig
I have a dataset from a questionnaire on musculoskeletal disorders.
The questionnaire repeat itself in case of multiple injuries- and my question is how I can sum up these scores by creating a new variable with the total sum.
Example: q15: Was it an acute injury, or did it develop over time? 1= acute, 2= overuse injury
question q25 is identical conserning a second injury
question q35 is identical conserning a third injury and same with the forth and fifth injury
q15 | q25 | q35 | q45 | q55 | sum | |
id1 | acute | overuse | overuse | overuse | overuse | 1 acute 4 overuse |
id2 | overuse | acute | 1 acute 1 overuse | |||
id3 | acute | overuse | overuse | 1 acute 2 overuse | ||
3 acute 7 overuse |
I have tried without any luck (or more precise; I manage to create the variable, but it doesn't give me the sum I am looking for):
generate OceruseAcuteALL = q15+q25+q35+q45+q55
egen OceruseAcuteALL= concat (q15 q25 q35 q45 q55)
egen byte OceruseAcuteALL= anycount( q15 q25 q35 q45 q55), values (1 2)
They all seem to sum up, mixing 1'ers and 2'ers, treating them as continous? - but I want to separate 1'ers (acute) and 2'ers (overuse)
I have the same problem for example with the question on witch bodypart that is injured: q16+q26+q36+q46+q56 where each bodypart have the same value label for each question, i.e. low back pain have value 8. I want to find how many problems in total wiht low back pain, how many shoulder etc.
I am superhappy if anyone can give me a hint on how to do it.
Best regards
Rannveig
Comment