<?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: Model heteroscedasticity directly or use log transformation in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Model-heteroscedasticity-directly-or-use-log-transformation/m-p/965328#M48442</link>
    <description>&lt;P&gt;I think you should take "genotype" as G-side random effect and "rep" as R-side random effect according to your sample data. Like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data yield;
  input genotype $ rep yield bad_fruit purple_fruit;
  datalines;
Krewer	1	14.34	72	566
Krewer	2	11.49	53	521
Krewer	3	7.75	37	500
Titan	1	10.44	72	470
Titan	2	9.92	79	673
Titan	3	5.97	71	318
T-3557	1	10.51	217	1088
T-3557	2	6.22	132	612
T-3557	3	3.53	90	417
T-2604	1	11.10	13	344
T-2604	2	8.95	10	276
T-2604	3	6.85	14	269
T-3858	1	10.79	29	635
T-3858	2	10.01	35	500
T-3858	3	11.41	21	660
T-3826	1	12.67	77	711
T-3826	2	12.81	59	492
T-3826	3	10.38	24	357
T-3835	1	10.05	65	1021
T-3835	2	10.95	97	1042
T-3835	3	11.73	72	1050
;
run;


title "Model heteroscedasticity directly";
proc glimmix data=yield plots=residualpanel;
  ods exclude diffplot linesplot;
  class genotype rep;
  model yield =  bad_fruit purple_fruit ;
  &lt;STRONG&gt;random rep/subject=genotype  residual;
  random int/subject=genotype ;&lt;/STRONG&gt; **allow different variance by genotype;
/*  lsmeans genotype/adj=Tukey pdiff;*/
/*  ods output diffs=ppp lsmeans=mmm;*/
run;
&lt;/PRE&gt;</description>
    <pubDate>Tue, 29 Apr 2025 01:20:15 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2025-04-29T01:20:15Z</dc:date>
    <item>
      <title>Model heteroscedasticity directly or use log transformation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Model-heteroscedasticity-directly-or-use-log-transformation/m-p/965322#M48439</link>
      <description>&lt;P&gt;Hi, my data has a heteroscedasticity issue among genotypes. It is a RCBD. I tried two approaches but get different results. Please advise which way is better.&lt;/P&gt;
&lt;P&gt;1. Model the heteroscedasticity directly.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data yield;
  input genotype $ rep yield bad_fruit purple_fruit;
  datalines;
  Krewer	1	14.34	72	566
Krewer	2	11.49	53	521
Krewer	3	7.75	37	500Titan	1	10.44	72	470
Titan	2	9.92	79	673
Titan	3	5.97	71	318
T-3557	1	10.51	217	1088
T-3557	2	6.22	132	612
T-3557	3	3.53	90	417
T-2604	1	11.10	13	344
T-2604	2	8.95	10	276
T-2604	3	6.85	14	269
T-3858	1	10.79	29	635
T-3858	2	10.01	35	500
T-3858	3	11.41	21	660
T-3826	1	12.67	77	711
T-3826	2	12.81	59	492
T-3826	3	10.38	24	357
T-3835	1	10.05	65	1021
T-3835	2	10.95	97	1042
T-3835	3	11.73	72	1050
;
run;

proc sgplot data=yield;
  vbox yield/category=genotype;
run;
proc sgplot data=yield;
  vbox bad_fruit/category=genotype;
run;
proc sgplot data=yield;
  vbox purple_fruit/category=genotype;
run;

title "Model heteroscedasticity directly";
proc glimmix data=yield plots=residualpanel;
  ods exclude diffplot linesplot;
  class genotype rep;
  model yield = genotype;
  random rep;
  random int/group=genotype residual; **allow different variance by genotype;
  lsmeans genotype/adj=Tukey pdiff;
  ods output diffs=ppp lsmeans=mmm;
run;

