Date: Mon, 10 May 2004 12:20:38 -0600
Reply-To: "Jose G. Benuzillo" <jose.benuzillo@hci.utah.edu>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: "Jose G. Benuzillo" <jose.benuzillo@hci.utah.edu>
Subject: Re: Missing Value Code?
Content-Type: text/plain; charset="US-ASCII"
Adapted from
http://pages.infinit.net/rlevesqu/Syntax/WorkWithMissing/ConditionallyRe
placingMissingByMean.txt
DATA LIST LIST (",")/ SEX V1 V2 V3 V4 V5.
BEGIN DATA
1,3,,5,6,7
0,1,1,,2,5
1,,5,3,9,8
0,2,2,2,,2
1,4,6,3,8
0,1,4,8,4,8
END DATA.
sort cases by sex.
aggregate outfile='c:\temp\newdata.sav'
/presorted
/break=sex
/var1 to var5=mean(V1 to v5).
match files file= * /table='c:\temp\newdata.sav'
/by sex.
do repeat orig = V1 to v5 /copy=var1 to var5.
if (missing (orig)) orig=copy.
end repeat.
exe.
delete variables var1 to var5.
exe.
Jose Benuzillo, M.A.
Huntsman Cancer Institute
Cancer Control and Population Sciences
2000 Circle of Hope
Salt Lake City, UT 84112
801.585.6610
-----Original Message-----
From: Colin Valdiserri [mailto:Colin_Valdiserri@marketstrategies.com]
Sent: Monday, May 10, 2004 11:56 AM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Missing Value Code?
Hello Everyone!
I'm looking for some example code in SPSS that will impute missing
values
based on subgroup means. That is, I would like to identify a grouping
variable and then pull the mean value from the group to fill in values
for
individuals. This needs to be done for about 40 variables across more
than 100 subgroup categories.
And then I will need to repeat this for two more projects that are
coming
up soon. So while I can envision writing this code by hand with a
little
help from Excel, it would be great if I could find something else that
could easily and rapidly do the trick.
Any help would be appreciated
Thanks,
Colin M. Valdiserri, M.A.
Marketing Sciences Analyst
Market Strategies, Inc.
colin_valdiserri@marketstrategies.com
Phone: (734) 779-6826
Huntsman Cancer Institute wishes to promote open communication while protecting confidential and/or privileged information. If you have received this message in error, please inform the sender and delete all copies.
|