From: Matt C on
Hi All,
I am working with a scale that I need to average, (., 0,1,2,3,4). I
set up a test using Mean(x,y) vs (x+y)/2. I am trying this approach
because I would like the ability to weed out the missing data obs so
they do not affect the averages. Maybe someone else can, but I can't
tell whether the MEAN statement or the 'Addition' will help me in this
regard with missing data. Or, Should I put in an 'IF...THEN'
statement to look for missing data or what?

Cheers,
M
From: Tom Abernathy on
On Apr 24, 1:07 pm, Matt C <matt.curcio...(a)gmail.com> wrote:
> Hi All,
> I am working with a scale that I need to average, (., 0,1,2,3,4).  I
> set up a test using Mean(x,y) vs (x+y)/2.  I am trying this approach
> because I would like the ability to weed out the missing data obs so
> they do not affect the averages.   Maybe someone else can, but I can't
> tell whether the MEAN statement or the 'Addition' will help me in this
> regard with missing data.  Or, Should I put in an 'IF...THEN'
> statement to look for missing data or what?
>
> Cheers,
> M

Look at the N or NMISS statement to find out how many values or
missing values you have.
A lot of scales allow computation when the number of missing values is
less than either a fixed number or a fixed percentage of the items
that contribute to the scale.
For example if the rule is to allow scoring as long as at least 75% of
items are answered then you could code like this:

array q q1-q10;
if (nmiss( of q(*)) / dim(q)) > 0.25 then qscore = . ;
else qscore = sum(of q(*)) * dim(q) / n(of q(*)) ;


From: Dav Vandenbroucke on
On Sat, 24 Apr 2010 10:07:41 -0700 (PDT), Matt C
<matt.curcio.ri(a)gmail.com> wrote:

>Hi All,
>I am working with a scale that I need to average, (., 0,1,2,3,4). I
>set up a test using Mean(x,y) vs (x+y)/2. I am trying this approach
>because I would like the ability to weed out the missing data obs so
>they do not affect the averages. Maybe someone else can, but I can't
>tell whether the MEAN statement or the 'Addition' will help me in this
>regard with missing data. Or, Should I put in an 'IF...THEN'
>statement to look for missing data or what?

SAS functions are designed to work as you expect, even if some of the
data are missing. Thus, MEAN(x,y,z) will return the mean of all
nonmissing values, dividing the sum by the appropriate N. It will
return missing only if all the values are missing.

Dav Vandenbroucke
davanden at cox dot net