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, is already up and running.

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

st: Simple mean imputation

From   "Ona McCarthy" <>
To   <>
Subject   st: Simple mean imputation
Date   Fri, 17 Aug 2012 18:09:04 +0100


A measure we are using consists of 20 items, the scoring of which is
simply a sum of all the items. It is not to be scored if more than 2
items are missing but if 1 or 2 items are missing, it calls for simple
mean imputation (I know this is an old method but the measure was
created in 1988). It's not the overall dataset mean that's imputed, but
the mean of the 18 or 19 items for each observation.

My attempt is this:

foreach var of varlist PAM1-PAM20 {
if var >=. missingcount = missingcount + 1 } if missingcount <3,
generate impflag=1, else impflag = 0

but I'm now stuck. I know this is very basic but I can't figure it out.
I'd appreciate any help,



This email has been scanned by the Symantec Email service.
For more information please visit

*   For searches and help try:

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