rhoinc / sas-sankeybarchart Goto Github PK
View Code? Open in Web Editor NEWA set of SAS macros for creating longitudinal bar charts with Sankey-style overlays.
License: Other
A set of SAS macros for creating longitudinal bar charts with Sankey-style overlays.
License: Other
Hi there, is it possible to draw lines for each colored lineage block for each subject?
I'm trying to run the macros on SAS EG 7.1 but getting errors.
I am using the dataset from the pdf. So I first run
data dummy;
do subject = 1 to 100;
do visit = -1, 12, 30, 60;
random = rannor(1) + 0.5 + (visit+1)/30;
riskfactors = min(3,floor(abs(random)));
output;
end;
end;
run;
And then I run RAWTOSANKEY macro with no issues.
However, after I run this code:
%rawtosankey (data=dummy ,subject=subject ,yvar=riskfactors ,xvar=visit ,yvarord=%str(0, 1, 2, 3) ,xvarord=%str(-1, 12, 30, 60) );
I get errors and first one is this:
MPRINT(RAWTOSANKEY): proc sql noprint;
NOTE: Line generated by the invoked macro "RAWTOSANKEY".
32 ;
_
22
76
MPRINT(RAWTOSANKEY): select count(distinct subject) into :subject_n ;
ERROR 22-322: Syntax error, expecting one of the following: ',', -, FROM, SEPARATED, THROUGH, THRU, TRIMMED.
ERROR 76-322: Syntax error, statement will be ignored.
The last error is this:
WARNING: Apparent symbolic reference DEBUG not resolved. ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was: &debug eq no ERROR: The macro RAWTOSANKEY will stop executing.
The interesting thing is that it still creates the Nodes and Links datasets. But I have problem later trying %sankey macro.
Currently using the macro to output sankey plots showing transitions from one method of contraception to another. Since the methods of contraception are not numeric, it's proven difficult to order the legend labels in the order of the stacked bar chart (e.g. Sexually Active not protected at the top, followed by IUD, Implant, Injectable, Oral Contraceptive Pills, Condoms, Not Sexually Active). The option reverseauto reverses the order of the legend, while the options ascending or descending alphabetize the order of the legend. An update to the macro that offers more flexible coding (e.g. using the numeric codes to order but using the assigned formats for the legend) would be amazing. Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.