Bookmark and Share

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

[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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index