<?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 Can you help me validate shrinkage of random effects? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Can-you-help-me-validate-shrinkage-of-random-effects/m-p/525474#M26622</link>
    <description>&lt;P&gt;I'm trying to validate the shrinkage that gets applied in the estimation of random effects solutions. (I fit a pretty basic random effects only model, no fixed effects, just intercepts). However, my estimates look like they're a little off. Can anyone provide any resources or help validating?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Update: Here's the code I used to run the procedure:&lt;/P&gt;&lt;P&gt;proc glimmix data= data6;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; by rating_group;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; class duration;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; model relativity = offset /solution noint; /*the offset variable is just 1 for all entries - I was getting errors without that fix*/&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; random intercept / subject= duration solution;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below are the parameter results I'm seeing:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Random Effect Level&lt;/TD&gt;&lt;TD&gt;Parameter estimated by Hand&lt;/TD&gt;&lt;TD&gt;From Model&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1.20&lt;/TD&gt;&lt;TD&gt;1.20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt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t;&lt;P&gt;alpha = Z * xbar + (1-Z) * mu&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;with z = V1/(V1 + V2)&lt;/P&gt;&lt;P&gt;where V1 is the variance of level i of the random factor, V2 is the variance of the random effects.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Still more notes:&lt;/P&gt;&lt;P&gt;I calculated V1 as the variance (from proc means) divided by the number of observations in that random effect level&lt;/P&gt;&lt;P&gt;I calculated V2 as the variance of the means&amp;nbsp;of each random effect&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm just starting to learn about random effects models, so any help or resources would be greatly appreciated! Thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 08 Jan 2019 17:01:53 GMT</pubDate>
    <dc:creator>dschmidt</dc:creator>
    <dc:date>2019-01-08T17:01:53Z</dc:date>
    <item>
      <title>Can you help me validate shrinkage of random effects?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Can-you-help-me-validate-shrinkage-of-random-effects/m-p/525474#M26622</link>
      <description>&lt;P&gt;I'm trying to validate the shrinkage that gets applied in the estimation of random effects solutions. (I fit a pretty basic random effects only model, no fixed effects, just intercepts). However, my estimates look like they're a little off. Can anyone provide any resources or help validating?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Update: Here's the code I used to run the procedure:&lt;/P&gt;&lt;P&gt;proc glimmix data= data6;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; by rating_group;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; class duration;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; model relativity = offset /solution noint; /*the offset variable is just 1 for all entries - I was getting errors without that fix*/&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; random intercept / subject= duration solution;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp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;TR&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;0.96&lt;/TD&gt;&lt;TD&gt;1.02&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;11&lt;/TD&gt;&lt;TD&gt;0.97&lt;/TD&gt;&lt;TD&gt;1.00&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Other notes - I used&amp;nbsp;the formula&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;alpha = Z * xbar + (1-Z) * mu&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;with z = V1/(V1 + V2)&lt;/P&gt;&lt;P&gt;where V1 is the variance of level i of the random factor, V2 is the variance of the random effects.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Still more notes:&lt;/P&gt;&lt;P&gt;I calculated V1 as the variance (from proc means) divided by the number of observations in that random effect level&lt;/P&gt;&lt;P&gt;I calculated V2 as the variance of the means&amp;nbsp;of each random effect&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm just starting to learn about random effects models, so any help or resources would be greatly appreciated! Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 17:01:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Can-you-help-me-validate-shrinkage-of-random-effects/m-p/525474#M26622</guid>
      <dc:creator>dschmidt</dc:creator>
      <dc:date>2019-01-08T17:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me validate shrinkage of random effects?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Can-you-help-me-validate-shrinkage-of-random-effects/m-p/525482#M26623</link>
      <description>&lt;P&gt;You did not mention which procedure you are using to get the random effects. As a minimum it will help have the code you used for that posted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can get differences when using summaries from other procedures because most of the modeling procedures will not use any of the records with missing values for any of the variables on a model statement by default. Proc Means/Summary/Univariate would use&amp;nbsp;all values including from the observations excluded by the model. So your by hand calculation may be based on different records. Check the summary&amp;nbsp;table to see if the numbers of observations used in the model match for you proc means. &amp;nbsp;If the don't you would want to rerun your proc means insuring that only records with all variables present are used in the summaries. A where statement similar to:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;where not missing(var1) and not missing(var2) and not missing(var3);&lt;/P&gt;
&lt;P&gt;in you proc means code might get closer by hand calculations if observations were excluded in your modeling proc.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 16:40:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Can-you-help-me-validate-shrinkage-of-random-effects/m-p/525482#M26623</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-01-08T16:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me validate shrinkage of random effects?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Can-you-help-me-validate-shrinkage-of-random-effects/m-p/525494#M26624</link>
      <description>&lt;P&gt;Thanks for the response!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, I think the dataset is pretty clean and tidy - I cleaned up any missing or other problem values before running. The counts from proc means match the counts from proc glimmix. I'm thinking the problem may be related to my math/lack of understanding of random models if anything. I updated my post to include the procedure that I used.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again!!&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 17:04:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Can-you-help-me-validate-shrinkage-of-random-effects/m-p/525494#M26624</guid>
      <dc:creator>dschmidt</dc:creator>
      <dc:date>2019-01-08T17:04:54Z</dc:date>
    </item>
  </channel>
</rss>

