Hello,
i need help with coding a longitudinal dataset.
I want to exclude individuals from a long format dataset which have different levels of the covariate over time, i.e., if they present a hospital type observations in one occasion as PFF system and in one another as DIRECT system, they should be excluded. if on all occasions they are only PFF or only DIRECT they should stay in the dataset. Thus, I can only keep those who do not cross between systems over time. The covariate is binary, PFF/DIREC.
Look forward to hearing from you.
TA
Try something like:
proc sql;
create table want as
select *
from have
group by patientID
having count(distinct hospitalType) <= 1;
quit;
Try something like:
proc sql;
create table want as
select *
from have
group by patientID
having count(distinct hospitalType) <= 1;
quit;
thank you ! very helpful
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.
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.