<?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: Bizarre residuals PROC MIXED in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Bizarre-residuals-PROC-MIXED/m-p/260453#M13761</link>
    <description>&lt;P&gt;Thanks to a colleague, I think I now understand the Mystery of the Positive Residuals.&amp;nbsp; I think the OP and others already understand the problem, but for the sake of those who are still confused let me try to explain something that initially confused me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By default, a residual panel shows &lt;STRONG&gt;marginal&lt;/STRONG&gt; residuals. The title of a marginal panel plot is "Residuals for Y,"&amp;nbsp;which is the title for the panel that the OP attached.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The PLOTS=RESIDUALPANEL option takes suboptions.&amp;nbsp; If you specify&lt;/P&gt;
&lt;P&gt;plots=residualpanel(conditional)&lt;/P&gt;
&lt;P&gt;then you get a plot of the conditional residuals. The title for a panel plot of the conditional residuals is "Conditional Residuals for Y."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The OP hinted that "all of the conditional residual plots look good", so apparently realized that&amp;nbsp;the marginal residuals were being displayed. However, I (and maybe other readers) did not appreciate the importance of that comment.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mathematicaly, &lt;STRONG&gt;conditional&lt;/STRONG&gt; residuals will have approximately zero mean. However, &amp;nbsp;&lt;STRONG&gt;marginal&lt;/STRONG&gt; residuals do not necessarily have mean zero. The marginal residuals are&lt;/P&gt;
&lt;P&gt;R_marginal = Y&amp;nbsp;- X*beta = Z*gamma + epsilon&lt;/P&gt;
&lt;P&gt;and one of the columns of Z is the continuous variable "initial plant height," which is all postive. Because of other fitting problems (described by others) the fitted coefficients for the model resulted in positive marginal residuals.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 31 Mar 2016 15:47:54 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2016-03-31T15:47:54Z</dc:date>
    <item>
      <title>Bizarre residuals PROC MIXED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Bizarre-residuals-PROC-MIXED/m-p/255446#M13486</link>
      <description>&lt;P&gt;EDIT: &amp;nbsp;I now found that if I omit initial plant height ("initht") in the random statement, I do not have the issue with the residuals described below. &amp;nbsp;Hopefully, this can lend some insight.&lt;/P&gt;
