<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Surveylogistic graphics in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Surveylogistic-graphics/m-p/486207#M25184</link>
    <description>&lt;P&gt;Unfortunately not seeing a default way from SurveyLogistic which is weird given that it's pretty developed. Hopefully I'm wrong, I'll move the question to Stats Procs forum and hopefully someone else can clarify.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyways, here's a workaround for now. This is from the example in the docs and you may need slightly modifications for your data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The graph code is from the same link as in your original post and the PROC code is from the documentation. &amp;nbsp;Basically, I capture the OddsRatio estimates and plot them in a new procedure. I do have to create a variable that includes all the levels in a single variable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*-----------------------------------------------------------------
S A S   S A M P L E   L I B R A R Y

NAME: SVLEX1
TITLE: Documentation Example 1 for PROC SURVEYLOGISTIC
PRODUCT: STAT
SYSTEM: ALL
KEYS: logistic regression, survey sampling
KEYS: link functions, stratification, clustering
KEYS: unequal weighting, categorical data analysis
PROCS: SURVEYLOGISTIC
DATA:

SUPPORT: sasaba
REF: PROC SURVEYLOGISTIC, Example 1

MISC: Logistic Regression with Different Link
Functions for Stratified Cluster Sampling
-----------------------------------------------------------------*/
proc format;
    value Class 1='Freshman' 2='Sophomore' 3='Junior' 4='Senior';
run;

data Enrollment;
    format Class Class.;
    input Class _TOTAL_;
    datalines;
1 3734
2 3565
3 3903
4 4196
;

proc format;
    value Design 1='A' 2='B' 3='C';
    value Rating 1='dislike very much' 2='dislike' 3='neutral' 4='like' 
        5='like very much';
run;

data WebSurvey;
    format Class Class. Design Design. Rating Rating.;

    do Class=1 to 4;

        do Design=1 to 3;

            do Rating=1 to 5;
                input Count @@;
                output;
            end;
        end;
    end;
    datalines;
10 34 35 16 15   8 21 23 26 22   5 10 24 30 21
 1 14 25 23 37  11 14 20 34 21  16 19 30 23 12
19 12 26 18 25  11 14 24 33 18  10 18 32 23 17
 8 15 35 30 12  15 22 34  9 20   2 34 30 18 16
;

data WebSurvey;
    set WebSurvey;

    if Class=1 then
        Weight=3734/300;

    if Class=2 then
        Weight=3565/300;

    if Class=3 then
        Weight=3903/300;

    if Class=4 then
        Weight=4196/300;
run;

proc print data=WebSurvey(obs=20);
run;

ods output oddsRatios=plotData;

proc surveylogistic data=WebSurvey total=Enrollment;
    stratum Class;
    freq Count;
    class Design;
    model Rating (ref='neutral')=Design /link=glogit;
    weight Weight;
run;

*add levels in to YVar so that data is plotted correctly;
data demo;
    set plotData;
    YVar=catx(' - ', effect, Response);
run;


*example from: https://blogs.sas.com/content/iml/2015/07/29/or-plots-log-scale.html;
title "Odds Ratios with 95% Wald Confidence Limits";

proc sgplot data=demo noautolegend;
    scatter y=yVar x=OddsRatioEst / xerrorlower=LowerCL xerrorupper=UpperCL 
        markerattrs=(symbol=diamondfilled);
    refline 1 / axis=x;
    xaxis grid type=log label="Odds Ratio (log scale)";

    /* specify log scale */
    yaxis grid display=(nolabel) discreteorder=data reverse;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/225945"&gt;@Dinesh2&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am only getting the tables after running the surveylogistic command. Not the figure.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's my command:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;surveylogistic&lt;/STRONG&gt; &lt;SPAN&gt;data&lt;/SPAN&gt;&lt;SPAN&gt;=afib14lg ;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &lt;SPAN&gt;weight&lt;/SPAN&gt; DISCWT ;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;cluster&lt;/SPAN&gt; HOSP_NIS ;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;strata&lt;/SPAN&gt; NIS_STRATUM ;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;class&lt;/SPAN&gt; chronic (&lt;SPAN&gt;param&lt;/SPAN&gt;=ref &lt;SPAN&gt;ref&lt;/SPAN&gt;=&lt;SPAN&gt;'0'&lt;/SPAN&gt;)&lt;/P&gt;
