<?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: proc princomp : labels in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-princomp-labels/m-p/983958#M379626</link>
    <description>&lt;P&gt;Ah! Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;for pointing out that the OP wants to plot variable LABELS, not names.&amp;nbsp; I agree that there is no built-in option to make the ODS graphics from PROC PRINTCOMP use labels. The OP will need to use the VALIDVARNAME=ANY option to rename variables as n-literals. Here is an example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* What are the labels for the variables? */
proc contents data=sashelp.iris varnum;
   ods select Position;
run;

/* create a copy of the data and use VALIDVARNAME=ANY to rename the 
   variables to their label values */
option validvarname=ANY;
data Iris;
   set sashelp.iris;
   rename 
   PetalLength = 'Petal Length (mm)'n
   PetalWidth  = 'Petal Width (mm)'n
   SepalLength = 'Sepal Length (mm)'n
   SepalWidth  = 'Sepal Width (mm)'n;
run;

/* run PCA on the new data set */
ods graphics on;
proc princomp data=Iris
     plots=pattern(vector circles=25 50 75 100);
var _numeric_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PatternPlot30.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/113336iF155CD18A45BC85B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PatternPlot30.png" alt="PatternPlot30.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I assume this is a one-time task, but if you need to incorporate it into a process, you can write a macro that uses the output of PROC CONTENTS tp automatically create the new variable (with long n-literal names) as copies of the original variables. See&amp;nbsp;&lt;A href="https://support.sas.com/kb/35/973.html" target="_blank"&gt;35973 - Display variable labels instead of variable names in procedure results&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Feb 2026 11:06:54 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2026-02-24T11:06:54Z</dc:date>
    <item>
      <title>proc princomp : labels</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-princomp-labels/m-p/983872#M379598</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is it possible in proc princomp to show the labels ?&lt;/P&gt;
&lt;DIV id="tinyMceEditorSASdevAnneMarie_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture d’écran 2026-02-23 150140.png" style="width: 638px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/113291i7283F7BB46C03AF8/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture d’écran 2026-02-23 150140.png" alt="Capture d’écran 2026-02-23 150140.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Thank you for your help!&lt;/P&gt;</description>
      <pubDate>Mon, 23 Feb 2026 14:03:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-princomp-labels/m-p/983872#M379598</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2026-02-23T14:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: proc princomp : labels</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-princomp-labels/m-p/983873#M379599</link>
      <description>&lt;P&gt;From the &lt;A href="https://go.documentation.sas.com/doc/en/statug/latest/statug_princomp_syntax04.htm" target="_self"&gt;PROC PRINCOMP documentation&lt;/A&gt;:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The ID statement labels observations by using values from the first ID variable in the principal component score plot.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you have additional questions, please include the code you are currently using.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Feb 2026 14:29:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-princomp-labels/m-p/983873#M379599</guid>
      <dc:creator>Kathryn_SAS</dc:creator>
      <dc:date>2026-02-23T14:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: proc princomp : labels</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-princomp-labels/m-p/983874#M379600</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/286185"&gt;@SASdevAnneMarie&lt;/a&gt;&amp;nbsp;wrote:
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is it possible in proc princomp to show the labels ?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Do you mean labels of the variables (which is what I think you are asking), or labels on the observations? Please state clearly what you mean.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you mean labels on the variables, then the documentation does not list any option to display the labels on the plots. If you mean labels on the observations,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13770"&gt;@Kathryn_SAS&lt;/a&gt;&amp;nbsp;has answered that.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Feb 2026 15:27:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-princomp-labels/m-p/983874#M379600</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2026-02-23T15:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: proc princomp : labels</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-princomp-labels/m-p/983877#M379603</link>
      <description>Thank you. I would like to display the labels of variables.</description>
      <pubDate>Mon, 23 Feb 2026 16:25:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-princomp-labels/m-p/983877#M379603</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2026-02-23T16:25:45Z</dc:date>
    </item>
    <item>
      <title>Re: proc princomp : labels</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-princomp-labels/m-p/983879#M379605</link>
      <description>&lt;P&gt;The SAS documentation does not show an option to display labels of the variables.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Feb 2026 16:38:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-princomp-labels/m-p/983879#M379605</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2026-02-23T16:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: proc princomp : labels</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-princomp-labels/m-p/983899#M379612</link>
      <description>&lt;DIV class="heading cf"&gt;
