Quantcast
Channel: Statistics Help @ Talk Stats Forum - SAS
Viewing all articles
Browse latest Browse all 310

SAS Missing Data Imputation: Arrays + Proc STDIZE

$
0
0
Hi Guys

I came across this following code:

data dataset(drop=i);
set data;

array mi{*} mi_Ag mi_Inc
mi_WR;

array x{*} Ag Inc WR;
do i=1 to dim(mi);
mi{i}=(x{i}=.);
end;
run;

I need to understand two things:

1.) there is a column created titles "i" once this data step is run. What does that signify and why is there. The drop "i" essentially drops it but if i don't use drop option the column stays in the data set

2.) this do step is replacing all the missing values with a 1 and rest with 0. How is that happening when nothing is clearly specified in the do step as to what needs to be done. In my eyes, "do i=1 to dim(mi); mi{i}=(x{i}=.);" should simply put dots in mi(i) wherever it finds dots in x(i).

All helps is much appreciated.

Viewing all articles
Browse latest Browse all 310

Trending Articles