Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Scoring system


From   <cdenking@bidmc.harvard.edu>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Scoring system
Date   Mon, 23 Jul 2012 13:50:57 -0400


Hello,

I am hoping for some help creating the code for a scoring system:
I have several different variable. All my variables except for one are bina=
ry (1/0) and the one is 2/1/0. They are coded as float variables.

For every ID I am trying to create a total score with the sum of the score =
for variable1 + variable2 + variable3 + 8* variable4 + 4* variable5 + 2* va=
riable6 - 3*variable7. If variable1 is 1 then it adds to the score, if it 0=
then it doesn't. If variable7 is yes then I want subtract 3 points.

I tried with
generate total_score=3D variable1 + variable2 + variable3 + 8* variable4 + =
4* variable5 + 2* variable6 - 3*variable7
but only got missing values.

What do I need to do? Thank you very much for you help!!
Claudia

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index