%include '...\SAS Macro\pdmix800.sas'; # the directory where pdmix800 saved;
%pdmix800(ppp,mmm,alpha=.05,sort=yes)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The key results are:&amp;nbsp;&lt;/P&gt;
&lt;DIV class="branch"&gt;&lt;BR /&gt;&lt;A name="IDX289" target="_blank"&gt;&lt;/A&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Glimmix: Covariance Parameter Estimates" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c b header" colspan="4" scope="colgroup"&gt;Covariance Parameter Estimates&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l b header" scope="col"&gt;Cov Parm&lt;/TH&gt;
&lt;TH class="l b header" scope="col"&gt;Group&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Estimate&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Standard&lt;BR /&gt;Error&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;rep&lt;/TH&gt;
&lt;TH class="l data"&gt;&amp;nbsp;&lt;/TH&gt;
&lt;TD class="r data"&gt;1.9078&lt;/TD&gt;
&lt;TD class="r data"&gt;2.2163&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Intercept&lt;/TH&gt;
&lt;TH class="l data"&gt;genotype Krewer&lt;/TH&gt;
&lt;TD class="r data"&gt;4.6730&lt;/TD&gt;
&lt;TD class="r data"&gt;5.8042&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Intercept&lt;/TH&gt;
&lt;TH class="l data"&gt;genotype T-2604&lt;/TH&gt;
&lt;TD class="r data"&gt;1.4080&lt;/TD&gt;
&lt;TD class="r data"&gt;2.6157&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Intercept&lt;/TH&gt;
&lt;TH class="l data"&gt;genotype T-3557&lt;/TH&gt;
&lt;TD class="r data"&gt;6.6610&lt;/TD&gt;
&lt;TD class="r data"&gt;8.4516&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Intercept&lt;/TH&gt;
&lt;TH class="l data"&gt;genotype T-3826&lt;/TH&gt;
&lt;TD class="r data"&gt;0.04554&lt;/TD&gt;
&lt;TD class="r data"&gt;0.8463&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Intercept&lt;/TH&gt;
&lt;TH class="l data"&gt;genotype T-3835&lt;/TH&gt;
&lt;TD class="r data"&gt;4.5581&lt;/TD&gt;
&lt;TD class="r data"&gt;5.1839&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Intercept&lt;/TH&gt;
&lt;TH class="l data"&gt;genotype T-3858&lt;/TH&gt;
&lt;TD class="r data"&gt;3.9914&lt;/TD&gt;
&lt;TD class="r data"&gt;4.0433&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Intercept&lt;/TH&gt;
&lt;TH class="l data"&gt;genotype Titan&lt;/TH&gt;
&lt;TD class="r data"&gt;1.2386&lt;/TD&gt;
&lt;TD class="r data"&gt;1.3169&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;&lt;A name="IDX290" target="_blank"&gt;&lt;/A&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Glimmix: Type III Tests of Fixed Effects" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c b header" colspan="5" scope="colgroup"&gt;Type III Tests of Fixed Effects&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l b header" scope="col"&gt;Effect&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Num DF&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Den DF&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;F Value&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Pr&amp;nbsp;&amp;gt;&amp;nbsp;F&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;genotype&lt;/TH&gt;
&lt;TD class="r data"&gt;6&lt;/TD&gt;
&lt;TD class="r data"&gt;12&lt;/TD&gt;
&lt;TD class="r data"&gt;8.86&lt;/TD&gt;
&lt;TD class="r data"&gt;0.0008&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;&lt;A name="IDX291" target="_blank"&gt;&lt;/A&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Glimmix: genotype Least Squares Means" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c b header" colspan="6" scope="colgroup"&gt;genotype Least Squares Means&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l b header" scope="col"&gt;genotype&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Estimate&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Standard&lt;BR /&gt;Error&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;DF&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;t&amp;nbsp;Value&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Pr &amp;gt; |t|&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="l data"&gt;Krewer&lt;/TH&gt;
&lt;TD class="r data"&gt;11.1933&lt;/TD&gt;
&lt;TD class="r data"&gt;1.4811&lt;/TD&gt;
&lt;TD class="r data"&gt;12&lt;/TD&gt;
&lt;TD class="r data"&gt;7.56&lt;/TD&gt;
&lt;TD class="r data"&gt;&amp;lt;.0001&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l data"&gt;T-2604&lt;/TH&gt;
&lt;TD class="r data"&gt;8.9667&lt;/TD&gt;
&lt;TD class="r data"&gt;1.0513&lt;/TD&gt;
&lt;TD class="r data"&gt;12&lt;/TD&gt;
&lt;TD class="r data"&gt;8.53&lt;/TD&gt;
&lt;TD class="r data"&gt;&amp;lt;.0001&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l data"&gt;T-3557&lt;/TH&gt;
&lt;TD class="r data"&gt;6.7533&lt;/TD&gt;
&lt;TD class="r data"&gt;1.6900&lt;/TD&gt;
&lt;TD class="r data"&gt;12&lt;/TD&gt;
&lt;TD class="r data"&gt;4.00&lt;/TD&gt;
&lt;TD class="r data"&gt;0.0018&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l data"&gt;T-3826&lt;/TH&gt;
&lt;TD class="r data"&gt;11.9533&lt;/TD&gt;
&lt;TD class="r data"&gt;0.8069&lt;/TD&gt;
&lt;TD class="r data"&gt;12&lt;/TD&gt;
&lt;TD class="r data"&gt;14.81&lt;/TD&gt;
&lt;TD class="r data"&gt;&amp;lt;.0001&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l data"&gt;T-3835&lt;/TH&gt;
&lt;TD class="r data"&gt;10.9100&lt;/TD&gt;
&lt;TD class="r data"&gt;1.4681&lt;/TD&gt;
&lt;TD class="r data"&gt;12&lt;/TD&gt;
&lt;TD class="r data"&gt;7.43&lt;/TD&gt;
&lt;TD class="r data"&gt;&amp;lt;.0001&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l data"&gt;T-3858&lt;/TH&gt;
&lt;TD class="r data"&gt;10.7367&lt;/TD&gt;
&lt;TD class="r data"&gt;1.4023&lt;/TD&gt;
&lt;TD class="r data"&gt;12&lt;/TD&gt;
&lt;TD class="r data"&gt;7.66&lt;/TD&gt;
&lt;TD class="r data"&gt;&amp;lt;.0001&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l data"&gt;Titan&lt;/TH&gt;
&lt;TD class="r data"&gt;8.7767&lt;/TD&gt;
&lt;TD class="r data"&gt;1.0241&lt;/TD&gt;
&lt;TD class="r data"&gt;12&lt;/TD&gt;
&lt;TD class="r data"&gt;8.57&lt;/TD&gt;
&lt;TD class="r data"&gt;&amp;lt;.0001&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;DIV class="branch"&gt;
&lt;DIV class="c byline"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="c byline"&gt;Effect=genotype Method=Tukey-Kramer(P&amp;lt;.05) Set=1&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV class="lia-align-left" align="center"&gt;
&lt;TABLE class="table" summary="Procedure Print: Data Set WORK.MSGRPZZ" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="r header" scope="col"&gt;Obs&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;genotype&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;Estimate&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;Standard Error&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;Letter&lt;BR /&gt;Group&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="l data"&gt;T-3826&lt;/TD&gt;
&lt;TD class="r data"&gt;11.9533&lt;/TD&gt;
&lt;TD class="r data"&gt;0.8069&lt;/TD&gt;
&lt;TD class="l data"&gt;A&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;2&lt;/TH&gt;
&lt;TD class="l data"&gt;Krewer&lt;/TD&gt;
&lt;TD class="r data"&gt;11.1933&lt;/TD&gt;
&lt;TD class="r data"&gt;1.4811&lt;/TD&gt;
&lt;TD class="l data"&gt;AB&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;3&lt;/TH&gt;
&lt;TD class="l data"&gt;T-3835&lt;/TD&gt;
&lt;TD class="r data"&gt;10.9100&lt;/TD&gt;
&lt;TD class="r data"&gt;1.4681&lt;/TD&gt;
&lt;TD class="l data"&gt;AB&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;4&lt;/TH&gt;
&lt;TD class="l data"&gt;T-3858&lt;/TD&gt;
&lt;TD class="r data"&gt;10.7367&lt;/TD&gt;
&lt;TD class="r data"&gt;1.4023&lt;/TD&gt;
&lt;TD class="l data"&gt;AB&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;5&lt;/TH&gt;
&lt;TD class="l data"&gt;T-2604&lt;/TD&gt;
&lt;TD class="r data"&gt;8.9667&lt;/TD&gt;
&lt;TD class="r data"&gt;1.0513&lt;/TD&gt;
&lt;TD class="l data"&gt;B&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;6&lt;/TH&gt;
&lt;TD class="l data"&gt;Titan&lt;/TD&gt;
&lt;TD class="r data"&gt;8.7767&lt;/TD&gt;
&lt;TD class="r data"&gt;1.0241&lt;/TD&gt;
&lt;TD class="l data"&gt;B&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;7&lt;/TH&gt;
&lt;TD class="l data"&gt;T-3557&lt;/TD&gt;
&lt;TD class="r data"&gt;6.7533&lt;/TD&gt;
&lt;TD class="r data"&gt;1.6900&lt;/TD&gt;
&lt;TD class="l data"&gt;AB&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-align-left"&gt;The results from log transformed data are:&lt;/P&gt;
&lt;PRE&gt;title "Log transformed yield data";
data yield_tran;
  set yield;
  log_yield=log(yield);
  log_bad_fruit=log(bad_fruit);
  log_purple_fruit=log(purple_fruit);
