<?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: How to reduce spacing in Shewhart chart? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-to-reduce-spacing-in-Shewhart-chart/m-p/753042#M21747</link>
    <description>&lt;P&gt;Since I am not going to type in your screen captures of data, I made up my own data to illustrate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
    input measureperiodid :date9. neonatald;
    format measureperiodid date9.;
    cards;
01OCT2020 40
01NOV2020 3
01DEC2020 19
01FEB2021 40
;

proc sql;
    create table minmax as 
    select min(measureperiodid) as mindate,max(measureperiodid) as maxdate
    from have;
run;

/* Create index values */
data index;
	set minmax;
	index=0;
	date=mindate;
	do until (date&amp;gt;=maxdate);
	    date=intnx('month',mindate,index,'b');
	    index=index+1;
	    year=year(date);
	    month=month(date);
	    output;
    end;
    format date date9.;
    keep index date year month;
run;

data final;
    merge have index(rename=(date=measureperiodid));
    by measureperiodid;
    if missing(neonatald) then neonatald=0;
run;

proc shewhart data=final;
	irchart neonatald*index(year month)/blockpos=3 haxis=1 to 6;
	label year='Year' month='Month';
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 08 Jul 2021 22:49:51 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2021-07-08T22:49:51Z</dc:date>
    <item>
      <title>How to reduce spacing in Shewhart chart?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-reduce-spacing-in-Shewhart-chart/m-p/752951#M21739</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm want to create an XSchart.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The chart was split into 4 instead of 1. Please how do I make this come out as just 1 chart?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The data points for the subgroup variable are 09/01/2020, 10/01/2020,...01/01/2021&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please see the code.&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;title "Length of Stay";
symbol v=dot;

proc shewhart data=work.nowsbaseline_sorted;
	xschart neonatald*measureperiodid/haxis= '01SEP2020'd to '01MAR2021'd by 31;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Any help is greatly appreciated.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 23:05:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-reduce-spacing-in-Shewhart-chart/m-p/752951#M21739</guid>
      <dc:creator>annaabimbola</dc:creator>
      <dc:date>2021-07-08T23:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to reduce spacing in Shewhart chart?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-reduce-spacing-in-Shewhart-chart/m-p/752963#M21740</link>
      <description>&lt;P&gt;As I suggested in your other thread, make the horizontal axis to be the numbers 1, 2, ... and then use a block variable to identify the months.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Also note that using &lt;FONT face="courier new,courier"&gt;by 31&lt;/FONT&gt; in your code, you will not really be displaying months, but time periods of 31 days.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 18:14:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-reduce-spacing-in-Shewhart-chart/m-p/752963#M21740</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-07-08T18:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to reduce spacing in Shewhart chart?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-reduce-spacing-in-Shewhart-chart/m-p/752965#M21741</link>
      <description>&lt;P&gt;Don't know if this will fix the specific issue by I think you may have "nicer" axis appearance if you use&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;xschart neonatald*measureperiodid/haxis= '01SEP2020'd to '01MAR2021'd by month;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 18:15:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-reduce-spacing-in-Shewhart-chart/m-p/752965#M21741</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-07-08T18:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to reduce spacing in Shewhart chart?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-reduce-spacing-in-Shewhart-chart/m-p/753009#M21742</link>
      <description>Thanks PaigeMiller, this worked.&lt;BR /&gt;&lt;BR /&gt;I'm writing the codes for an external organization and they need something that will be more automated. They have to create these control charts every month because this is an ongoing project and I won't be the one doing that, so I was wondering if there was a way to do this without having to assign index integers to each month every time they do this.&lt;BR /&gt;&lt;BR /&gt;I really appreciate the help.</description>
      <pubDate>Thu, 08 Jul 2021 20:59:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-reduce-spacing-in-Shewhart-chart/m-p/753009#M21742</guid>
      <dc:creator>annaabimbola</dc:creator>
      <dc:date>2021-07-08T20:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to reduce spacing in Shewhart chart?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-reduce-spacing-in-Shewhart-chart/m-p/753012#M21743</link>
      <description>&lt;P&gt;Assigning index numbers can be automated.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 21:17:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-reduce-spacing-in-Shewhart-chart/m-p/753012#M21743</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-07-08T21:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to reduce spacing in Shewhart chart?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-reduce-spacing-in-Shewhart-chart/m-p/753016#M21744</link>
      <description>What code can I use to do that?</description>
      <pubDate>Thu, 08 Jul 2021 21:43:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-reduce-spacing-in-Shewhart-chart/m-p/753016#M21744</guid>
      <dc:creator>annaabimbola</dc:creator>
      <dc:date>2021-07-08T21:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to reduce spacing in Shewhart chart?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-reduce-spacing-in-Shewhart-chart/m-p/753027#M21745</link>
      <description>&lt;P&gt;Show me a portion of your data. Explain what changes from month to month that it would need automation.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 22:13:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-reduce-spacing-in-Shewhart-chart/m-p/753027#M21745</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-07-08T22:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to reduce spacing in Shewhart chart?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-reduce-spacing-in-Shewhart-chart/m-p/753031#M21746</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp; This is an initiative implemented in hospitals. Each hospital reports the number of days a patient stays in the hospital every month. The goal is to create these control charts every month to see how effective the initiative is, so the neonatald variable changes every month.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 23:04:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-reduce-spacing-in-Shewhart-chart/m-p/753031#M21746</guid>
      <dc:creator>annaabimbola</dc:creator>
      <dc:date>2021-07-08T23:04:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to reduce spacing in Shewhart chart?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-reduce-spacing-in-Shewhart-chart/m-p/753042#M21747</link>
      <description>&lt;P&gt;Since I am not going to type in your screen captures of data, I made up my own data to illustrate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
    input measureperiodid :date9. neonatald;
    format measureperiodid date9.;
    cards;
