<?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: Cook's Distance Plot: Label and Lines are not aligned in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Cook-s-Distance-Plot-Label-and-Lines-are-not-aligned/m-p/283178#M10021</link>
    <description>&lt;P&gt;Try adding:&lt;/P&gt;
&lt;P&gt;format serialno 4.;&lt;/P&gt;
&lt;P&gt;as the first line of the procedure.&amp;nbsp; I assume that the ID variable is numeric and has a format with a large width field (maybe 12?).&lt;/P&gt;</description>
    <pubDate>Sat, 09 Jul 2016 23:10:48 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2016-07-09T23:10:48Z</dc:date>
    <item>
      <title>Cook's Distance Plot: Label and Lines are not aligned</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Cook-s-Distance-Plot-Label-and-Lines-are-not-aligned/m-p/283166#M10018</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I have this code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc reg data=eingabe3 plots(label)=(CooksD);&lt;BR /&gt; id serialno;&lt;BR /&gt; model sdnn_ms=age age2;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;producing the attached graphic.&lt;/P&gt;
&lt;P&gt;I want to know how to align the labels to the data spikes. Now they are shifted to right.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Frank&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12736i98806BC8B03B6526/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Bildschirmfoto 2016-07-09 um 21.53.36.png" title="Bildschirmfoto 2016-07-09 um 21.53.36.png" /&gt;</description>
      <pubDate>Sat, 09 Jul 2016 19:57:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Cook-s-Distance-Plot-Label-and-Lines-are-not-aligned/m-p/283166#M10018</guid>
      <dc:creator>sauer</dc:creator>
      <dc:date>2016-07-09T19:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: Cook's Distance Plot: Label and Lines are not aligned</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Cook-s-Distance-Plot-Label-and-Lines-are-not-aligned/m-p/283178#M10021</link>
      <description>&lt;P&gt;Try adding:&lt;/P&gt;
&lt;P&gt;format serialno 4.;&lt;/P&gt;
&lt;P&gt;as the first line of the procedure.&amp;nbsp; I assume that the ID variable is numeric and has a format with a large width field (maybe 12?).&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jul 2016 23:10:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Cook-s-Distance-Plot-Label-and-Lines-are-not-aligned/m-p/283178#M10021</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-07-09T23:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: Cook's Distance Plot: Label and Lines are not aligned</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Cook-s-Distance-Plot-Label-and-Lines-are-not-aligned/m-p/283209#M10022</link>
      <description>&lt;P&gt;Hi Rick,&lt;/P&gt;
&lt;P&gt;yes, this was the idea! I had "serialno 5." - this is quiet a difference.&lt;/P&gt;
&lt;P&gt;Is there a chance to avoid the labels in the lower part of the diagram?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Frank&lt;/P&gt;</description>
      <pubDate>Sun, 10 Jul 2016 14:03:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Cook-s-Distance-Plot-Label-and-Lines-are-not-aligned/m-p/283209#M10022</guid>
      <dc:creator>sauer</dc:creator>
      <dc:date>2016-07-10T14:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: Cook's Distance Plot: Label and Lines are not aligned</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Cook-s-Distance-Plot-Label-and-Lines-are-not-aligned/m-p/283218#M10023</link>
      <description>&lt;P&gt;The cutoff value is (I think) 4/n where n is the number of nonmissing obs. Points with Cook's D greater than that value are labeled.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Probably the easiest way control the labeling is to output the Cook's D statistic in the OUTPUT statement and then use PROC SGPLOT to create the plot manually.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods select CooksDPlot;
proc reg data = sashelp.cars plots(label)=(CooksD);
  model mpg_city = weight wheelbase;
  output out=RegOut cookd=cookd;
quit;
%let cutoff = 0.05;  /* create new cutoff value */
data RegOut;
format MyLabel $8.;
set RegOut;
ObsNum = _N_;
if cookD &amp;gt; &amp;amp;cutoff then 
   MyLabel = Model;
else 
   MyLabel = " ";
run;

proc sgplot data=RegOut;
  needle x=ObsNum y=CookD / datalabel = MyLabel;
  refline &amp;amp;cutoff / axis=y;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 10 Jul 2016 18:57:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Cook-s-Distance-Plot-Label-and-Lines-are-not-aligned/m-p/283218#M10023</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-07-10T18:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: Cook's Distance Plot: Label and Lines are not aligned</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Cook-s-Distance-Plot-Label-and-Lines-are-not-aligned/m-p/283735#M10032</link>
      <description>&lt;P&gt;Thank you very much. That works very fine&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2016 11:02:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Cook-s-Distance-Plot-Label-and-Lines-are-not-aligned/m-p/283735#M10032</guid>
      <dc:creator>sauer</dc:creator>
      <dc:date>2016-07-12T11:02:19Z</dc:date>
    </item>
  </channel>
</rss>

