<?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: Weight statement in proc mixed causes infinite likelihood error in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Weight-statement-in-proc-mixed-causes-infinite-likelihood-error/m-p/153047#M8008</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My belief is that the sum of the weighting factors does not have to equal 1.&amp;nbsp; What happens when you use 1/individual_variance as the weight?&amp;nbsp; Do you still obtain an infinite likelihood error?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use of type=un in the repeated statement will lead to estimating a covariance between the canopy_position levels, and may be the cause of the infinite likelihood due to (possible only) number of parameters being estimated.&amp;nbsp; What about trying:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;repeated /group=canopy_position;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which would estimate a separate residual variance for each level of canopy_position.&amp;nbsp; This is a more common way of modeling heteroskedasticity.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve Denham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Nov 2014 13:34:57 GMT</pubDate>
    <dc:creator>SteveDenham</dc:creator>
    <dc:date>2014-11-04T13:34:57Z</dc:date>
    <item>
      <title>Weight statement in proc mixed causes infinite likelihood error</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Weight-statement-in-proc-mixed-causes-infinite-likelihood-error/m-p/153044#M8005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I am running into problems when using the weight statement in proc mixed. I am trying to run a simple mixed model with two fixed effects (species and canopy_position) and their interaction, along with one random effect. Because of unequal variances between canopy_position groups, I want to run this model with an unstructured variance/covariance matrix, obtained from the repeated statement.&lt;/P&gt;&lt;P&gt;The values for phico2max are associated with some variability. To account for this I introduced the weight statement with the variable phico2max_weight, equal to (1/individual_variance)/(1/total_variance). This gives more power to the more precise (i.e. lower individual_variance) values of phico2max.&lt;/P&gt;&lt;P&gt;This model works when the weight statement is present but the random and repeated statements are left out, or when the random and/or repeated statements are present but the weight statement is left out. If the weight statement is present together with the random or repeated statements, the model fails &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;and the following error message appears in the log:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;NOTE: An infinite likelihood is assumed in iteration 0 because of a nonpositive&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; definite estimated R matrix for Subject 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I get the weight statement to function with a random statement and unstructured variance/covariance?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc mixed data=aq; class species canopy_position year;&lt;/P&gt;&lt;P&gt;model phico2max=species|canopy_position;&lt;/P&gt;&lt;P&gt;repeated/type=un;&lt;/P&gt;&lt;P&gt;weight phico2max_weight;&lt;/P&gt;&lt;P&gt;random year;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Nov 2014 19:18:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Weight-statement-in-proc-mixed-causes-infinite-likelihood-error/m-p/153044#M8005</guid>
      <dc:creator>charles_pignon1</dc:creator>
      <dc:date>2014-11-01T19:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: Weight statement in proc mixed causes infinite likelihood error</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Weight-statement-in-proc-mixed-causes-infinite-likelihood-error/m-p/153045#M8006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Walk me through the design, and see if I have it correct.&amp;nbsp; You have multiple measures on phico2max, which have been summarized from individual measures, so that you know the total variation and the variation for the measure at that point.&amp;nbsp; If so, then the weight should be 1/individual_variance, if you want unbiased estimates from the procedure.The total_variance will be estimated by the model.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suspect the infinite likelihood is due to multiple measures within a subject, and you have not specified the subject= option in the repeated statement to disambiguate these multiple measurements.&amp;nbsp; So, one more design question: what is the experimental unit here that has repeated measures?&amp;nbsp; I believe that needs to be captured in your code,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve Denham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Nov 2014 14:59:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Weight-statement-in-proc-mixed-causes-infinite-likelihood-error/m-p/153045#M8006</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2014-11-03T14:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: Weight statement in proc mixed causes infinite likelihood error</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Weight-statement-in-proc-mixed-causes-infinite-likelihood-error/m-p/153046#M8007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;phico2max is a slope derived from linear regression of a Y variable to a X variable. To simplify the model, neither this Y nor this X variable are included, but instead I am running my statistical analysis on the values for phico2max. Therefore each value of phico2max only appears once and has a unique identifier, and there are no repeated measures. The model is then simply phico2max=&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;μ + &lt;/SPAN&gt;canopy_position + species + canopy_position*species + year + &lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;ε&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;there is replication within each canopy_position, each species, and each year.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;The weight statement is used because each value of phico2max was obtained from a linear regression, and so is associated with a standard error: I want to give more weight to slopes associated with a small standard error, hence the &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;(1/individual_variance)/(1/total_variance).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;The unstructured variance/covariance matrix is used because residual variance is unequal between canopy_positions.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;The random statement is used because year is considered random.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Using 1/individual_variance as the weighting factor actually allowed the code to run correctly, but I believe that for the weighting factor to be correct the sum of all weighting factors must be equal to 1. This isn't the case if the weighting factor is 1/individual_variance. Does my issue lie in the math, or in the code?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Nov 2014 23:03:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Weight-statement-in-proc-mixed-causes-infinite-likelihood-error/m-p/153046#M8007</guid>
      <dc:creator>charles_pignon1</dc:creator>
      <dc:date>2014-11-03T23:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: Weight statement in proc mixed causes infinite likelihood error</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Weight-statement-in-proc-mixed-causes-infinite-likelihood-error/m-p/153047#M8008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My belief is that the sum of the weighting factors does not have to equal 1.&amp;nbsp; What happens when you use 1/individual_variance as the weight?&amp;nbsp; Do you still obtain an infinite likelihood error?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use of type=un in the repeated statement will lead to estimating a covariance between the canopy_position levels, and may be the cause of the infinite likelihood due to (possible only) number of parameters being estimated.&amp;nbsp; What about trying:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;repeated /group=canopy_position;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which would estimate a separate residual variance for each level of canopy_position.&amp;nbsp; This is a more common way of modeling heteroskedasticity.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve Denham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2014 13:34:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Weight-statement-in-proc-mixed-causes-infinite-likelihood-error/m-p/153047#M8008</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2014-11-04T13:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: Weight statement in proc mixed causes infinite likelihood error</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Weight-statement-in-proc-mixed-causes-infinite-likelihood-error/m-p/153048#M8009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As Steve says, there is no reason to rescale the weights. Just use 1/(individual_variance).&lt;/P&gt;&lt;P&gt;Using repeated /type=un&lt;/P&gt;&lt;P&gt;will just give you a single variance (even though you specified unstructed). THis is because you do not have a subject= option. Without this option, each observation is a single subject. If your goal is to have a different weight for each canopy position, then use the code given by Steve:&lt;/P&gt;&lt;P&gt;repeated / group = canopy_position;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2014 15:25:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Weight-statement-in-proc-mixed-causes-infinite-likelihood-error/m-p/153048#M8009</guid>
      <dc:creator>lvm</dc:creator>
      <dc:date>2014-11-04T15:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: Weight statement in proc mixed causes infinite likelihood error</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Weight-statement-in-proc-mixed-causes-infinite-likelihood-error/m-p/153049#M8010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I looked back into this and you are both right, &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;1/(individual_variance) works. I was concerned that using weight values that did not sum to 1 would bias the parameter estimates, however it turns out this is not an issue in regression analysis. Separating residual variance between canopy_position is also closer to what I wanted to do (instead of a generalized unstructured variance-covariance matrix). Thanks for your help!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Charles&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Nov 2014 00:07:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Weight-statement-in-proc-mixed-causes-infinite-likelihood-error/m-p/153049#M8010</guid>
      <dc:creator>charles_pignon1</dc:creator>
      <dc:date>2014-11-06T00:07:09Z</dc:date>
    </item>
  </channel>
</rss>

