comp.soft-sys.sas - The SAS statistics package.
Hi, I am comparing two datasets with proc compare. In the report I exported from SAS, those mismatched characters were marked as X, while those mismatched numeric values were recorded as difference. When compare two numeric values (one is missing and the other one is nonmissing), it did not give out any indication in the report (i.e. no X and no difference in DIF). My question is that is there any way to output the difference when comparing one missing value with one nonmissing value? thanks a lot. Lin
Hi all, I need to fill missing values with the values of the previous observation by the same group. The code bellow provides the answer. However I have about 10 variables I have to fill so I wonder if there is a more efficiant solution. Thanks, Josip data xy; input x x1 x2 y $; datalines; 1 2 3 A 2 3 4 A 3 . . A 4 5 6 A 5 . . B . . . B 7 8 9 B 8 9 10 B ; proc sort data=xy; by y; run; data xy1; set xy; array v(3) x x1 x2; retain _x _x1 _x2; by y; if first.y then do; _x=x; _x1=x1; _x2=x2; end; else do; if missing(x) or missing(x1) or missing(x2) then do; x=_x; x1=_x1; x2=_x2; end; else do; _x=x; _x1=x1; _x2=x2; end; end; drop _x _x1 _x2; run; proc print data=xy1; run;
Not sure if I understand you question correctly. Anyway here is mine: data xx; input e a b c; cards; 0 . 1 2 0 . 2 . 0 1 . 3 1 . 1 2 1 . 2 . 1 . . 3 1 1 1 2 1 . 2 . 1 . . 3 2 . 1 2 2 . 2 . 2 . . 3 2 . 1 2 2 . 2 . ; proc sql; select count(case when e=2 then e else . end) as e2cnt, case when nmiss(a) = calculated e2cnt then 'Yes' else 'No' end as a, case when nmiss(b) = calculated e2cnt then 'Yes' else 'No' end as b, case when nmiss(c) = calculated e2cnt then 'Yes' else 'No' end as c from xx ; e2cnt a b c ----------------------- 5 No No Yes So there are 5 obs with e=2. A has 12 missing so A=No. B has 4 missing also get a No. C has 5 missing which equal to the number of obs of e=2, therefore c=Yes. Ya On Wed, 24 May 2006 10:03:51 -0700, divinedst < XXXX@XXXXX.COM > wrote: >I have a dataset of about 500 variables that I would like to verify if >the number of missing values for each seperate variable equal to the >value within a particular variable. Example: Variable A has 1000 >missing values, Variable B has 200 missing values, Variable C has 2500 >missing values; >Variable E has value ranges >0,1,2 and the frequency for Variable E looks like: >0 500 >1 300 >2 600 >I am trying to verify that variable A missing values (1000) equal to >where variable E=2 (600) and do this for every variable in the dataset. >In this case, the two are not equal and this is what I need to know for >every variable in the dataset. > >Let me know if this isn't clear.
Hi, I'm working with a national survey that has the missing values set as .L and .M- (I'm not sure whether this is some kind of a format as these show up as . missing in frequencies etc.)- is there a general statement that I can use to remove these from the 100+ variables in the dataset- such as format _all_ for real formats? The reason I need to do this is that I'm running an imputation using IVEWARE (SAS callable procedure)- and for some reason- this program doesn't like the .L and .M's ps: Any users of IVEWARE on this list- willing to humor a few questions? Thank you, Mah-J M. Soobader, PhD STATWORKS www.statworks.com