run;

proc glimmix data=yield_tran plots=residualpanel;
  ods exclude diffplot linesplot;
  class genotype rep;
  model log_yield = genotype;
  random rep;
  lsmeans genotype/adj=Tukey lines;
run;&lt;/PRE&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Glimmix: Covariance Parameter Estimates" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c b header" colspan="3" scope="colgroup"&gt;Covariance Parameter Estimates&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l b header" scope="col"&gt;Cov Parm&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Estimate&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Standard&lt;BR /&gt;Error&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;rep&lt;/TH&gt;
&lt;TD class="r data"&gt;0.03202&lt;/TD&gt;
&lt;TD class="r data"&gt;0.03924&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Residual&lt;/TH&gt;
&lt;TD class="r data"&gt;0.04978&lt;/TD&gt;
&lt;TD class="r data"&gt;0.02032&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;&lt;A name="IDX304" target="_blank"&gt;&lt;/A&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Glimmix: Type III Tests of Fixed Effects" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c b header" colspan="5" scope="colgroup"&gt;Type III Tests of Fixed Effects&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l b header" scope="col"&gt;Effect&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Num DF&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Den DF&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;F Value&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Pr&amp;nbsp;&amp;gt;&amp;nbsp;F&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Genotype&lt;/TH&gt;
&lt;TD class="r data"&gt;6&lt;/TD&gt;
&lt;TD class="r data"&gt;12&lt;/TD&gt;
&lt;TD class="r data"&gt;3.12&lt;/TD&gt;
&lt;TD class="r data"&gt;0.0443&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;&lt;A name="IDX305" target="_blank"&gt;&lt;/A&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Glimmix: Genotype Least Squares Means" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c b header" colspan="6" scope="colgroup"&gt;Genotype Least Squares Means&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l b header" scope="col"&gt;Genotype&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Estimate&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Standard&lt;BR /&gt;Error&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;DF&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;t&amp;nbsp;Value&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Pr &amp;gt; |t|&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="l data"&gt;Krewer&lt;/TH&gt;
&lt;TD class="r data"&gt;2.3842&lt;/TD&gt;
&lt;TD class="r data"&gt;0.1651&lt;/TD&gt;
&lt;TD class="r data"&gt;12&lt;/TD&gt;
&lt;TD class="r data"&gt;14.44&lt;/TD&gt;
&lt;TD class="r data"&gt;&amp;lt;.0001&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l data"&gt;T-2604&lt;/TH&gt;
&lt;TD class="r data"&gt;2.1743&lt;/TD&gt;
&lt;TD class="r data"&gt;0.1651&lt;/TD&gt;
&lt;TD class="r data"&gt;12&lt;/TD&gt;
&lt;TD class="r data"&gt;13.17&lt;/TD&gt;
&lt;TD class="r data"&gt;&amp;lt;.0001&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l data"&gt;T-3557&lt;/TH&gt;
&lt;TD class="r data"&gt;1.8140&lt;/TD&gt;
&lt;TD class="r data"&gt;0.1651&lt;/TD&gt;
&lt;TD class="r data"&gt;12&lt;/TD&gt;
&lt;TD class="r data"&gt;10.99&lt;/TD&gt;
&lt;TD class="r data"&gt;&amp;lt;.0001&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l data"&gt;T-3826&lt;/TH&gt;
&lt;TD class="r data"&gt;2.4761&lt;/TD&gt;
&lt;TD class="r data"&gt;0.1651&lt;/TD&gt;
&lt;TD class="r data"&gt;12&lt;/TD&gt;
&lt;TD class="r data"&gt;14.99&lt;/TD&gt;
&lt;TD class="r data"&gt;&amp;lt;.0001&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l data"&gt;T-3835&lt;/TH&gt;
&lt;TD class="r data"&gt;2.3877&lt;/TD&gt;
&lt;TD class="r data"&gt;0.1651&lt;/TD&gt;
&lt;TD class="r data"&gt;12&lt;/TD&gt;
&lt;TD class="r data"&gt;14.46&lt;/TD&gt;
&lt;TD class="r data"&gt;&amp;lt;.0001&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l data"&gt;T-3858&lt;/TH&gt;
&lt;TD class="r data"&gt;2.3724&lt;/TD&gt;
&lt;TD class="r data"&gt;0.1651&lt;/TD&gt;
&lt;TD class="r data"&gt;12&lt;/TD&gt;
&lt;TD class="r data"&gt;14.37&lt;/TD&gt;
&lt;TD class="r data"&gt;&amp;lt;.0001&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l data"&gt;Titan&lt;/TH&gt;
&lt;TD class="r data"&gt;2.1424&lt;/TD&gt;
&lt;TD class="r data"&gt;0.1651&lt;/TD&gt;
&lt;TD class="r data"&gt;12&lt;/TD&gt;
&lt;TD class="r data"&gt;12.97&lt;/TD&gt;
&lt;TD class="r data"&gt;&amp;lt;.0001&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;DIV class="branch"&gt;&lt;BR /&gt;&lt;A name="IDX307" target="_blank"&gt;&lt;/A&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Glimmix: Tukey-Kramer Grouping for Genotype Least Squares Means (Alpha=0.05)" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c b header" colspan="4" scope="colgroup"&gt;Tukey-Kramer Grouping for Genotype Least Squares Means (Alpha=0.05)&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="c b header" colspan="4" scope="colgroup"&gt;LS-means with the same letter are not significantly different.&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l b header" scope="col"&gt;Genotype&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Estimate&lt;/TH&gt;
&lt;TH class="c headerempty" colspan="2" scope="colgroup"&gt;&amp;nbsp;&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="l data"&gt;T-3826&lt;/TH&gt;
&lt;TD class="r data"&gt;2.4761&lt;/TD&gt;
&lt;TD class="l data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="l data"&gt;A&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l data"&gt;&amp;nbsp;&lt;/TH&gt;
&lt;TD class="r data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="l data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="l data"&gt;A&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l data"&gt;T-3835&lt;/TH&gt;
&lt;TD class="r data"&gt;2.3877&lt;/TD&gt;
&lt;TD class="l data"&gt;B&lt;/TD&gt;
&lt;TD class="l data"&gt;A&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l data"&gt;&amp;nbsp;&lt;/TH&gt;
&lt;TD class="r data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="l data"&gt;B&lt;/TD&gt;
&lt;TD class="l data"&gt;A&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l data"&gt;Krewer&lt;/TH&gt;
&lt;TD class="r data"&gt;2.3842&lt;/TD&gt;
&lt;TD class="l data"&gt;B&lt;/TD&gt;
&lt;TD class="l data"&gt;A&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l data"&gt;&amp;nbsp;&lt;/TH&gt;
&lt;TD class="r data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="l data"&gt;B&lt;/TD&gt;
&lt;TD class="l data"&gt;A&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l data"&gt;T-3858&lt;/TH&gt;
&lt;TD class="r data"&gt;2.3724&lt;/TD&gt;
&lt;TD class="l data"&gt;B&lt;/TD&gt;
&lt;TD class="l data"&gt;A&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l data"&gt;&amp;nbsp;&lt;/TH&gt;
&lt;TD class="r data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="l data"&gt;B&lt;/TD&gt;
&lt;TD class="l data"&gt;A&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l data"&gt;T-2604&lt;/TH&gt;
&lt;TD class="r data"&gt;2.1743&lt;/TD&gt;
&lt;TD class="l data"&gt;B&lt;/TD&gt;
&lt;TD class="l data"&gt;A&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l data"&gt;&amp;nbsp;&lt;/TH&gt;
&lt;TD class="r data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="l data"&gt;B&lt;/TD&gt;
&lt;TD class="l data"&gt;A&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l data"&gt;Titan&lt;/TH&gt;
&lt;TD class="r data"&gt;2.1424&lt;/TD&gt;
&lt;TD class="l data"&gt;B&lt;/TD&gt;
&lt;TD class="l data"&gt;A&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l data"&gt;&amp;nbsp;&lt;/TH&gt;
&lt;TD class="r data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="l data"&gt;B&lt;/TD&gt;
&lt;TD class="l data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l data"&gt;T-3557&lt;/TH&gt;
&lt;TD class="r data"&gt;1.8140&lt;/TD&gt;
&lt;TD class="l data"&gt;B&lt;/TD&gt;
&lt;TD class="l data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P class="lia-align-left"&gt;You can see the mean grouping results are different. Which one should I use? Do you have better methods? Both results are reasonable to me. Greater variance of a group makes it harder to find significant difference between other groups. Log transformation stabilizes the variances and also shrinks big values to the central, but weakens the impact of unequal variances compared to modelling the heteroscedasticity directly.&lt;/P&gt;
&lt;P class="lia-align-left"&gt;Furthermore, when modeling the heteroscedasticity, sometimes convergency issue would occur, and the residual plots generally not as good as the log transformed data. Looks like transformation is easier to apply.&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-align-left"&gt;Any thought is appreciated!&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 28 Apr 2025 21:27:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Model-heteroscedasticity-directly-or-use-log-transformation/m-p/965322#M48439</guid>
      <dc:creator>RosieSAS</dc:creator>
      <dc:date>2025-04-28T21:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: Model heteroscedasticity directly or use log transformation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Model-heteroscedasticity-directly-or-use-log-transformation/m-p/965327#M48441</link>
      <description>&lt;P&gt;Log is not the only, or necessarily best, transformation to use. You can use the Box-Cox method to select a transformation. This can be done using PROC TRANSREG as suggested in the "Box-Cox Transformation" item in the list of Frequently Asked for Statistics (FASTats) at &lt;A href="http://support.sas.com/kb/30333" target="_blank"&gt;http://support.sas.com/kb/30333&lt;/A&gt;&amp;nbsp;. See the section in the TRANSREG documentation on the Box-Cox transformation.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Apr 2025 23:10:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Model-heteroscedasticity-directly-or-use-log-transformation/m-p/965327#M48441</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2025-04-28T23:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: Model heteroscedasticity directly or use log transformation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Model-heteroscedasticity-directly-or-use-log-transformation/m-p/965328#M48442</link>
      <description>&lt;P&gt;I think you should take "genotype" as G-side random effect and "rep" as R-side random effect according to your sample data. Like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data yield;
  input genotype $ rep yield bad_fruit purple_fruit;
  datalines;
Krewer	1	14.34	72	566
Krewer	2	11.49	53	521
Krewer	3	7.75	37	500
Titan	1	10.44	72	470
Titan	2	9.92	79	673
Titan	3	5.97	71	318
T-3557	1	10.51	217	1088
T-3557	2	6.22	132	612
T-3557	3	3.53	90	417
T-2604	1	11.10	13	344
T-2604	2	8.95	10	276
T-2604	3	6.85	14	269
T-3858	1	10.79	29	635
T-3858	2	10.01	35	500
T-3858	3	11.41	21	660
T-3826	1	12.67	77	711
T-3826	2	12.81	59	492
T-3826	3	10.38	24	357
T-3835	1	10.05	65	1021
T-3835	2	10.95	97	1042
T-3835	3	11.73	72	1050
;
run;


title "Model heteroscedasticity directly";
proc glimmix data=yield plots=residualpanel;
  ods exclude diffplot linesplot;
  class genotype rep;
  model yield =  bad_fruit purple_fruit ;
  &lt;STRONG&gt;random rep/subject=genotype  residual;
  random int/subject=genotype ;&lt;/STRONG&gt; **allow different variance by genotype;
/*  lsmeans genotype/adj=Tukey pdiff;*/
/*  ods output diffs=ppp lsmeans=mmm;*/
run;
&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Apr 2025 01:20:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Model-heteroscedasticity-directly-or-use-log-transformation/m-p/965328#M48442</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-04-29T01:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: Model heteroscedasticity directly or use log transformation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Model-heteroscedasticity-directly-or-use-log-transformation/m-p/965352#M48445</link>
      <description>Thanks for your suggestion. I'm more concerned about which way should I go, data transformation or modelling the heteroscedasticity?</description>
      <pubDate>Tue, 29 Apr 2025 12:33:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Model-heteroscedasticity-directly-or-use-log-transformation/m-p/965352#M48445</guid>
      <dc:creator>RosieSAS</dc:creator>
      <dc:date>2025-04-29T12:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: Model heteroscedasticity directly or use log transformation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Model-heteroscedasticity-directly-or-use-log-transformation/m-p/965353#M48446</link>
      <description>Thanks for your reply. Here yield, bad_fruit and purple_fruit are all response variables. Genotype is the factor we want to test its effect on these responses. That's how the experiment was designed.</description>
      <pubDate>Tue, 29 Apr 2025 12:36:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Model-heteroscedasticity-directly-or-use-log-transformation/m-p/965353#M48446</guid>
      <dc:creator>RosieSAS</dc:creator>
      <dc:date>2025-04-29T12:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: Model heteroscedasticity directly or use log transformation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Model-heteroscedasticity-directly-or-use-log-transformation/m-p/965401#M48449</link>
      <description>&lt;P&gt;1)&lt;/P&gt;
&lt;P&gt;Then build a model only have an intercept term ?&lt;BR /&gt;proc glimmix data=yield plots=residualpanel;&lt;BR /&gt;ods exclude diffplot linesplot;&lt;BR /&gt;class genotype rep;&lt;BR /&gt;model yield = ;&lt;BR /&gt;random rep/subject=genotype residual;&lt;BR /&gt;random int/subject=genotype ; **allow different variance by genotype;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2)&lt;/P&gt;
&lt;P&gt;or&amp;nbsp;a model only have an intercept&amp;nbsp; and REP term ?&lt;/P&gt;
&lt;P&gt;model yield = rep;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Apr 2025 01:10:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Model-heteroscedasticity-directly-or-use-log-transformation/m-p/965401#M48449</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-04-30T01:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: Model heteroscedasticity directly or use log transformation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Model-heteroscedasticity-directly-or-use-log-transformation/m-p/965417#M48451</link>
      <description>But genotype is a fixed effect. It should be in MODEL statement. The purpose of this analysis is to test the effect of genotype, it is not a random effect and no random intercepts of genotype.</description>
      <pubDate>Wed, 30 Apr 2025 13:00:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Model-heteroscedasticity-directly-or-use-log-transformation/m-p/965417#M48451</guid>
      <dc:creator>RosieSAS</dc:creator>
      <dc:date>2025-04-30T13:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: Model heteroscedasticity directly or use log transformation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Model-heteroscedasticity-directly-or-use-log-transformation/m-p/965425#M48452</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/251676"&gt;@RosieSAS&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thanks for your suggestion. I'm more concerned about which way should I go, data transformation or modelling the heteroscedasticity?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Actually, transforming the dependent variable is a way of dealing with heteroscedasticity. When it comes to dealing with heteroscedasticity, Box-Cox transformation belongs to a kind of remedy named variance-stablizing transformation (VST). As the name suggests, VST can "stablize" the variance of errors such that they can, on many occasions, mitigate heteroscedasticity. Another kind of transformation that belongs to VST is the signed modulus power transformation. As is documented in&amp;nbsp;&lt;A href="https://www.amazon.com/Heteroskedasticity-Regression-Correction-Quantitative-Applications/dp/1452234957/ref=tmm_pap_swatch_0?_encoding=UTF8&amp;amp;dib_tag=se&amp;amp;dib=eyJ2IjoiMSJ9.PAwQDT0CFsVZ_0UcpJ_G7A.qRx4aoDsizpuVGEGe-6OqL1Xe_PlQYVV8lGgTyKbxDw&amp;amp;qid=1746022332&amp;amp;sr=8-1" target="_blank"&gt;Heteroskedasticity in Regression: Detection and Correction (Quantitative Applications in the Social Sciences): Kaufman, Robert L.: 9781452234953: Amazon.com: Books&lt;/A&gt;, signed modulus power transformation has an advantage over the Box-Cox when the dependent variable takes strictly positive values. Although this issue may be fixed by adding a small positive constant to the dependent variable in Box-Cox transformation, the arbitrariness of the constant raises concerns in that different constants might lead to different λ's in the Box-Cox transformation.&lt;/P&gt;
&lt;P&gt;For a more in-depth appreciation of heteroscedasticity, you can refer to the book I mentioned in the preceding paragraph, which is the only monograph on heteroscedasticity that I can find. However, it should be pointed out that methods dealing with heteroscedasticity documented therein are not exhaustive. Other methods, including joint mean and variance models, have been developed but are not introduced in this book.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Apr 2025 14:24:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Model-heteroscedasticity-directly-or-use-log-transformation/m-p/965425#M48452</guid>
      <dc:creator>Season</dc:creator>
      <dc:date>2025-04-30T14:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: Model heteroscedasticity directly or use log transformation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Model-heteroscedasticity-directly-or-use-log-transformation/m-p/965433#M48453</link>
      <description>Thanks for your informative reply.</description>
      <pubDate>Wed, 30 Apr 2025 15:21:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Model-heteroscedasticity-directly-or-use-log-transformation/m-p/965433#M48453</guid>
      <dc:creator>RosieSAS</dc:creator>
      <dc:date>2025-04-30T15:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: Model heteroscedasticity directly or use log transformation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Model-heteroscedasticity-directly-or-use-log-transformation/m-p/965470#M48461</link>
      <description>But from your data structure, it looks like a classic longitude data for mixed model.&lt;BR /&gt;You have a SUBJECT variable genotype and REPEATED measure variable rep.</description>
      <pubDate>Wed, 30 Apr 2025 23:59:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Model-heteroscedasticity-directly-or-use-log-transformation/m-p/965470#M48461</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-04-30T23:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: Model heteroscedasticity directly or use log transformation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Model-heteroscedasticity-directly-or-use-log-transformation/m-p/965525#M48464</link>
      <description>&lt;P&gt;I would model the heterogeneous variances, at least for yield. The QQ plot is nearly straight, with only a bit of curvature at the low end. That looks to me to be acceptable. Just my opinion. For me, the main issue in this case is the nested nature of the random effects in this model. A question, are all genotypes present in each rep, so that this is an RCB design (3 plots with each having all 7 genotypes present). If that is the case, consider this heterogeneous variance approach:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;title "Consider REP as a block, model heteroscedasticity due to genotype at REP level";
