Hi SAS Users,
I am new to SAS, so I have two questions disturbing me quite a bit:
1. With the code below:
data screen8;
set aus_merge2;
if s3 ge 0;
run;
And there are some missing observations in variable s3 in dataset aus_merge2. I am wondering if, in dataset screen8, SAS will delete all observations smaller than 0 and all missing observation from aus_merge2?
2. In a linear regression using OLS: y = ax1 + bx2 + cx3 +...
so, in the same observation, when any in y, x1,x2,x3, x4 is missing, the program will ignore totally this observation?
Many thanks and warm regards,
1) Numeric variable, missing value is the lowest value.
You can check for missing value by:
if var eq . then ... /* compare to a dot */
/* or by */
if missing(var) then ...
2) An outcome of computation with missing value is missing value,
except when using sum(of var1, var2, .....) then it will ignore missing
values and treat then as zero, or in some procedures where you can
choose an option how to treat missing value.
1) Numeric variable, missing value is the lowest value.
You can check for missing value by:
if var eq . then ... /* compare to a dot */
/* or by */
if missing(var) then ...
2) An outcome of computation with missing value is missing value,
except when using sum(of var1, var2, .....) then it will ignore missing
values and treat then as zero, or in some procedures where you can
choose an option how to treat missing value.
Hi @Shmuel ,
thank you for your dedicated answer. So, you mean, missing observation even smaller than negative value as you say it is the lowest value, did I explain you properly ?
True, missing value is even smaller than any negative value.
Hi @Shmuel ,
Thank you for your confirm, a further question is what is this code for ?
if var eq . then ... /* compare to a dot */
/* or by */
if missing(var) then ...
Because of the missing observation will display ".", but why you let "..." compare to the dot ( I do not know why we need to compare to the dot) ? Thank you!
A missing value is displayed as a dot without the quotation marks.
I use ...to say " add any wanted code " following the THEN.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.