<?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 PROC PSMATCH: Is there a way to change the x-axis label for the standardized mean difference plot? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-PSMATCH-Is-there-a-way-to-change-the-x-axis-label-for-the/m-p/801154#M315282</link>
    <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I am using PROC PSMATCH to make a standardized mean difference plot, and I want to change the label of the x-axis "Difference (Treated - Control)". Is there a way to remove this label, or change it to something else? Using ODS TRACE, I found that this plot is the "StdDiffPlot"&lt;BR /&gt;&lt;BR /&gt;This is some SAS code I used to make a standardized mean difference plot on the CARS dataset using PROC PSMATCH.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data CARS;
set sashelp.CARS;
format CAR_TYPE $50.;
if TYPE = 'SUV' then CAR_TYPE = 'SUV';
if TYPE = 'Sedan' then CAR_TYPE = 'SEDAN';
if CAR_TYPE ne ' ';
run;

ods graphics on;
proc psmatch data=CARS region=cs;
	class CAR_TYPE;
	psmodel CAR_TYPE(Treated="SUV")=MPG_CITY;
	match method=optimal(k=1)
			distance=mah(lps)
			caliper=.
			weight=none;
	assess lps var=(MPG_CITY);
run;&lt;BR /&gt;ods&amp;nbsp;graphics&amp;nbsp;off;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also see the attached screenshot where I highlighted the "Difference (Treated - Control)" label that I want to remove or re-label.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Std Diff Plot Example.JPG" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/69303i9C3421568C4A70C2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Std Diff Plot Example.JPG" alt="Std Diff Plot Example.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thank you in advance for any help or advice!&lt;/P&gt;</description>
    <pubDate>Wed, 09 Mar 2022 18:54:19 GMT</pubDate>
    <dc:creator>ble9245</dc:creator>
    <dc:date>2022-03-09T18:54:19Z</dc:date>
    <item>
      <title>PROC PSMATCH: Is there a way to change the x-axis label for the standardized mean difference plot?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-PSMATCH-Is-there-a-way-to-change-the-x-axis-label-for-the/m-p/801154#M315282</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I am using PROC PSMATCH to make a standardized mean difference plot, and I want to change the label of the x-axis "Difference (Treated - Control)". Is there a way to remove this label, or change it to something else? Using ODS TRACE, I found that this plot is the "StdDiffPlot"&lt;BR /&gt;&lt;BR /&gt;This is some SAS code I used to make a standardized mean difference plot on the CARS dataset using PROC PSMATCH.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data CARS;
set sashelp.CARS;
format CAR_TYPE $50.;
if TYPE = 'SUV' then CAR_TYPE = 'SUV';
if TYPE = 'Sedan' then CAR_TYPE = 'SEDAN';
if CAR_TYPE ne ' ';
run;

ods graphics on;
proc psmatch data=CARS region=cs;
	class CAR_TYPE;
	psmodel CAR_TYPE(Treated="SUV")=MPG_CITY;
	match method=optimal(k=1)
			distance=mah(lps)
			caliper=.
			weight=none;
	assess lps var=(MPG_CITY);
run;&lt;BR /&gt;ods&amp;nbsp;graphics&amp;nbsp;off;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also see the attached screenshot where I highlighted the "Difference (Treated - Control)" label that I want to remove or re-label.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Std Diff Plot Example.JPG" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/69303i9C3421568C4A70C2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Std Diff Plot Example.JPG" alt="Std Diff Plot Example.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thank you in advance for any help or advice!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2022 18:54:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-PSMATCH-Is-there-a-way-to-change-the-x-axis-label-for-the/m-p/801154#M315282</guid>
      <dc:creator>ble9245</dc:creator>
      <dc:date>2022-03-09T18:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: PROC PSMATCH: Is there a way to change the x-axis label for the standardized mean difference plo</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-PSMATCH-Is-there-a-way-to-change-the-x-axis-label-for-the/m-p/801169#M315284</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/396004"&gt;@ble9245&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can edit the&amp;nbsp;&lt;SPAN&gt;ODS template underlying the plot to achieve what you want. Normally I don't edit these templates, but a&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://communities.sas.com/t5/Statistical-Procedures/Proc-mixed-formats-of-the-output-dataset/m-p/699850/highlight/true#M33761" target="_blank" rel="noopener"&gt;successful attempt in 2020&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;(which did not damage the original templates) and a &lt;A href="https://communities.sas.com/t5/Statistical-Procedures/Changing-the-axis-range-in-contour-plots-created-with-proc-plm/m-p/795548/highlight/true#M39043" target="_blank" rel="noopener"&gt;recent second success&lt;/A&gt;&amp;nbsp;last February encouraged me (EDIT: see the warning at the bottom of this post, though).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The first steps are described in items 1 - 3 of the 2020 post mentioned above, except that the template to be edited is&amp;nbsp;&lt;FONT face="courier new,courier"&gt;StdDiffPlot&lt;/FONT&gt;&amp;nbsp;in the&amp;nbsp;Graphics subfolder of folder PSMatch (instead of Mixed).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;As in the other post (Feb 2022) I simply copied the whole PROC TEMPLATE step from there into the Enhanced Editor. Then I edited the hardcoded &lt;FONT face="courier new,courier"&gt;label=&lt;/FONT&gt;&amp;nbsp;suboption (&lt;FONT face="courier new,courier"&gt;label="Difference (Treated - Control)"&lt;/FONT&gt;) of the &lt;FONT face="courier new,courier"&gt;xaxisopts=&lt;/FONT&gt; option of the &lt;FONT face="courier new,courier"&gt;Layout Overlay&lt;/FONT&gt; statement in the ELSE branch of the "&lt;FONT face="courier new,courier"&gt;if (_VERTICAL) ... else ...&lt;/FONT&gt;" construct:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;label="Your Custom Axis Label"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;(Note the similar code structure for the y-axis in the IF branch.)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;After submitting the modified PROC TEMPLATE step (which saved the customized template to WORK.TEMPLAT, i.e., a temporary location) your PROC PSMATCH step created the plot with the modified x-axis label.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;To &lt;EM&gt;remove&lt;/EM&gt; the x-axis label, just edit the next suboption of the &lt;FONT face="courier new,courier"&gt;xaxisopts=&lt;/FONT&gt; option: In the default template it says &lt;FONT face="courier new,courier"&gt;display=all&lt;/FONT&gt;. Change this to&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;display=(line ticks tickvalues)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;and the axis label will vanish (ignoring the value of the &lt;FONT face="courier new,courier"&gt;label=&lt;/FONT&gt; suboption).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;To return to the original template I deleted the customized version in the WORK library:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;proc template;
delete Stat.PSMatch.Graphics.StdDiffPlot;
run;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;and verified that PROC PSMATCH now produced the original plot again.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Edit:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;CAUTION:&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;Thereafter, when I tried to open a second Templates window (View --&amp;gt; Templates) without a good reason as the first was still open, my SAS 9.4M5 session stopped responding, had to be terminated via "SAS System Close" and yet the Autosave file of the Enhanced Editor was deleted (luckily it didn't contain relevant code)&lt;FONT face="helvetica"&gt;!&lt;/FONT&gt; I remember the same happened after the previous ODS template modification in February. Even worse, the crash seemed to destabilize a second SAS session that I had opened while the first was non-responsive. So, be careful and save everything before playing around with the ODS templates.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2022 20:20:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-PSMATCH-Is-there-a-way-to-change-the-x-axis-label-for-the/m-p/801169#M315284</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2022-03-09T20:20:34Z</dc:date>
    </item>
  </channel>
</rss>