&lt;P&gt;died (&lt;SPAN&gt;param&lt;/SPAN&gt;=ref &lt;SPAN&gt;ref&lt;/SPAN&gt;=&lt;SPAN&gt;'0'&lt;/SPAN&gt;)pay1 (&lt;SPAN&gt;param&lt;/SPAN&gt;=ref &lt;SPAN&gt;ref&lt;/SPAN&gt;=&lt;SPAN&gt;'1'&lt;/SPAN&gt;) female (&lt;SPAN&gt;param&lt;/SPAN&gt;=ref &lt;SPAN&gt;ref&lt;/SPAN&gt;=&lt;SPAN&gt;'0'&lt;/SPAN&gt;)&lt;/P&gt;
&lt;P&gt;aweekend (&lt;SPAN&gt;param&lt;/SPAN&gt;=ref &lt;SPAN&gt;ref&lt;/SPAN&gt;=&lt;SPAN&gt;'0'&lt;/SPAN&gt;) hosp_locteach&amp;nbsp; (&lt;SPAN&gt;param&lt;/SPAN&gt;=ref &lt;SPAN&gt;ref&lt;/SPAN&gt;=&lt;SPAN&gt;'1'&lt;/SPAN&gt;)&amp;nbsp; race (&lt;SPAN&gt;param&lt;/SPAN&gt;=ref &lt;SPAN&gt;ref&lt;/SPAN&gt;=&lt;SPAN&gt;'1'&lt;/SPAN&gt;)&amp;nbsp; ;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;model&lt;/SPAN&gt; died= chronic aweekend los pay1 female&amp;nbsp; race elixci&amp;nbsp; hosp_locteach;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 12 Aug 2018 23:50:11 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-08-12T23:50:11Z</dc:date>
    <item>
      <title>Surveylogistic graphics</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Surveylogistic-graphics/m-p/486182#M25181</link>
      <description>Hello, does anyone know how to output the graphics in proc surveylogistic. For example, the odds ratio output as in this url : &lt;A href="https://blogs.sas.com/content/iml/files/2015/07/oddsratio2.png" target="_blank"&gt;https://blogs.sas.com/content/iml/files/2015/07/oddsratio2.png&lt;/A&gt;. Thank you.</description>
      <pubDate>Sun, 12 Aug 2018 19:26:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Surveylogistic-graphics/m-p/486182#M25181</guid>
      <dc:creator>Dinesh2</dc:creator>
      <dc:date>2018-08-12T19:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: Surveylogistic graphics</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Surveylogistic-graphics/m-p/486200#M25182</link>
      <description>&lt;P&gt;What do you mean by output?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you mean get it to appear in the results or do you mean save the graph to a PDF or PNG file? or something else?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/225945"&gt;@Dinesh2&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Hello, does anyone know how to output the graphics in proc surveylogistic. For example, the odds ratio output as in this url : &lt;A href="https://blogs.sas.com/content/iml/files/2015/07/oddsratio2.png" target="_blank"&gt;https://blogs.sas.com/content/iml/files/2015/07/oddsratio2.png&lt;/A&gt;. Thank you.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Aug 2018 23:28:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Surveylogistic-graphics/m-p/486200#M25182</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-08-12T23:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: Surveylogistic graphics</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Surveylogistic-graphics/m-p/486203#M25183</link>
      <description>&lt;P&gt;I am only getting the tables after running the surveylogistic command. Not the figure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's my command:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;surveylogistic&lt;/STRONG&gt; &lt;SPAN&gt;data&lt;/SPAN&gt;&lt;SPAN&gt;=afib14lg ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &lt;SPAN&gt;weight&lt;/SPAN&gt; DISCWT ;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;cluster&lt;/SPAN&gt; HOSP_NIS ;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;strata&lt;/SPAN&gt; NIS_STRATUM ;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;class&lt;/SPAN&gt; chronic (&lt;SPAN&gt;param&lt;/SPAN&gt;=ref &lt;SPAN&gt;ref&lt;/SPAN&gt;=&lt;SPAN&gt;'0'&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;died (&lt;SPAN&gt;param&lt;/SPAN&gt;=ref &lt;SPAN&gt;ref&lt;/SPAN&gt;=&lt;SPAN&gt;'0'&lt;/SPAN&gt;)pay1 (&lt;SPAN&gt;param&lt;/SPAN&gt;=ref &lt;SPAN&gt;ref&lt;/SPAN&gt;=&lt;SPAN&gt;'1'&lt;/SPAN&gt;) female (&lt;SPAN&gt;param&lt;/SPAN&gt;=ref &lt;SPAN&gt;ref&lt;/SPAN&gt;=&lt;SPAN&gt;'0'&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;aweekend (&lt;SPAN&gt;param&lt;/SPAN&gt;=ref &lt;SPAN&gt;ref&lt;/SPAN&gt;=&lt;SPAN&gt;'0'&lt;/SPAN&gt;) hosp_locteach&amp;nbsp; (&lt;SPAN&gt;param&lt;/SPAN&gt;=ref &lt;SPAN&gt;ref&lt;/SPAN&gt;=&lt;SPAN&gt;'1'&lt;/SPAN&gt;)&amp;nbsp; race (&lt;SPAN&gt;param&lt;/SPAN&gt;=ref &lt;SPAN&gt;ref&lt;/SPAN&gt;=&lt;SPAN&gt;'1'&lt;/SPAN&gt;)&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;model&lt;/SPAN&gt; died= chronic aweekend los pay1 female&amp;nbsp; race elixci&amp;nbsp; hosp_locteach;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Aug 2018 23:33:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Surveylogistic-graphics/m-p/486203#M25183</guid>
      <dc:creator>Dinesh2</dc:creator>
      <dc:date>2018-08-12T23:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: Surveylogistic graphics</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Surveylogistic-graphics/m-p/486207#M25184</link>
      <description>&lt;P&gt;Unfortunately not seeing a default way from SurveyLogistic which is weird given that it's pretty developed. Hopefully I'm wrong, I'll move the question to Stats Procs forum and hopefully someone else can clarify.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyways, here's a workaround for now. This is from the example in the docs and you may need slightly modifications for your data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The graph code is from the same link as in your original post and the PROC code is from the documentation. &amp;nbsp;Basically, I capture the OddsRatio estimates and plot them in a new procedure. I do have to create a variable that includes all the levels in a single variable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*-----------------------------------------------------------------