proc glimmix data=yield plots=residualpanel noprofile;
  ods exclude diffplot linesplot;
  nloptions maxiter=1000;
  *lnyield=log(yield); /* in case you still want to try a log transformation */
  class genotype rep;
  model yield /*lnyield*/ = genotype;
  random intercept/subject=rep group=genotype;
  lsmeans genotype/adj=simulate(seed=111) diff adjdfe=row;
  covtest homogeneity;
  ods output diffs=ppp lsmeans=mmm;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 May 2025 15:59:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Model-heteroscedasticity-directly-or-use-log-transformation/m-p/965525#M48464</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2025-05-01T15:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: Model heteroscedasticity directly or use log transformation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Model-heteroscedasticity-directly-or-use-log-transformation/m-p/965543#M48465</link>
      <description>Thanks for your reply. Yes, REP works as blocks in the design just as your understanding. However, I don't fully understand why the heteroscedasticity was model like this. Genotype is not significant anymore. The results are very different. What I knew is that REP is a random effect, variances between genotypes are very different. Could you please explain more about the variance covariance structure? Thanks very much!</description>
      <pubDate>Thu, 01 May 2025 18:15:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Model-heteroscedasticity-directly-or-use-log-transformation/m-p/965543#M48465</guid>
      <dc:creator>RosieSAS</dc:creator>
      <dc:date>2025-05-01T18:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: Model heteroscedasticity directly or use log transformation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Model-heteroscedasticity-directly-or-use-log-transformation/m-p/965544#M48466</link>
      <description>When I add VC to the random statement, it only outputs the variance matrix for one subject, here is the rep 1. How to get the VC for all subjects?</description>
      <pubDate>Thu, 01 May 2025 18:18:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Model-heteroscedasticity-directly-or-use-log-transformation/m-p/965544#M48466</guid>
      <dc:creator>RosieSAS</dc:creator>
      <dc:date>2025-05-01T18:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: Model heteroscedasticity directly or use log transformation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Model-heteroscedasticity-directly-or-use-log-transformation/m-p/965555#M48467</link>
      <description>&lt;P&gt;With only 3 values in each genotype, there just isn't enough information to confidently estimate and compare the variances. But, for whatever it's worth and as discussed in &lt;A href="https://support.sas.com/kb/22/526.html" target="_self"&gt;this note&lt;/A&gt;, you can use Levene's test to make the comparison of variances and Welch's test to compare the means adjusting for the differing variances. These suggest no difference in variances; and no difference in means whether assuming equal variances or not.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glm; 
