Good morning,
I have a data set like this. I want to know mean number of visit per patient. Same Incidentid and different visdate means same patient visiting clinic more than one time on different dates.
How to code for the result i want?
IncidentID VISDATE 1 7/3/2017 2 7/3/2017 3 7/5/2017 4 7/5/2017 5 7/5/2017 6 7/7/2017 6 7/5/2017 7 7/5/2017 8 7/5/2017 8 7/7/2017 9 7/5/2017 10 7/6/2017 11 7/6/2017 12 7/6/2017 12 7/17/2017 13 7/6/2017 14 7/7/2017 15 7/12/2017
Hope this helps
data have;
input IncidentID VISDATE:mmddyy10.;
cards;
1 7/3/2017
2 7/3/2017
3 7/5/2017
4 7/5/2017
5 7/5/2017
6 7/7/2017
6 7/5/2017
7 7/5/2017
8 7/5/2017
8 7/7/2017
9 7/5/2017
10 7/6/2017
11 7/6/2017
12 7/6/2017
12 7/17/2017
13 7/6/2017
14 7/7/2017
15 7/12/2017
;
proc sort data=have nodupkey;
by IncidentID VISDATE;
run;
proc freq data=have;
table IncidentID/out=want;
run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.