how do I add values together in STATA?

Re: how do I add values together in STATA?

by Sofia Verstraete -
Number of replies: 0

Ralph,

It sounds like your command is correct.  By entering 

generate RTS=var1+var2+var3

you should obtain a variable named RTS with the sum of all three.  There may however be issues with your data that could be complicating things.  First, make sure that your values in var1-var3 are numeric (they should appear in black font in the browser).  If they are a string variable STATA will not recognize them as a number to be added.  If they are red (a string variable) you will need to clean the data and destring prior to adding them up.  

Hope this helps! Let us know if it doesn't...

Sofia