class genotype; 
model yield=genotype; 
means genotype/hovtest=levene welch; 
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 May 2025 20:49:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Model-heteroscedasticity-directly-or-use-log-transformation/m-p/965555#M48467</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2025-05-01T20:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: Model heteroscedasticity directly or use log transformation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Model-heteroscedasticity-directly-or-use-log-transformation/m-p/965605#M48471</link>
      <description>&lt;P&gt;That is what I get from the GLIMMIX code I posted as well. The standard errors of the by-genotype residual estimates are at least an order of magnitude greater than the point estimates and the chi-squared test for homogeneity is nonsignificant (pr&amp;gt;chisq = 0.2591). The F test for genotype is also non-significant (pr &amp;gt; F = 0.1851). My conclusion is that there is insufficient data to come to any frequentist conclusion about yield as a function of genotype.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I tried a quick look at the same design, but using the Bayesian approach provided in PROC BGLIMM. the 95% HPD intervals for the means of the genotypes all overlapped, as did the variance 95% HPD intervals. Same conclusions - insufficient data to come to a conclusion about yield as a function of genotype.&amp;nbsp; My code for this was:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc bglimm data=yield plots=all seed=12321; 
  class genotype rep;
  model yield  = genotype/noint;
  random intercept/subject=rep(genotype) group=genotype;
  run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;No ESTIMATE statements were used to look at pairwise comparisons as the overlapping intervals covered the whole of possible comparisons. Also, no need for multiple comparison adjustment with this approach.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 May 2025 14:48:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Model-heteroscedasticity-directly-or-use-log-transformation/m-p/965605#M48471</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2025-05-02T14:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: Model heteroscedasticity directly or use log transformation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Model-heteroscedasticity-directly-or-use-log-transformation/m-p/965645#M48473</link>
      <description>&lt;P&gt;By the way, section 9.3 of &lt;A href="https://www.amazon.com/Mixed-Models-Second-Ramon-Littell/dp/1590475003/ref=sr_1_1?crid=1XZS6XEH6JWGG&amp;amp;dib=eyJ2IjoiMSJ9.GfjteTBAQVUl9Zf8gywfKfYL7s8_JWPmIsCQ8ll-Ax39GWWn3NycnDbO7hZRA-7Cl8HLEfFLLrm3njFYjWnTgvch3yw63BQRFoD0RCu3D5-l_ddrriqu1VPu-HhohmgVNbwm99UCt-eltMVoiTIeMuuQBtHks98E_6Z-ouWZLvOYadBSC9du9PeaRUts9tPB3ggPBmaM_y6DsoSMI8adTQ.UdKA2dk_GlzzgmwbuZOCLb_9RMsXAxov_nyHj0jT_cU&amp;amp;dib_tag=se&amp;amp;keywords=sas+for+mixed+models&amp;amp;qid=1746259998&amp;amp;sprefix=sas+for+mixed+mode%2Caps%2C455&amp;amp;sr=8-1" target="_blank"&gt;Amazon.com: SAS for Mixed Models, Second Edition: 9781590475003: Littell, Ramon C., Milliken, George A., Stroup, Walter W., Wolfinger, Russell D., Schabenberber, Oliver, Ph.D.: Books&lt;/A&gt;&amp;nbsp;provides demonstrations and examples of dealing with heteroscedasticity in mixed models. In short, this is dealt with two approaches that in essence both belong to the joint mean and variance modeling approach. They are termed as "Power-of-X" and "Power-of-the-Mean" models.&lt;/P&gt;
&lt;P&gt;For Power-of-X models, the variance of residuals are modeled in this manner: Var(ei)=σ^2*exp(xγ), with γ being the regression coefficient. In SAS, this can be modeled by codes like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc mixed data=xxx;
/*other statements omitted*/
repeated /local=exp(x);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc nlmixed data=xxx;
/*other statements omitted*/
model y ~ normal(mean,sig2*exp(gamma*x));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The Power-of-the-Mean model assumes that the residuals are proportional to y_hat. Let yi_hat=β0+β1xi1+...+βkxik be the predicted dependent variable for the ith observation. The residuals are assumed to take the form Var(ei)=σ^2*|yi_hat|^θ, where θ is an unknown power parameter. SAS codes for this modeling approach are also documented in the book but are not displayed here because of their complexity. Refer to the book for more details.&lt;/P&gt;
&lt;P&gt;By the way, this book now has a newer edition: &lt;A href="https://www.amazon.com/SAS-Mixed-Models-Introduction-Applications/dp/1642951838/ref=tmm_hrd_swatch_0?_encoding=UTF8&amp;amp;dib_tag=se&amp;amp;dib=eyJ2IjoiMSJ9.GfjteTBAQVUl9Zf8gywfKfYL7s8_JWPmIsCQ8ll-Ax39GWWn3NycnDbO7hZRA-7Cl8HLEfFLLrm3njFYjWnTgvch3yw63BQRFoD0RCu3D5-l_ddrriqu1VPu-HhohmgVNbwm99UCt-eltMVoiTIeMuuQBtHks98E_6Z-ouWZLvOYadBSC9du9PeaRUts9tPB3ggPBmaM_y6DsoSMI8adTQ.UdKA2dk_GlzzgmwbuZOCLb_9RMsXAxov_nyHj0jT_cU&amp;amp;qid=1746259998&amp;amp;sr=8-2" target="_blank"&gt;SAS for Mixed Models: Introduction and Basic Applications: Stroup PH D, Walter W, Milliken PhD, George A, Claassen, Elizabeth a: 9781642951837: Amazon.com: Books&lt;/A&gt;. However, it is stated in the preface of the newer edition that contents regarding heterogeneous variance models are removed in that edition and are reserved to a later publication. For the time being, however, I have not found this publication.&lt;/P&gt;</description>
      <pubDate>Sat, 03 May 2025 08:38:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Model-heteroscedasticity-directly-or-use-log-transformation/m-p/965645#M48473</guid>
      <dc:creator>Season</dc:creator>
      <dc:date>2025-05-03T08:38:15Z</dc:date>
    </item>
  </channel>
</rss>

