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
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!
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.