Combining categorical (dich or nominal) variables to make cumulative scores

Combining categorical (dich or nominal) variables to make cumulative scores

by A. Clemenzi-Allen -
Number of replies: 1

Hi! Thanks all for taking the time to respond to these last minute requests. I'm wondering if you have any idea how to combine multiple categorical variables to make one variable with a cumulative score. For instance, I have three variables in which the amount of days are reported (0-7) spent sleeping in a shelter (call this x1), sleeping on the streets (call this x2), sleeping in a car/vanc (call this x3). From online discussions and lectures, I couldn't tell which stata 14 command to use.

Much appreciated!

Asa

In reply to A. Clemenzi-Allen

Re: Combining categorical (dich or nominal) variables to make cumulative scores

by Yiwey Shieh -

If your cumulative score is the total number of days sleeping in each location, you can use

gen totaldays = x1 + x2+ x3

as long as your days are coded as numerical, and not string, for each of the x variables.