<?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 for log-ratio transformation in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/proc-for-log-ratio-transformation/m-p/984673#M49323</link>
    <description>Thank you, Koen !</description>
    <pubDate>Thu, 12 Mar 2026 14:57:28 GMT</pubDate>
    <dc:creator>SASdevAnneMarie</dc:creator>
    <dc:date>2026-03-12T14:57:28Z</dc:date>
    <item>
      <title>proc for log-ratio transformation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-for-log-ratio-transformation/m-p/984462#M49314</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to apply a log-ratio transformation to compositional variables before performing PCA analysis. I'm wondering if there is a dedicated proc in sas for this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Sat, 07 Mar 2026 15:39:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-for-log-ratio-transformation/m-p/984462#M49314</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2026-03-07T15:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: proc for log-ratio transformation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-for-log-ratio-transformation/m-p/984518#M49315</link>
      <description>&lt;P&gt;Compositional data are nonnegative multivariate data where the absolute values of the data carry only relative meaning.&lt;BR /&gt;Compositional data are often data with a constant-sum constraint: that is, ...&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;the values for each multivariate sample are either observed as summing to a constant (usually 1 or 100%)&lt;/LI&gt;
&lt;LI&gt;or are expressed as values relative to a total that is irrelevant to the research objective (f.e. the composition of a chemical sample).&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Since compositional data lies in a constrained simplex (sum to 1 or 100), it cannot be analyzed directly with standard linear models. Use the SAS DATA step to create transformed variables, such as:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Additive Log-Ratio (ALR)&lt;/LI&gt;
&lt;LI&gt;Centered Log-Ratio (CLR)&lt;/LI&gt;
&lt;LI&gt;Isometric Log-Ratio (ILR)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Those ratios may be the by-product of some procedure (I am not aware of this), but it is actually easy to calculate them in a data step.&lt;/P&gt;
&lt;P&gt;If you encounter difficulties in the calculation, please let us know... we will try to help you further with sample code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR, Koen&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2026 09:57:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-for-log-ratio-transformation/m-p/984518#M49315</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2026-03-09T09:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: proc for log-ratio transformation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-for-log-ratio-transformation/m-p/984520#M49316</link>
      <description>&lt;P&gt;By the way,&lt;/P&gt;
&lt;P&gt;if you can reduce the dimensionality to three using PCA,&lt;/P&gt;
&lt;P&gt;you can then use a ternary plot (&lt;SPAN&gt;trilinear plots / triplot)&amp;nbsp;&lt;/SPAN&gt;to visualize.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR, Koen&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2026 10:07:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-for-log-ratio-transformation/m-p/984520#M49316</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2026-03-09T10:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: proc for log-ratio transformation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-for-log-ratio-transformation/m-p/984537#M49320</link>
      <description>&lt;P&gt;Here's an example of the&amp;nbsp;c&lt;SPAN&gt;entered log-ratio (CLR) transformation.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Remark the CLR requires positive, non-zero values in the composition.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* 1. Define sample data (5 parts: aa, bb, cc, dd, ee) */
data raw_data0;
    input id aa bb cc dd ee;

    datalines;
1 0.1 0.3 0.3 0.1 0.2
2 0.1 0.1 0.4 0.2 0.2
3 0.2 0.3 0.2 0.1 0.2
;
run;

data raw_data1;
 set raw_data0;
 array parts[5]     aa bb cc dd ee; /* List all components */
 mygeomean=geomean(of parts[*]);
 mysum    =    sum(of parts[*]);
run;

data raw_data2;
 set raw_data1;
 array parts[5]     aa bb cc dd ee; /* List all components */
 array clr_parts[5] 
clr_aa clr_bb clr_cc clr_dd clr_ee; 
 do i=1 to dim(parts);
  clr_parts[i] = log(parts[i]/mygeomean);
              /* log = ln (natural log with base e) */
 end;
 drop i;
run;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;BR, Koen&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2026 12:03:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-for-log-ratio-transformation/m-p/984537#M49320</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2026-03-10T12:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: proc for log-ratio transformation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-for-log-ratio-transformation/m-p/984673#M49323</link>
      <description>Thank you, Koen !</description>
      <pubDate>Thu, 12 Mar 2026 14:57:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-for-log-ratio-transformation/m-p/984673#M49323</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2026-03-12T14:57:28Z</dc:date>
    </item>
  </channel>
</rss>

