Giter Club home page Giter Club logo

sas-sankeybarchart's People

Contributors

srosanba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sas-sankeybarchart's Issues

Errors with RAWTOSANKEY

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.

Legend options

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.