Please, anyone, help me with the question!
I spent days but I could not do it!
Thank you
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;
no, that does not look correct. can you post your sample data? you might want to look up intnx function.
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.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: