BookmarkSubscribeRSS Feed
Malk020
Fluorite | Level 6

Please, anyone, help me with the question!
I spent days but I could not do it!
Thank you

 

  1. create another dataset that schedules subjects for their next three visits, once every 30 days starting at the baseline visit date, for a total of four visits per subjects. Each of the visits should appear as a new observation with the original subject information, the median grouping, the corresponding visit date, and a visit number (0, 1, 2, or 3).

 


What I did was created variables with visit1, visit2 and visit 3. I do not think it's correct at all because she wants 30 days between each visit.

 

 

* MEDIAN;
PROC MEANS DATA = INFO MEAN MEDIAN Q3 Q1;
VAR B_Cholesterol; RUN;
PROC UNIVARIATE DATA = INFO;
VAR B_Cholesterol; RUN;
proc sql;
create table want as
select Median(B_Cholesterol) as med
from info;
quit;
*to create a variable that groups subjects as less than or equal to
the median, or more than the median;
PROC SQL;
create table want as
select B_Cholesterol as median
from info
where B_Cholesterol >= 220;
quit;
*Creating visit number for longitudinal data;
DATA vis;
set info;
Visit1=1;
Visit2=2;
Visit3=3;
RUN; PROC PRINT DATA = vis; run;

 

 

2 REPLIES 2
tarheel13
Rhodochrosite | Level 12

no, that does not look correct. can you post your sample data? you might want to look up intnx function.

PaigeMiller
Diamond | Level 26

 

  1. create another dataset that schedules subjects for their next three visits, once every 30 days starting at the baseline visit date, for a total of four visits per subjects. Each of the visits should appear as a new observation with the original subject information, the median grouping, the corresponding visit date, and a visit number (0, 1, 2, or 3).

 

Something like this:

 

data want;
    set have;
    do visit_number=0 to 3;
        visit_date=baseline_date+30*visit_number;
        output;
    end;
    format visit_date date9.;
run;
    

 

 

I don't know what "median grouping" means, so I didn't address that part of the problem.

 

--
Paige Miller

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 360 views
  • 0 likes
  • 3 in conversation