S A S   S A M P L E   L I B R A R Y

NAME: SVLEX1
TITLE: Documentation Example 1 for PROC SURVEYLOGISTIC
PRODUCT: STAT
SYSTEM: ALL
KEYS: logistic regression, survey sampling
KEYS: link functions, stratification, clustering
KEYS: unequal weighting, categorical data analysis
PROCS: SURVEYLOGISTIC
DATA:

SUPPORT: sasaba
REF: PROC SURVEYLOGISTIC, Example 1

MISC: Logistic Regression with Different Link
Functions for Stratified Cluster Sampling
-----------------------------------------------------------------*/
proc format;
    value Class 1='Freshman' 2='Sophomore' 3='Junior' 4='Senior';
run;

data Enrollment;
    format Class Class.;
    input Class _TOTAL_;
    datalines;
1 3734
2 3565
3 3903
4 4196
;

proc format;
    value Design 1='A' 2='B' 3='C';
    value Rating 1='dislike very much' 2='dislike' 3='neutral' 4='like' 
        5='like very much';
run;

data WebSurvey;
    format Class Class. Design Design. Rating Rating.;

    do Class=1 to 4;

        do Design=1 to 3;

            do Rating=1 to 5;
                input Count @@;
                output;
            end;
        end;
    end;
    datalines;
10 34 35 16 15   8 21 23 26 22   5 10 24 30 21
 1 14 25 23 37  11 14 20 34 21  16 19 30 23 12
19 12 26 18 25  11 14 24 33 18  10 18 32 23 17
 8 15 35 30 12  15 22 34  9 20   2 34 30 18 16
;

data WebSurvey;
    set WebSurvey;

    if Class=1 then
        Weight=3734/300;

    if Class=2 then
        Weight=3565/300;

    if Class=3 then
        Weight=3903/300;

    if Class=4 then
        Weight=4196/300;