&lt;P&gt;---------------&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am fitting a model with PROC MIXED. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a continuous response variable "biomass" and 3 predictor variables 1) light (2 level categorical) 2) flood depth (ranked ordinal) and 3) flood duration (ranked ordinal), and I am fitting all 2 and 3 way interactions. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have 2 random effects, initial plant height and experimental block.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is my model statement (flood depth is "sublevel"). &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC MIXED data=RUN1biomass covtest plots=(residualpanel);&lt;BR /&gt; CLASS Block Light sublevel duration;&lt;BR /&gt; MODEL AGB=Light&amp;nbsp;Sublevel duration&lt;/P&gt;
&lt;P&gt;duration*Light&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;SubLevel*Light SubLevel*Duration Sublevel*Light*Duration / influence DDFM=SATTERTH OUTP=work.diagnostics RESIDUAL;&lt;BR /&gt;RANDOM Block initht;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The model runs fine but I don't understand the residuals. &amp;nbsp;I am attaching the residual panel produced by proc mixed. &amp;nbsp;Notice that ALL THE RESIDUALS ARE POSITIVE. &amp;nbsp;How is this even possible?? &amp;nbsp;Is this some glitch or is there any way this actually makes some sense? The studentized residual panels and pearson residual plots look basically the same. &amp;nbsp;All of the conditional residual plots look good--normal distribution of residuals and random scatter around 0. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!!&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/2249i5201EF931F9E1C73/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="ResidualPanel8.png" title="ResidualPanel8.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;And here is the output from proc mixed&amp;nbsp;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/2250iA18C6AD309DF9B70/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="output.png" title="output.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2016 07:30:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Bizarre-residuals-PROC-MIXED/m-p/255446#M13486</guid>
      <dc:creator>mrlang02</dc:creator>
      <dc:date>2016-03-09T07:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: Bizarre residuals PROC MIXED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Bizarre-residuals-PROC-MIXED/m-p/259750#M13722</link>
      <description>&lt;P&gt;I don't see there is an issue from the residual plot.&amp;nbsp;The horizontal axis in the residual histogram is from 0.0 to 1.5 and is normally distributed. This indicates all the predictions are larger than the raw data, and therefore the residuals are positive.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One thing is more serious from this output is that the model might be overfitting. Because the covariance parameter estimates for effect block is 0. You should see&amp;nbsp;some notes in the log window such&amp;nbsp;as "NOTE&amp;nbsp;:&lt;SPAN class="csBCB4C014"&gt; Estimated G matrix is not positive definite &lt;/SPAN&gt;".&amp;nbsp;This means there is not much variation between blocks. You might consider take out effect BLOCK and rerun the model to see what happens.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 15:53:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Bizarre-residuals-PROC-MIXED/m-p/259750#M13722</guid>
      <dc:creator>cici0017</dc:creator>
      <dc:date>2016-03-29T15:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: Bizarre residuals PROC MIXED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Bizarre-residuals-PROC-MIXED/m-p/259948#M13741</link>
      <description>&lt;P&gt;You are right: residuals that do not have mean = 0 indicate a serious problem with the model. Good spotting! As you note in your update, the fundamental problem was specifying INITHT as a random effects factor. But there may be other issues.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have not provided enough information to determine the correct model. Let's say that you have blocks, and within each block you have multiple plots. BLOCKs&amp;nbsp;and PLOTs&amp;nbsp;comprise random effects factors. Each fixed effects factor (LIGHT, SUBLEVEL, and DURATION) is associated (ideally, randomly assigned) to a level of &lt;EM&gt;one&lt;/EM&gt; of the random effects factors. It could be that all three fixed effects factors are assigned to individual PLOTs. Or it could be that one (or more) fixed effects factors are assigned to BLOCKs, and the others are assigned to PLOTs. The statistical model must reflect the experimental design.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that ANOVA (where &lt;SPAN&gt;LIGHT&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;SUBLEVEL&lt;/SPAN&gt;&lt;SPAN&gt;, and &lt;/SPAN&gt;&lt;SPAN&gt;DURATION&lt;/SPAN&gt; are classification effects) does &lt;EM&gt;not&lt;/EM&gt; take into account whether the levels of a fixed effects factor are ordered. To accommodate ordered levels, you have to either regress on the fixed effects factor (which can no longer be listed in the CLASS statement) or specify contrasts (the LSMESTIMATE statement is very handy) that address the ordered levels (i.e., linear, quadratic, etc.).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I presume that you have appreciable variability among PLANTs&amp;nbsp;in INITHT&amp;nbsp;and that there is a relationship between AGB and INITHT that you would like to incorporate into the statistical model. One approach is to use an analysis of covariance model (ANCOVA) in which INITHT is a continuous-scale fixed effects factor (and so is included in the MODEL statement, but not in the CLASS statement, because the model is &lt;EM&gt;regressing&lt;/EM&gt; AGB on INITHT) and which&amp;nbsp;potentially interacts with other fixed effects factors (&lt;SPAN&gt;LIGHT&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;SUBLEVEL&lt;/SPAN&gt;&lt;SPAN&gt;, and &lt;/SPAN&gt;&lt;SPAN&gt;DURATION&lt;/SPAN&gt;). Depending on the experimental design, the statistical model may be a &lt;EM&gt;random coefficients model&lt;/EM&gt; (essentially a regression in a mixed model); but we don't have enough information to tell.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This brings us to PLANT, which is the unit on which INITHT, and presumably AGB, is measured. Is PLANT equivalent to PLOT, or are there multiple PLANTs within each PLOT? Multiple PLANTs within a PLOT typically would&amp;nbsp;be considered as subsamples. The&amp;nbsp;design structure--whatever it is--must be reflected in the statistical model.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As you might imagine, there are many subtleties to the correct implementation of subsamples, ordinal contrasts, ANCOVA-with-interactions models, and random coefficients models in a statistical model. Probably more than can be adequately addressed in a forum like this. Hopefully my comments provide you with some places to start.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2016 02:59:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Bizarre-residuals-PROC-MIXED/m-p/259948#M13741</guid>
      <dc:creator>sld</dc:creator>
      <dc:date>2016-03-30T02:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: Bizarre residuals PROC MIXED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Bizarre-residuals-PROC-MIXED/m-p/260453#M13761</link>
      <description>&lt;P&gt;Thanks to a colleague, I think I now understand the Mystery of the Positive Residuals.&amp;nbsp; I think the OP and others already understand the problem, but for the sake of those who are still confused let me try to explain something that initially confused me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By default, a residual panel shows &lt;STRONG&gt;marginal&lt;/STRONG&gt; residuals. The title of a marginal panel plot is "Residuals for Y,"&amp;nbsp;which is the title for the panel that the OP attached.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The PLOTS=RESIDUALPANEL option takes suboptions.&amp;nbsp; If you specify&lt;/P&gt;
