<?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 GLM vs. Proc MIXED: how to specify error term in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-GLM-vs-Proc-MIXED-how-to-specify-error-term/m-p/514756#M26277</link>
    <description>Thank you very much for your quick reply. The latter does makes sense and the degrees of freedom are now displayed correctly.&lt;BR /&gt;&lt;BR /&gt;Maybe I repeat myself, but is not the test just nested in the lab? Like the classroom in each school. Why is one random statement sufficient and not two:&lt;BR /&gt;&lt;BR /&gt;random int / subject=lab;&lt;BR /&gt;random int / subject=test(lab);&lt;BR /&gt;&lt;BR /&gt;Sure, again I would have the notes:&lt;BR /&gt;NOTE: Convergence criteria met but final Hessian is not positive definite.&lt;BR /&gt;NOTE: Estimated G matrix is not positive definite.&lt;BR /&gt;Just for my understanding, I don't see it yet... The test is the same but can be applied differently in each lab (which I expect). Example: Even if I have the same sample and it is examined in two labs using the same test kit, the measurements will differ (possibly).&lt;BR /&gt;&lt;BR /&gt;Besides, the samples are considered independent, i.e. as 390 samples and not just 10?</description>
    <pubDate>Tue, 20 Nov 2018 14:19:50 GMT</pubDate>
    <dc:creator>lotcarrots</dc:creator>
    <dc:date>2018-11-20T14:19:50Z</dc:date>
    <item>
      <title>Proc GLM vs. Proc MIXED: how to specify error term</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-GLM-vs-Proc-MIXED-how-to-specify-error-term/m-p/514495#M26267</link>
      <description>&lt;P&gt;Imagine a ring trial with 10 samples, each tested by a lab. &lt;SPAN class=""&gt;There are 30 laboratories using one of 3 test kits,&lt;/SPAN&gt; thus the head of a data set might look like attached.&lt;/P&gt;&lt;P&gt;Analysing the differences in the main effect of testkit can be done in proc glm via&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC GLM DATA=dataset; 
	class sample test lab;
	model y = sample test lab(test) sample*test;
	test H=test E=lab(test);&lt;BR /&gt;  /* see if test is different, when assuming that testsets are specific to the lab (error term) */
	lsmeans sample;
	lsmeans test/ E=lab(test) tdiff pdiff;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I check for an overall effect of the testkits AND an effect of testkit assuming another error structure in proc mixed?&lt;BR /&gt;&lt;BR /&gt;At the moment I need two codes, first for the overall effect:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc mixed data=dataset;
	class sample test lab;
	model y = sample test lab(test) sample*test;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;second for redefining the random component / error structure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc mixed data=dataset covtest;
	class sample test lab;
	model y = sample test sample*test / ddfm=BETWITHIN;
	random lab lab*test;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN class=""&gt;In the latter I have to specify the ddfm, otherwise no DF can be calculated. For the covtest results, the test*lab interaction has an estimate of 0 (?), specifying nobound does not alter results. Writing method=type3 does not give any results.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Am I on the right path and can I combine the two outputs in proc mixed to see that there is a significant interaction for lab*test but no difference in testkits overall?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am reading SAS FOR LINEAR MODELS (Littell), but it seems like I am missing something. W&lt;SPAN class=""&gt;orking in SAS 9.4. on Windows.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2018 17:02:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-GLM-vs-Proc-MIXED-how-to-specify-error-term/m-p/514495#M26267</guid>
      <dc:creator>lotcarrots</dc:creator>
      <dc:date>2018-11-19T17:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: Proc GLM vs. Proc MIXED: how to specify error term</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-GLM-vs-Proc-MIXED-how-to-specify-error-term/m-p/514504#M26268</link>
      <description>&lt;P&gt;Are there any errors or warnings in the SAS log with the second PROC MIXED you used?&amp;nbsp; Since lab 2 only did test B, that will make the analysis of lab and test more difficult&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2018 17:18:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-GLM-vs-Proc-MIXED-how-to-specify-error-term/m-p/514504#M26268</guid>
      <dc:creator>StatsMan</dc:creator>
      <dc:date>2018-11-19T17:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: Proc GLM vs. Proc MIXED: how to specify error term</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-GLM-vs-Proc-MIXED-how-to-specify-error-term/m-p/514682#M26274</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;Sorry, I didn't want to inflate the spreadsheet too much and just wrote down the head of the data as an example. Please see the full structure attached. These are 39 laboratories x 10 samples, i.e. 390 observations. From the labs, 4 use test A, 13 test B and 22 test C. y is continuous from approx. -10 to + 200.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Only note in the log is: Estimated G matrix is not positive definite. (for the second proc mixed.)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2018 07:30:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-GLM-vs-Proc-MIXED-how-to-specify-error-term/m-p/514682#M26274</guid>
      <dc:creator>lotcarrots</dc:creator>
      <dc:date>2018-11-20T07:30:03Z</dc:date>
    </item>
    <item>
      <title>Re: Proc GLM vs. Proc MIXED: how to specify error term</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-GLM-vs-Proc-MIXED-how-to-specify-error-term/m-p/514727#M26275</link>
      <description>&lt;P&gt;Thanks for the additional information.&amp;nbsp; The message that the G matrix is not positive definite is an indication that there is a problem with the random effects you are trying to fit.&amp;nbsp; Your RANDOM statement has LAB*TEST.&amp;nbsp; However, each of your labs only saw one level of test.&amp;nbsp; It will be difficult to estimate that interaction when your design did not account for the interaction effect.&amp;nbsp; You would ideally need each lab to perform all 3 tests if you wanted to measure the LAB*TEST effect.&amp;nbsp; The best you can do now is to drop the LAB*TEST effect from the RANDOM statement.&amp;nbsp; Since you want to use DDFM=BW, I would also change your RANDOM statement to&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;random int / subject=lab;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;so that MIXED knows how to break up the between- and within- subject effects.&amp;nbsp; Without a SUBJECT= effect on a RANDOM statement, BW will assign all effects the residual df.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2018 12:42:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-GLM-vs-Proc-MIXED-how-to-specify-error-term/m-p/514727#M26275</guid>
      <dc:creator>StatsMan</dc:creator>
      <dc:date>2018-11-20T12:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: Proc GLM vs. Proc MIXED: how to specify error term</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-GLM-vs-Proc-MIXED-how-to-specify-error-term/m-p/514756#M26277</link>
      <description>Thank you very much for your quick reply. The latter does makes sense and the degrees of freedom are now displayed correctly.&lt;BR /&gt;&lt;BR /&gt;Maybe I repeat myself, but is not the test just nested in the lab? Like the classroom in each school. Why is one random statement sufficient and not two:&lt;BR /&gt;&lt;BR /&gt;random int / subject=lab;&lt;BR /&gt;random int / subject=test(lab);&lt;BR /&gt;&lt;BR /&gt;Sure, again I would have the notes:&lt;BR /&gt;NOTE: Convergence criteria met but final Hessian is not positive definite.&lt;BR /&gt;NOTE: Estimated G matrix is not positive definite.&lt;BR /&gt;Just for my understanding, I don't see it yet... The test is the same but can be applied differently in each lab (which I expect). Example: Even if I have the same sample and it is examined in two labs using the same test kit, the measurements will differ (possibly).&lt;BR /&gt;&lt;BR /&gt;Besides, the samples are considered independent, i.e. as 390 samples and not just 10?</description>
      <pubDate>Tue, 20 Nov 2018 14:19:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-GLM-vs-Proc-MIXED-how-to-specify-error-term/m-p/514756#M26277</guid>
      <dc:creator>lotcarrots</dc:creator>
      <dc:date>2018-11-20T14:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: Proc GLM vs. Proc MIXED: how to specify error term</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-GLM-vs-Proc-MIXED-how-to-specify-error-term/m-p/515077#M26280</link>
      <description>&lt;P&gt;Are the samples the same across the labs?&amp;nbsp; For example, is sample 1 in lab 1 the same as sample 1 in lab 2?&amp;nbsp; or are the samples just reps in your experiment?&amp;nbsp; If they samples just represent replications within a lab (ie, sample 1 in lab 1 is not the same sample as sample 1 in lab 2) then you do not want sample as an effect in your model.&amp;nbsp; TEST would be the only effect on the MODEL statement in that case.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If each lab sees a set of the tests, then you can model lab*test as a random effect.&amp;nbsp; If not, then you can only model lab as random.&amp;nbsp; The data just will not support a more complicated variance structure.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Nov 2018 13:11:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-GLM-vs-Proc-MIXED-how-to-specify-error-term/m-p/515077#M26280</guid>
      <dc:creator>StatsMan</dc:creator>
      <dc:date>2018-11-21T13:11:25Z</dc:date>
    </item>
    <item>
      <title>Re: Proc GLM vs. Proc MIXED: how to specify error term</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-GLM-vs-Proc-MIXED-how-to-specify-error-term/m-p/515082#M26282</link>
      <description>The 10 samples are the same for every lab, i.e. sample 1 in lab 1 equals sample 1 in lab 2. Exactly that's my question: Personally, I would model test(lab) in a second random term, but according to your first answer, that's not possible?</description>
      <pubDate>Wed, 21 Nov 2018 13:25:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-GLM-vs-Proc-MIXED-how-to-specify-error-term/m-p/515082#M26282</guid>
      <dc:creator>lotcarrots</dc:creator>
      <dc:date>2018-11-21T13:25:01Z</dc:date>
    </item>
  </channel>
</rss>