run;

proc print data=WebSurvey(obs=20);
run;

ods output oddsRatios=plotData;

proc surveylogistic data=WebSurvey total=Enrollment;
    stratum Class;
    freq Count;
    class Design;
    model Rating (ref='neutral')=Design /link=glogit;
    weight Weight;
run;

*add levels in to YVar so that data is plotted correctly;
data demo;
    set plotData;
    YVar=catx(' - ', effect, Response);
run;


*example from: https://blogs.sas.com/content/iml/2015/07/29/or-plots-log-scale.html;
title "Odds Ratios with 95% Wald Confidence Limits";

proc sgplot data=demo noautolegend;
    scatter y=yVar x=OddsRatioEst / xerrorlower=LowerCL xerrorupper=UpperCL 
        markerattrs=(symbol=diamondfilled);
    refline 1 / axis=x;
    xaxis grid type=log label="Odds Ratio (log scale)";

    /* specify log scale */
    yaxis grid display=(nolabel) discreteorder=data reverse;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/225945"&gt;@Dinesh2&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am only getting the tables after running the surveylogistic command. Not the figure.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's my command:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;surveylogistic&lt;/STRONG&gt; &lt;SPAN&gt;data&lt;/SPAN&gt;&lt;SPAN&gt;=afib14lg ;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &lt;SPAN&gt;weight&lt;/SPAN&gt; DISCWT ;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;cluster&lt;/SPAN&gt; HOSP_NIS ;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;strata&lt;/SPAN&gt; NIS_STRATUM ;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;class&lt;/SPAN&gt; chronic (&lt;SPAN&gt;param&lt;/SPAN&gt;=ref &lt;SPAN&gt;ref&lt;/SPAN&gt;=&lt;SPAN&gt;'0'&lt;/SPAN&gt;)&lt;/P&gt;
&lt;P&gt;died (&lt;SPAN&gt;param&lt;/SPAN&gt;=ref &lt;SPAN&gt;ref&lt;/SPAN&gt;=&lt;SPAN&gt;'0'&lt;/SPAN&gt;)pay1 (&lt;SPAN&gt;param&lt;/SPAN&gt;=ref &lt;SPAN&gt;ref&lt;/SPAN&gt;=&lt;SPAN&gt;'1'&lt;/SPAN&gt;) female (&lt;SPAN&gt;param&lt;/SPAN&gt;=ref &lt;SPAN&gt;ref&lt;/SPAN&gt;=&lt;SPAN&gt;'0'&lt;/SPAN&gt;)&lt;/P&gt;
&lt;P&gt;aweekend (&lt;SPAN&gt;param&lt;/SPAN&gt;=ref &lt;SPAN&gt;ref&lt;/SPAN&gt;=&lt;SPAN&gt;'0'&lt;/SPAN&gt;) hosp_locteach&amp;nbsp; (&lt;SPAN&gt;param&lt;/SPAN&gt;=ref &lt;SPAN&gt;ref&lt;/SPAN&gt;=&lt;SPAN&gt;'1'&lt;/SPAN&gt;)&amp;nbsp; race (&lt;SPAN&gt;param&lt;/SPAN&gt;=ref &lt;SPAN&gt;ref&lt;/SPAN&gt;=&lt;SPAN&gt;'1'&lt;/SPAN&gt;)&amp;nbsp; ;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;model&lt;/SPAN&gt; died= chronic aweekend los pay1 female&amp;nbsp; race elixci&amp;nbsp; hosp_locteach;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Aug 2018 23:50:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Surveylogistic-graphics/m-p/486207#M25184</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-08-12T23:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: Surveylogistic graphics</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Surveylogistic-graphics/m-p/486209#M25185</link>
      <description>&lt;P&gt;That's what I thought after doing an extensive online search about proc surveylogistic.&lt;/P&gt;&lt;P&gt;Anyways, I tried your code and it did work. Thank you so much for your help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Aug 2018 00:13:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Surveylogistic-graphics/m-p/486209#M25185</guid>
      <dc:creator>Dinesh2</dc:creator>
      <dc:date>2018-08-13T00:13:52Z</dc:date>
    </item>
  </channel>
</rss>