&lt;P&gt;plots=residualpanel(conditional)&lt;/P&gt;
&lt;P&gt;then you get a plot of the conditional residuals. The title for a panel plot of the conditional residuals is "Conditional Residuals for Y."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The OP hinted that "all of the conditional residual plots look good", so apparently realized that&amp;nbsp;the marginal residuals were being displayed. However, I (and maybe other readers) did not appreciate the importance of that comment.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mathematicaly, &lt;STRONG&gt;conditional&lt;/STRONG&gt; residuals will have approximately zero mean. However, &amp;nbsp;&lt;STRONG&gt;marginal&lt;/STRONG&gt; residuals do not necessarily have mean zero. The marginal residuals are&lt;/P&gt;
&lt;P&gt;R_marginal = Y&amp;nbsp;- X*beta = Z*gamma + epsilon&lt;/P&gt;
&lt;P&gt;and one of the columns of Z is the continuous variable "initial plant height," which is all postive. Because of other fitting problems (described by others) the fitted coefficients for the model resulted in positive marginal residuals.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2016 15:47:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Bizarre-residuals-PROC-MIXED/m-p/260453#M13761</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-03-31T15:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: Bizarre residuals PROC MIXED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Bizarre-residuals-PROC-MIXED/m-p/260834#M13793</link>
      <description>&lt;P&gt;Rick, I'm glad you reminded folks about the difference between marginal and conditional residuals. Both have value for different applications. Conditional residuals are labeled as "Conditional residuals" on the graph, but marginal residuals are justed labeled as "Residuals". That can be confusing.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Apr 2016 20:47:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Bizarre-residuals-PROC-MIXED/m-p/260834#M13793</guid>
      <dc:creator>lvm</dc:creator>
      <dc:date>2016-04-01T20:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: Bizarre residuals PROC MIXED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Bizarre-residuals-PROC-MIXED/m-p/452393#M23621</link>
      <description>&lt;P&gt;This is a follow-up to your response to residual from proc mixed. The internally conditional residual is usually obtained from model statement as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Model Y=trt/ddfm=kr outp= cond_resid residual;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The addition of influence option to model statement will return an externally conditional residual which can be obtained through&lt;/P&gt;&lt;P&gt;ods output Influence = output_dataname.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The output from influence has as well internally conditional residual which differed from what one obtained from model statement through cond_resid file. How do we explain this disparity.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 09 Apr 2018 03:30:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Bizarre-residuals-PROC-MIXED/m-p/452393#M23621</guid>
      <dc:creator>mbakare</dc:creator>
      <dc:date>2018-04-09T03:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: Bizarre residuals PROC MIXED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Bizarre-residuals-PROC-MIXED/m-p/452678#M23649</link>
      <description>&lt;P&gt;&lt;SPAN&gt;The INFLUENCE option produces internally and externally studentized&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;marginal&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;(not conditional) residuals.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Apr 2018 22:03:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Bizarre-residuals-PROC-MIXED/m-p/452678#M23649</guid>
      <dc:creator>sld</dc:creator>
      <dc:date>2018-04-09T22:03:49Z</dc:date>
    </item>
  </channel>
</rss>

