BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
zino
Calcite | Level 5

Because both the dose and duration of drug vary between subjects and within subjects over time

I use the time-depedent Cox regression to analyze it

However, how do I explain the consistence of drug use, that a user always a user or sometimes discontinue

I consider use of figure to explain how the dose and duration vary within individual, like the figure show as below

螢幕快照 2015-06-14 下午12.07.33.png

For example of my data and full data in the attached file. How do the sas plot the figure?  Thanks you very much

         

IDPrescribe dataDispense durationdosedate sequenceHeader 6
12000.1.1.7101

1

2000.1.15271514
12000.2.12142042
12000.2.27281557
12000.4.1281585
1 ACCEPTED SOLUTION

Accepted Solutions
Jay54
Meteorite | Level 14

ExposurePlot.png

ods graphics / reset attrpriority=color width=5in height=3in imagename='ExposurePlot';

title "Exposure by Subject Id and Date";

proc sgplot data=exposure2;

  label id='Subject id';

  label prescribe_date='Prescribe Date';

  label total_amt='Amount';

  step x=prescribe_date y=total_amt / group=id justify=right;

  keylegend / across=2 valueattrs=(size=7);

  yaxis grid;

  xaxis grid;

run;

View solution in original post

3 REPLIES 3
Jay54
Meteorite | Level 14

I am guessing on what you are asking.  Here is one solution using SAS 9.4 SGPANEL Procedure using your data.  I removed duplicates.  Code is shown below.

Exposure.png

data exposure;

  set zino.exposure;

  format prescribe_date date9.;

run;

proc sort data=Exposure out=Exposure2 nodupkey;

by id prescribe_date;

run;

ods graphics / reset width=5in height=6in imagename='Exposure';

title "Exposure by Subject Id and Date";

proc sgpanel data=exposure2;

label id='Subject id = ';

label prescribe_date='Prescribe Date';

label total_amt='Amount';

panelby id / layout=rowlattice rows=4 columns=1 onepanel noheader;

step x=prescribe_date y=total_amt / justify=right;

inset id / position=topleft textattrs=(size=10);

rowaxis offsetmax=0.2 grid;

colaxis grid;

run;

zino
Calcite | Level 5

Thank you very much, It is what I want. Smiley Happy

Is it possible to put all individuals figure in one figure?   :smileyconfused:

Jay54
Meteorite | Level 14

ExposurePlot.png

ods graphics / reset attrpriority=color width=5in height=3in imagename='ExposurePlot';

title "Exposure by Subject Id and Date";

proc sgplot data=exposure2;

  label id='Subject id';

  label prescribe_date='Prescribe Date';

  label total_amt='Amount';

  step x=prescribe_date y=total_amt / group=id justify=right;

  keylegend / across=2 valueattrs=(size=7);

  yaxis grid;

  xaxis grid;

run;

SAS INNOVATE 2024

innovate-wordmarks-white-horiz.png

SAS is headed back to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team.

Interested in speaking? Content from our attendees is one of the reasons that makes SAS Innovate such a special event!

Submit your idea!

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1595 views
  • 3 likes
  • 2 in conversation