How to replace the missing values with mean in a SAS dataset?

sas
missing_values
data_wrangling

#1

Hi all,
how to replace missing values in the input dataset with the mean values of the dat particular variable.
given below datset…

data sahil ;
input v1 v2 v3 v4 v5;
datalines;
1 . 1 . 6
2 5 2 7 7
3 . . 8 .
4 . . 9 .
5 5 5 . 10
;
run;

Regards,
sahil @ clinical


#2

Hi,

Please refer to the below link -
http://www.cghr.org/sashelp/missin-value-replacement.htm

Hope this will help.

Regard,
Aayush


#3

Thank you @Ayushmnit, good notes on SAS…
could you share more info on “How to create a self made Macro” which are self made written by some programmers for accessing and manipulating the raw datsets.

Thank You in advance


#4

Thanks @zubairsahil,
You can learn how to create a macro from many links(there are five or six unique ways to create a macro), refer to this pdf for starters -
http://www2.sas.com/proceedings/sugi28/056-28.pdf

Plus there is lot of content over sas ucla website to master sas for data manipulations and modelling -

Hope this helps.

Regards,
Aayush


#5

thanks alot ayush…