Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# Re: st: Scoring system

 From Maarten Buis To statalist@hsphsun2.harvard.edu Subject Re: st: Scoring system Date Mon, 23 Jul 2012 20:06:32 +0200

```I would check for missing values. If any variable has a missing value
than the sum will also contain a missing value for that observation.
So with many variables you often end up with a surprisingly large
number of missing values.

-- Maarten

On Mon, Jul 23, 2012 at 7:50 PM,  <cdenking@bidmc.harvard.edu> wrote:
>
>
> 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/

--
--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://www.maartenbuis.nl
--------------------------
*
*   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/
```