BookmarkSubscribeRSS Feed
teja5959
Obsidian | Level 7

i hava v_have data set

 

i want data as v_want data set wise how to do  VISITNUM VISIT AVISIT AVISITN using data set v_have

2 REPLIES 2
RichardDeVen
Barite | Level 11

Why should 

Visit="UNSCHEDULED VISIT 1.1" map to AVISIT='' and AVISITN=. ?

When 

Visit="UNSCHEDULED VISIT 3.1" maps to AVISIT='Visit 3/Day 29` and AVISITN=3

 

In all other cases AVISITN is equal to AVISITNUM, so nothing to do there really.

 

A report of the WANT transformation from VISIT to AVISIT

proc freq noprint data=dl.v_want;
  tables visit * avisit / out=mapfreq;
proc print data=mapfreq; run;

Shows 

VISIT AVISIT COUNT PERCENT
UNSCHEDULED VISIT 1.1   9 .
UNSCHEDULED VISIT 2.1 Visit 2/Day 15 3 0.0693
UNSCHEDULED VISIT 3.1 Visit 3/Day 29 3 0.0693
VISIT 1 / BASELINE / DAY 1 Visit 1/Baseline 1467 33.8643
VISIT 2 / INTERIM / DAY 15 (+/- 3 DAYS) Visit 2/Day 15 1428 32.9640
VISIT 3 / END OF STUDY / EARLY TERMINATION / DAY 29 (+/- 4 DAYS) Visit 3/Day 29 1431 33.0332

 

So is the real question how to compute AVISIT given VISIT ?

teja5959
Obsidian | Level 7

v_have is raw data, by using this data create AVISIT AVISITN VISIT VISITNUM

 

for exp:could you please  look at subject 13-0036 LBORRES is Quantity not sufficient after that LBORRES  is still having values so we skip the visitnum =1 and  take visitnum =1.1

 

 

look at subject : 16-0066 visitnum  have 1 and 1.1 so we skip the 1.1 but  we want only visitnum 1 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1047 views
  • 0 likes
  • 2 in conversation