Recently in the SAS Community Library: SAS' @AndyRavenna publishes the second of two posts that uses statistics and machine-learning objects in SAS Visual Analytics to address real-world business problems.
Hi everyone. I'm trying to add an at-risk table to my Kaplan-Meier curves. I'm using the survival macros code found here. If I do not use the "outside" option, everything aligns nicely. * Bring in macro;
%ProvideSurvivalMacros
%let tatters = textattrs=(size=14pt);
%let TitleText0 = "3-Year Post-Recurrence Survival" / textattrs=(size=14pt);
%let TitleText1 = &titletext0 ;
%let TitleText2 = &titletext0 ;
%let yoptions = label='Overall Survival Probability' labelattrs=(size=12pt) linearopts=(viewmin=0 viewmax=1
tickvaluelist=(0 .2 0.4 0.6 0.8 1));
%let xoptions = label='Months from Recurrence' labelattrs=(size=12pt) linearopts=(viewmin=0 viewmax=24
tickvaluelist=(0 6 12 18 24));;
%let StepOpts = lineattrs=(thickness=1);
%let LegendOpts = title=' ' location=inside across=1 autoalign=(TopRight) border=FALSE;
%let GraphOpts = attrpriority=none
DataLinePatterns=(Solid);
* 24-Apr-2024: Add number at risk;
%let AtRiskOpts = valueattrs=(size=10pt) ;
%CompileSurvivalTemplates;
ods select survivalplot;
proc lifetest data=post plots=survival(atrisk(maxlen=20 /*outside*/)=0 to 24 by 6);
format group $recur_two.;
time PRS3YrMonths*death3yr(0);
strata group;
run;
ods select all; However, if I request it to be outside the plot area, it is no longer aligned. * Bring in macro;
%ProvideSurvivalMacros
%let tatters = textattrs=(size=14pt);
%let TitleText0 = "3-Year Post-Recurrence Survival" / textattrs=(size=14pt);
%let TitleText1 = &titletext0 ;
%let TitleText2 = &titletext0 ;
%let yoptions = label='Overall Survival Probability' labelattrs=(size=12pt) linearopts=(viewmin=0 viewmax=1
tickvaluelist=(0 .2 0.4 0.6 0.8 1));
%let xoptions = label='Months from Recurrence' labelattrs=(size=12pt) linearopts=(viewmin=0 viewmax=24
tickvaluelist=(0 6 12 18 24));;
%let StepOpts = lineattrs=(thickness=1);
%let LegendOpts = title=' ' location=inside across=1 autoalign=(TopRight) border=FALSE;
%let GraphOpts = attrpriority=none
DataLinePatterns=(Solid);
* 24-Apr-2024: Add number at risk;
%let AtRiskOpts = valueattrs=(size=10pt) ;
%CompileSurvivalTemplates;
ods select survivalplot;
proc lifetest data=post plots=survival(atrisk(maxlen=20 outside)=0 to 24 by 6);
format group $recur_two.;
time PRS3YrMonths*death3yr(0);
strata group;
run;
ods select all; In the macro code, while messing around with the AtRiskLattice sections to try and fix it, I removed "xaxisopts=(display=none)." This did not fix it, but did illuminate the issue a bit. Apparently the axis for the at-risk table is not the same as the overall x-axis: Does anyone have any idea how to get these to align? Please let me know if I can provide more info.
... View more
It takes all kinds of minds on a team – people with diverse backgrounds and skill levels – to do amazing things. If you are looking to join a team, let’s find you a group. Or maybe your team needs more hackers. If so, please follow these steps:
STEP 1. Reply to this post with your search criteria. Include the follow details:
“I’m looking for a team.” or “I’m looking for a team member.”
Track name
Skills
Your LinkedIn and/or GitHub profile (if applicable)
Here’s an example:
Interest: I’m looking for a team
Track: Energy
Skills: SAS Viya
Social: https://www.linkedin.com/in/christine-brown-47425316/
STEP 2. Create your replies following this order to maintain consistency in the thread.
STEP 3. Contact a potential new teammate using the SAS Support Communities' private messaging feature to discuss if a team or member is a good fit.
STEP 4. You need to be a member of a team in order to Register.
STEP 5: If you have any edits to your team after you Register, send an email to sashackathon@sas.com. The Event Team needs to know about any changes to your team and members. Also, don’t forget to update your team profile on the SAS Hacker's Hub.
Happy hacking!
... View more
Hi I have a file uploaded to a big data platform showing correct d.p but somehow when our clients see the same file via ODBC, the decimal place change from 4 to 2, how did that happen? Do I need to setup schema for showing data via ODBC or there is specific settings required dealing with?
... View more
data test; input id fname $4. lname $5. age; cards; 123 abc1 def1 24 124 abc2 def2 25 125 abc3 def3 26 ; run;
data test2; input id state $7. county $9. ; cards; 123 state1 county1 124 state2 county2 125 state3 county3 ; run;
options orientation=landscape; ods pdf file="location\name.pdf"; Title1 "Test"; ods proclabel='';
proc report data=test contents='' headline nowindows ;by id ; columns id fname lname age; run;
proc report data=test2 contents='' headline nowindows ;by id ; columns id state county; run;
ods pdf close;
Iam looking only one table of contnets for both tables on left side ? is there any i can do and get the ouput ?
... View more
Hi all, SAS amateur here! I am trying to figure out how to create 2 new variables and assign values to each observation based on the data contained in a reference file. I have created a mock example below. The first dataset is the main one I need to keep. It contains data on individual stores and several stores will have the same corporate ID. The second dataset is a reference that contains approximately 500 Corporate IDs and addresses, including the State and City. I would like to create 2 new variables for CorpState and CorpCity in Dataset 1 based on the CorpID contained in both files. Is this even possible to do and where do I start? Any help would be greatly appreciated. Dataset 1 (Have): Main dataset with individual store information Obs# CorpID StoreID StoreState 1 4002 40021234 AL 2 4002 40021237 MS 3 4003 40035678 TN 4 4100 41007890 WV 5 4110 41103456 NC 6 4110 41103478 NC 7 4597 45972345 WA 8 4975 49750023 WY Dataset 2 (Have): Reference dataset with corporate information Obs# CorpID CorpState CorpCity 1 4002 AL Birmingham 2 4003 GA Atlanta 3 4004 TN Nashville 4 4100 SC Charleston 5 4110 NC Charlotte 6 4111 FL Tampa 7 4597 CA San Francisco 8 4975 WY Jackson Want: Dataset 1 file containing store and corporate information Obs# CorpID CorpState CorpCity StoreID StoreState 1 4002 AL Birmingham 40021234 AL 2 4002 AL Birmingham 40021237 MS 3 4003 GA Atlanta 40035678 TN 4 4100 SC Charleston 41007890 WV 5 4110 NC Charlotte 41103456 NC 6 4110 NC Charlotte 41103478 NC 7 4597 CA San Francisco 45972345 WA 8 4975 WY Jackson 49750023 WY
... View more