Hi, i need help in imputing categoriacla variables.. i tried below code but im not sure which value to use on the 'method' option...i have a variable called 'marital status' consistin of values 'single, married,widowed'...i need to do something like mode imputation
proc stdize data=data out=Imputed oprefix=Orig_ /* prefix for original variables */ reponly /* only replace; do not standardize */ method=; /*ABW, AGK, AHUBER, AWAVE, EUCLEN, IN,IQR, LEAST, MAD, MAXABS, MEAN, MEDIAN, MIDRANGE, RANGE, SPACING, STD, SUM, UST*/ var Marital_status; run;
Hello
Imputing character variables has been discussed in this forum topic. Suggest have a look there
https://communities.sas.com/t5/SAS-Programming/Imputing-missing-values-of-character-variables-in-a-l...
From the PROC STDIZE documentation:
VAR Statement
VAR variable;
The VAR statement lists numeric variables to be standardized. If you omit the VAR statement, all numeric variables not listed in the BY, FREQ, and WEIGHT statements are used.
So PROC STDIZE cannot be used on character variables.
To determine the mode of a class variable, you can do this in PROC FREQ and then once you have found the mode, replace missings in your data set with the calculated mode.
I fully agree, i tried below code...i initially had 24000 rows before applying below code..but thereafter executing the below code my data multiplied to 505000 rows..kindly assist @Rick_SAS
proc mi data=final_data seed=1305417 out=outex7; class Existing_cover Marital_status Lead_type; fcs discrim(Existing_cover Marital_status Lead_type/details) reg(height_new/details); var Existing_cover Marital_status Lead_type height_new; run;
You need to decide what kind of imputation you want. Originally, you asked about PROC STDIZE, which performs single imputation: missing values of numerical variables are replaced by a value or by a statistic such as the mean or median. But now you are talking about PROC MI, which performs multip[le imputation.
A paper by Paul Allison discusses the various imputation methods for various assumptions of missingness.
Hello
Imputing character variables has been discussed in this forum topic. Suggest have a look there
https://communities.sas.com/t5/SAS-Programming/Imputing-missing-values-of-character-variables-in-a-l...
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.