01OCT2020 40
01NOV2020 3
01DEC2020 19
01FEB2021 40
;

proc sql;
    create table minmax as 
    select min(measureperiodid) as mindate,max(measureperiodid) as maxdate
    from have;
run;

/* Create index values */
data index;
	set minmax;
	index=0;
	date=mindate;
	do until (date&amp;gt;=maxdate);
	    date=intnx('month',mindate,index,'b');
	    index=index+1;
	    year=year(date);
	    month=month(date);
	    output;
    end;
    format date date9.;
    keep index date year month;
run;

data final;
    merge have index(rename=(date=measureperiodid));
    by measureperiodid;
    if missing(neonatald) then neonatald=0;
run;

proc shewhart data=final;
	irchart neonatald*index(year month)/blockpos=3 haxis=1 to 6;
	label year='Year' month='Month';
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Jul 2021 22:49:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-reduce-spacing-in-Shewhart-chart/m-p/753042#M21747</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-07-08T22:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to reduce spacing in Shewhart chart?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-reduce-spacing-in-Shewhart-chart/m-p/753049#M21748</link>
      <description>It worked!!!!&lt;BR /&gt;&lt;BR /&gt;Thank you so much for the help and patience.</description>
      <pubDate>Thu, 08 Jul 2021 23:03:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-reduce-spacing-in-Shewhart-chart/m-p/753049#M21748</guid>
      <dc:creator>annaabimbola</dc:creator>
      <dc:date>2021-07-08T23:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to reduce spacing in Shewhart chart?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-reduce-spacing-in-Shewhart-chart/m-p/753050#M21749</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/387637"&gt;@annaabimbola&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me alert you to change a small part of the above code, removing HAXIS=1 TO 6, as most likely you will have more than 6 months in your real data.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 23:38:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-reduce-spacing-in-Shewhart-chart/m-p/753050#M21749</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-07-08T23:38:28Z</dc:date>
    </item>
  </channel>
</rss>

