Creating an AI Assistant for SAS Viya in 5 steps (@sassoftware/viya-assistantjs) - Part I
Recent Library Articles
Recently in the SAS Community Library: SAS' @kumardeva debunks the myth that developing AI assistants is too hard. He shows you how to use the @sassoftware/viya-assistantjs library to jump start your development.
Hi everyone, I can see all the markers in the plot, but the corresponding admission dates on the x-axis are not fully visible. How can I adjust to see every admission date? proc shewhart data=VV; xchart LOS*admission_date /Markers outtable=outtable nohlabel TOTPANELS=1; run;proc print;run; Thanks,
... View more
Hi all,
Please help me to code this. This is the dataset below-
I have 2 drugs being used for each ID i.e., SGA and DM. I have multiple start date and end dates for each ID and drug. I want to see if the DM_start falls into any of the SGA_start and SGA_end under each id. That is DM_start of period 3 can fall in the SGA_start and SGA_end of period1.
And also calculate the number of overlapping days for each time period. I want to know the no. of days for each orange period.
Thank you all in advance,
Any help would be appreciated.
... View more
I'm having difficulty writing a piece of SAS code and I'm seeking the most effective approach within SAS. I have a variable named 'type' (with values 1, 2, 3, 4) and client IDs. Essentially, I aim to create another variable called 'modified_type,' which follows these rules: If there's a single unique client ID with only 1 in the 'type' variable, then 'modified_type' should be set to 0. However, if there are multiple client IDs with the same number having 1 in the 'type' variable, 'modified_type' should be set to 1. If there are 2 in the 'type' variable, then 'modified_type' should be set to 2... and so on. I tried using the retain function so something like this: retain modified_type 0; if first.client_id then modified_type = 0; if type = '1' or type = '1st' then modified_type = 1; else if type = '2' or = '2nd' then modified_type = 2; and so on..... but these does seem to retain 0 in the type and for some reason shows as 1. Yea im note sure the best way to do this, a newbie at SAS so would even appreciate the point in the right direction:
... View more
Hi everyone,
I am writing to seek assistance with centering the values of "HR (95% CI)" in a PROC SGPLOT procedure.
Currently, in my code, the values of "HR (95% CI)" (Var name=HR2)are aligned to the left, and I would like to center them instead. However, I am unsure how to achieve this.
Below is my SAS code:
proc sgplot data=forest_subgroup_2 nowall noborder nocycleattrs dattrmap=attrmap noautolegend;
format text $txt.;
styleattrs axisextent=data;
refline ref2 / lineattrs=(thickness=13 color=cxf0f0f7);
highlow y=obsid low=CIL high=CIU;
scatter y=obsid x=hr / markerattrs=(symbol=squarefilled);
scatter y=obsid x=hr / markerattrs=(size=0) x2axis;
refline 1 / axis=x;
text x=xl y=obsid text=text / position=bottom contributeoffsets=none strip;
yaxistable subgroup / location=inside position=left textgroup=id labelattrs=(size=7)
textgroupid=text indentweight=indentWt;
yaxistable HR2 pvalue/ location=inside position=right pad=(right=15px)
labelattrs=(size=7) valueattrs=(size=7) ;
yaxis reverse display=none colorbands=odd colorbandsattrs=(transparency=1) offsetmin=0.0;
xaxis display=(nolabel) /* TYPE=LOG TYPE=LOG LOGSTYLE=LOGEXPAND LOGBASE=10 */ values=(0.0 0.5 1.0 1.5 2.0 2.5 3.0 );
x2axis label='Hazard Ratio' display=(noline noticks novalues) labelattrs=(size=8);
run;
Could you please advise me on how I can modify the yaxistable HR2 code to center align the values of "HR (95% CI)"?
Thank you very much for your attention to this matter. I look forward to your guidance.
... View more
Hi I am new to proc template . 1. I am displaying bar value at the top of bar using barlabel=true. How to display the value at the center of the bar instead of top? 2. Also, how to wrap x axis value. text variable have one value very long 3. what option in proc template i can use to display P value at the top. Thanks in advance
... View more