&lt;H1 class="post-title item fn"&gt;&lt;FONT size="4"&gt;Rick is labeling observations AND variables!&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;/FONT&gt;&lt;/H1&gt;
&lt;H1 class="post-title item fn"&gt;Comparing flavor characteristics of Scotch whiskies: A principal component analysis&lt;/H1&gt;
&lt;/DIV&gt;
&lt;DIV class="post-meta cf"&gt;&lt;SPAN class="posted-by"&gt;By&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="reviewer"&gt;&lt;A title="Posts by Rick Wicklin" href="https://blogs.sas.com/content/author/rickwicklin/" target="_blank" rel="author noopener"&gt;Rick Wicklin&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;on&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://blogs.sas.com/content/iml/" target="_blank" rel="noopener"&gt;The DO Loop&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="posted-on"&gt;&lt;SPAN class="dtreviewed"&gt;&lt;TIME class="value-title" title="2026-02-23" datetime="2026-02-23T05:21:16-05:00"&gt;February 23, 2026&lt;/TIME&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="post-meta cf"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="post-meta cf"&gt;&lt;SPAN class="posted-on"&gt;&lt;SPAN class="dtreviewed"&gt;Ciao,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="post-meta cf"&gt;&lt;SPAN class="posted-on"&gt;&lt;SPAN class="dtreviewed"&gt;Koen&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 23 Feb 2026 20:44:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-princomp-labels/m-p/983899#M379612</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2026-02-23T20:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: proc princomp : labels</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-princomp-labels/m-p/983900#M379613</link>
      <description>&lt;P&gt;It's hard to tell from the image you posted, but it looks like you want a "Pattern Plot" (somtimes called a "loadings Plot").&amp;nbsp; Try imitating this code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods graphics on;ods graphics on;
proc princomp data=sashelp.iris plots=pattern(vector circles=25 50 75 100);
var _numeric_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you need a refresher on how to interpret a pattern plot, see&amp;nbsp;&lt;A href="https://blogs.sas.com/content/iml/2019/11/04/interpret-graphs-principal-components.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2019/11/04/interpret-graphs-principal-components.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Feb 2026 21:12:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-princomp-labels/m-p/983900#M379613</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2026-02-23T21:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: proc princomp : labels</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-princomp-labels/m-p/983901#M379614</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/60547"&gt;@sbxkoenk&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;DIV class="heading cf"&gt;
&lt;H1 class="post-title item fn"&gt;&lt;FONT size="4"&gt;Rick is labeling observations AND variables!&lt;/FONT&gt;&lt;/H1&gt;
&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Sorry, no, those are variable names. They are not variable labels.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now Rick was smart and chose variable names that are easily understood, rather than something like this title:&amp;nbsp;tvar=volcsum_t, which is something that&lt;A href="https://communities.sas.com/t5/SAS-Programming/SGPLOT-how-to-specify-line-color-thickness-for-a-bunch-of-lines/m-p/982648#M379362" target="_self"&gt; I actually saw on someone's plot&lt;/A&gt;.&amp;nbsp;Although I would note that some applications may not have such easy to understand variable names ... which is why labels are needed in some reports and such for those applications.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So the answer to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/286185"&gt;@SASdevAnneMarie&lt;/a&gt;&amp;nbsp;would be to rename the variables if possible.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Feb 2026 22:14:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-princomp-labels/m-p/983901#M379614</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2026-02-23T22:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: proc princomp : labels</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-princomp-labels/m-p/983904#M379615</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;&lt;/P&gt;
&lt;P&gt;You're right. I missed the point (labels of variables and not names of variables).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Mon, 23 Feb 2026 22:33:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-princomp-labels/m-p/983904#M379615</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2026-02-23T22:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: proc princomp : labels</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-princomp-labels/m-p/983958#M379626</link>
      <description>&lt;P&gt;Ah! Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;for pointing out that the OP wants to plot variable LABELS, not names.&amp;nbsp; I agree that there is no built-in option to make the ODS graphics from PROC PRINTCOMP use labels. The OP will need to use the VALIDVARNAME=ANY option to rename variables as n-literals. Here is an example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* What are the labels for the variables? */
proc contents data=sashelp.iris varnum;
   ods select Position;
run;

/* create a copy of the data and use VALIDVARNAME=ANY to rename the 
   variables to their label values */
option validvarname=ANY;
data Iris;
   set sashelp.iris;
   rename 
   PetalLength = 'Petal Length (mm)'n
   PetalWidth  = 'Petal Width (mm)'n
   SepalLength = 'Sepal Length (mm)'n
   SepalWidth  = 'Sepal Width (mm)'n;
run;

/* run PCA on the new data set */
ods graphics on;
proc princomp data=Iris
     plots=pattern(vector circles=25 50 75 100);
var _numeric_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PatternPlot30.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/113336iF155CD18A45BC85B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PatternPlot30.png" alt="PatternPlot30.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I assume this is a one-time task, but if you need to incorporate it into a process, you can write a macro that uses the output of PROC CONTENTS tp automatically create the new variable (with long n-literal names) as copies of the original variables. See&amp;nbsp;&lt;A href="https://support.sas.com/kb/35/973.html" target="_blank"&gt;35973 - Display variable labels instead of variable names in procedure results&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2026 11:06:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-princomp-labels/m-p/983958#M379626</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2026-02-24T11:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: proc princomp : labels</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-princomp-labels/m-p/983959#M379627</link>
      <description>Thank you!</description>
      <pubDate>Tue, 24 Feb 2026 11:41:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-princomp-labels/m-p/983959#M379627</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2026-02-24T11:41:11Z</dc:date>
    </item>
  </channel>
</rss>

