LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (December 2009, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 21 Dec 2009 01:13:22 -0800
Reply-To:     "Eli Y. Kling" <eli.kling@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Eli Y. Kling" <eli.kling@GMAIL.COM>
Organization: http://groups.google.com
Subject:      Re: Replace Missing Values withing Medians from each sub-groups
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset=ISO-8859-1

Try this:

data DB; input CountryCode $ COMPANYAGE; datalines; UK 10 UK . UK 12 FR 10 FR . US 20 US . US 10 ; run; proc univariate data=DB; var CompanyAge ; class CountryCode; output out=decile_CompanyAge_ pctlpts=50 pctlpre=CompanyAge_; run;quit;

proc sort data=db; by CountryCode; run; proc sort data=decile_CompanyAge_; by CountryCode; run; data DB1; merge DB decile_CompanyAge_; by CountryCode; if missing(CompanyAge) then do; CompanyAge=CompanyAge_50; Imputed=1; end; else Imputed=0; run;


Back to: Top of message | Previous page | Main SAS-L page