Dear All,
I want to impute the missing obs with previous value, but have no idea, though I referred below good link: https://communities.sas.com/t5/SAS-Programming/Last-Observation-Carried-Foward/m-p/309339#M66511
Yes, all the missing variable should be imputed from the previous value, as this would be the accumulative number of subjects till some timepoint.
The datafile in xlsx has been attached.
Thank you.
The generic way to carry over is this:
data want;
set have;
retain _var1;
if var1 ne . /* if var1 is numeric, otherwise "" */
then _var1 = var1;
else var1 =_var1;
drop _var1;
run;
Please post example data in usable form, as shown here
The generic way to carry over is this:
data want;
set have;
retain _var1;
if var1 ne . /* if var1 is numeric, otherwise "" */
then _var1 = var1;
else var1 =_var1;
drop _var1;
run;
Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.
Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.
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.