<?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: error when running repeat statement in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/434422#M22900</link>
    <description>&lt;P&gt;The Littell et al. text is not a one-day project &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp; I'm looking forward to the next version.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, I saw your message and then when I looked again, it was gone. Odd.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;GLIMMIX offers all the same covariance structures as does MIXED, except for the Kronecker products. And GLIMMIX has a few more than MIXED. GLIMMIX also provides the option of sandwich estimators ("empirical"), including modifications that perform better with small samples that are not available in MIXED. In my opinion, with few exceptions, GLIMMIX is a better tool than MIXED; I rarely use MIXED anymore.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The empirical options does not work at all well for analysis of this data set. According to&amp;nbsp;&lt;A href="http://newprairiepress.org/cgi/viewcontent.cgi?article=1259&amp;amp;context=agstatconference" target="_self"&gt;an old paper by Walt Stroup&lt;/A&gt;&amp;nbsp;(and other sources):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"This approach assumes that the number of subjects per treatment is substantially greater than the number of times of observation. When the number of observation times is equal to or greater than the number of subjects per treatment, as often happens in agricultural experiments, the empirical estimate of Var(K'b) may actually be less than the model-based estimate and the resulting test-statistics may be wildly inflated."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using ddfm=kr2 works much better. Try both and see. (In GLIMMIX, empirical=mbn works well, too, but not the classic empirical.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to specify the existence of 48 subjects rather than 24, which you can do by specifying &lt;FONT face="courier new,courier"&gt;subject=subjectid(group)&lt;/FONT&gt; rather than &lt;FONT face="courier new,courier"&gt;subject=subjectid&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the response &lt;EM&gt;mean&lt;/EM&gt; could&amp;nbsp;theoretically change with levels of Trial1, then Trial1 needs to be included as a fixed effect in the MODEL statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is what I would consider as a first pass, not necessarily final:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*  Import data from CSV */
PROC IMPORT OUT= WORK.dissertation 
            DATAFILE= "Dissertation.csv" 
            DBMS=CSV REPLACE;
     GETNAMES=YES;
     DATAROW=2; 
RUN;
/*  Delete unfilled columns and unfilled rows */
data dissertation;
    set dissertation;
    drop var20-var56;
    where whole_1st= 1;
    run;

/*   Variable transformation */
data dissertation;
    set dissertation;
    gmp_syl_log = log(gmp_syl);
    gmp_syl_sqrt = sqrt(gmp_syl);
    run;

title1 "Coding check";
proc freq data=dissertation;
    table group subjectid slc block trial1;
    run;

title1 "Pattern of observations";
proc tabulate data=dissertation(where=(gmp_syl ne .));
    class group subjectid slc trial1 block;
    table group*subjectid, slc*trial1 / misstext="X";
    run;

proc sort data=dissertation;
    by group subjectid slc trial1;
    run;
title1 "Observed data";
proc sgpanel data=dissertation noautolegend;
    panelby slc group / columns=2;
    series x=trial1 y=gmp_syl / group=subjectid markers;
    run;
title1 "Observed data, log scale";
proc sgpanel data=dissertation noautolegend;
    panelby slc group / columns=2;
    series x=trial1 y=gmp_syl_log / group=subjectid markers;
    run;
proc sgpanel data=dissertation;
    panelby group subjectid / columns=6;
    series x=trial1 y=gmp_syl_log / group=slc markers;
    run;

title1 "AR(1) among TRIAL1 levels using MIXED";
proc mixed data=dissertation covtest ;*plots=all;
    class group subjectid slc trial1;
    model gmp_syl_log = group|slc|trial1 / ddfm=kr2;
    random intercept / subject=subjectid(group);
    repeated trial1 / subject=slc*subjectid(group) type=ar(1);
    lsmeans trial1 / diff adjust=simulate(seed=98375);
    lsmeans group*slc ;
    run;

title1 "AR(1) among TRIAL1 levels using GLIMMIX";
proc glimmix data=dissertation plots=(studentpanel boxplot(fixed student));
    class group subjectid slc trial1;
    model gmp_syl_log = group|slc|trial1 / ddfm=kr2;
    random intercept / subject=subjectid(group);
    random trial1 / subject=slc*subjectid(group) type=ar(1) residual;
    lsmeans trial1 / diff adjust=simulate(seed=98375) lines;
    lsmeans group*slc / plot=meanplot(sliceby=group join cl);
    lsmestimate group*slc "Group effect: SLC 1 v 2" 1 -1 0 -1 1 0,
                          "Group effect: SLC 1 v 3" 1 0 -1 -1 0 1,
                          "Group effect: SLC 2 v 3" 0 1 -1  0-1 1
        / adjust=simulate(seed=29847);
    run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This model&amp;nbsp;has three hierarchical design levels: Subject (assigned randomly to Group), Session within Subject (assigned--not randomly--to SLC), and RepeatedMeasure nested within Session within Subject (assigned--not randomly--to Trial1).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;gmp_syl is strongly skewed, but also appears to have an upper bound that plays a bit of havoc with the distribution. I do not know how this variable was obtained, but this upper bound is something to consider.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;On the log-transformed scale, there is no substantial evidence of heteroscedasticity.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;AR(1) was “best” relative to CS, ARH(1), AR(1)+RE, AR(1) by SLC, TOEP based on AICc.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I show code for both MIXED and GLIMMIX (which has some nice features that are not available in MIXED).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Feel free to ask questions after you have studied the syntax, consulted the documentation and the Littell et al. text, and such.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have fun!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Feb 2018 23:48:50 GMT</pubDate>
    <dc:creator>sld</dc:creator>
    <dc:date>2018-02-05T23:48:50Z</dc:date>
    <item>
      <title>error when running repeat statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/433938#M22838</link>
      <description>&lt;P&gt;Hi. Following is the code I used and I got an error message when I activate "repeated" statement.&lt;/P&gt;&lt;P&gt;If I mute it, it runs well. Could you please tell me what is the cause for the error? Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc mixed data=a1.dissert2 empirical covtest ic;&lt;BR /&gt;class SLC Group SubjectID Trial1;&lt;BR /&gt;model GMP_syl=Trial1 SLC Group SLC*Group/solution residual;&lt;BR /&gt;random intercept/subject=SubjectID type=ARH(1);&lt;BR /&gt;/*repeated Trial1/subject=SubjectID type=ARH(1);*/&lt;BR /&gt;lsmeans SLC /diff slice=SLC;&lt;BR /&gt;contrast 'SLC1 vs SLC2' SLC 1 -1 0;&lt;BR /&gt;contrast 'SLC1 vs SLC3' SLC 1 0 -1;&lt;BR /&gt;contrast 'SLC2 vs SLC3' SLC 0 1 -1;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Feb 2018 12:53:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/433938#M22838</guid>
      <dc:creator>nlpurumi</dc:creator>
      <dc:date>2018-02-04T12:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: error when running repeat statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/433998#M22848</link>
      <description>&lt;P&gt;We don't have much to go on here. If you provide either your dataset or an example dataset that produces the same problem , plus a description of your experimental design, then we might be able to help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please provide your dataset in a format that is not Excel, or see&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_self"&gt;How to create a data step version of your data&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You don't need to specify type=arh(1) for the first random statement. Subjects are independent, and only one variance will be estimated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I was guessing about why the model failed, then I would suspect that you don't have enough data to support estimate of the ARH(1) structure, which attempts to estimate a variance for each level of TRIAL1. If the rest of your code is correct, try simpler TYPEs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Feb 2018 19:44:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/433998#M22848</guid>
      <dc:creator>sld</dc:creator>
      <dc:date>2018-02-04T19:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: error when running repeat statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/434004#M22852</link>
      <description>&lt;P&gt;Hi. Thanks for your advice.&lt;/P&gt;&lt;P&gt;I changed my code to this and there was no error message, but still the result did not print. Could you please advise me one more time?&lt;/P&gt;&lt;P&gt;Also, I don't know how to upload the SAS datset, this webpage seems not uploading the file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc mixed data=a1.dissertation2 empirical covtest ic;&lt;BR /&gt;class SLC Group SubjectID Trial1;&lt;BR /&gt;model GMP_syl=SLC Group SLC*Group/solution residual;&lt;BR /&gt;random intercept/subject=SubjectID;&lt;BR /&gt;repeated Trial1/subject=SubjectID type=ARH(1);&lt;BR /&gt;lsmeans SLC /diff slice=SLC;&lt;BR /&gt;contrast 'SLC1 vs SLC2' SLC 1 -1 0;&lt;BR /&gt;contrast 'SLC1 vs SLC3' SLC 1 0 -1;&lt;BR /&gt;contrast 'SLC2 vs SLC3' SLC 0 1 -1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS Output&lt;/P&gt;&lt;DIV class="branch"&gt;&lt;TABLE border="0" cellspacing="1" cellpadding="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;The SAS System&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;DIV class="c proctitle"&gt;The Mixed Procedure&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;Model InformationData SetDependent VariableCovariance StructuresSubject EffectsEstimation MethodResidual Variance MethodFixed Effects SE MethodDegrees of Freedom Method &lt;TABLE cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;A1.DISSERTATION2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;GMP_Syl&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Variance Components, Heterogeneous Autoregressive&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;SubjectID, SubjectID&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;REML&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;None&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Empirical&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Containment&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;Class Level InformationClass Levels ValuesSLCGroupSubjectIDTrial1 &lt;TABLE cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;1 2 3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;1 2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;24&lt;/TD&gt;&lt;TD&gt;1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;1 2 3 4 5 6 7 8 9 10&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;DimensionsCovariance ParametersColumns in XColumns in Z per SubjectSubjectsMax Obs per Subject &lt;TABLE cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;24&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;60&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;Number of ObservationsNumber of Observations ReadNumber of Observations UsedNumber of Observations Not Used &lt;TABLE cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;1440&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1317&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;123&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 04 Feb 2018 20:16:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/434004#M22852</guid>
      <dc:creator>nlpurumi</dc:creator>
      <dc:date>2018-02-04T20:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: error when running repeat statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/434010#M22853</link>
      <description>&lt;P&gt;It looks like your data set has not been imported correctly. Note that in the "Class level information" table, the variable names (in the first column of the table) are "3", "2", "24", and "10", rather than "SLC", "Group", "SubjectID", and "Trial1". You'll need to fix that first.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Be sure to check the log for NOTEs, WARNINGs, and ERRORs. With this sort of import problem, surely some message about your attempt to run code would show up in the log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The link I included to the dataset upload process works for me. You should be able to just click on it, if you have access through your internet provider. If it continues to not work for you, then you can attach your dataset as a text file. If you still have trouble with import, then you'll need to include that code as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Feb 2018 21:13:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/434010#M22853</guid>
      <dc:creator>sld</dc:creator>
      <dc:date>2018-02-04T21:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: error when running repeat statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/434012#M22854</link>
      <description>&lt;P&gt;It did actually import pretty well. I could not copy paste the exact screen I saw in SAS.&lt;/P&gt;&lt;P&gt;Here I am attaching the screen shot again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know if you still think the data was not imported correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Empirical statement.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/18315i98FC90BF6341483A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Empirical statement.png" alt="Empirical statement.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Feb 2018 21:17:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/434012#M22854</guid>
      <dc:creator>nlpurumi</dc:creator>
      <dc:date>2018-02-04T21:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: error when running repeat statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/434014#M22856</link>
      <description>&lt;P&gt;Yes, you're right, it does look fine. Pasting the output into the message does not format well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are &lt;EM&gt;still&lt;/EM&gt; using TYPE=ARH(1) in the REPEATED statement. Try something simpler. ARH(1) estimates a variance for each level of Trial1 (of which there are 10), and you do not have enough subjects (n=24) to estimate all the parameters specified by the model.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: Or it is still possible that your model is not specified correctly. For example, I suspect that you have 24 x 3 x 2 = 1440 subjects, but the syntax you are using, given the way you have coded the variable levels, tells the procedure that you have only 24. But you have not described the experimental design, so I am just guessing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Feb 2018 21:52:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/434014#M22856</guid>
      <dc:creator>sld</dc:creator>
      <dc:date>2018-02-04T21:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: error when running repeat statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/434017#M22857</link>
      <description>&lt;P&gt;Thanks for your advice. I have 24 subjects in each group and there are two groups. So there are 48 participants altogether.&lt;/P&gt;&lt;P&gt;The SLC has three levels of experimental conditions each participant participated. Each participants attempt each task ten times in each SLC condition. These ten trials were indicated by the variable name "Trial1".&lt;/P&gt;&lt;P&gt;I had to go with ARH (1) because homoscedasticity assumption did not meet.&lt;/P&gt;&lt;P&gt;Does this explanation help you help me better?&lt;/P&gt;&lt;P&gt;Also, I wonder if I can email you my dataset and my codes from importing dataset to testing assumptions.&lt;/P&gt;&lt;P&gt;Thanks in advance for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Feb 2018 22:49:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/434017#M22857</guid>
      <dc:creator>nlpurumi</dc:creator>
      <dc:date>2018-02-04T22:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: error when running repeat statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/434020#M22860</link>
      <description>&lt;P&gt;Thank you for the additional information.&amp;nbsp;Were the SLC levels applied in the same order to each participant?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First try attaching the data as a csv file, in case anyone else wants to participate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For mixed models in SAS,&amp;nbsp;&lt;A href="https://www.sas.com/store/books/categories/usage-and-reference/sas-for-mixed-models-second-edition/prodBK_59882_en.html" target="_self" rel="nofollow noopener noreferrer"&gt;SAS for Mixed Models, 2nd ed&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is an invaluable resource; an updated version&amp;nbsp;(&amp;nbsp;&lt;A href="https://support.sas.com/en/books/authors/walter-stroup.html" target="_self"&gt;SAS® for Mixed Models: An Introduction&lt;/A&gt;)&amp;nbsp;is supposed to be released soon. If you run mixed models, you will benefit from reading it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Feb 2018 23:50:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/434020#M22860</guid>
      <dc:creator>sld</dc:creator>
      <dc:date>2018-02-04T23:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: error when running repeat statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/434151#M22868</link>
      <description>&lt;P&gt;Thanks for your information. I am reading the book, but if anyone can help me that will be great, too!&lt;/P&gt;&lt;P&gt;Somehow my reply yesterday was not saved so I am writing again.&lt;/P&gt;&lt;P&gt;Yes, although the order of stimuli presentation was randomized, the order was pre-determined and every participant underwent the same tasks in the same order.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, I am attaching my data file with the codes.&lt;/P&gt;&lt;P&gt;The additional question I have is whether I need to stick to proc mixed with empirical statement because proc glimmix does not provide complicated covariance structure when homoscedasticity assumption does not meet. Thanks for your further advice in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;libname a1 'C:\Data Analysis\Experimental Results\SAS';&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc import datafile="C:\Data Analysis\Experimental Results\SAS\dissertation.csv"&lt;/P&gt;&lt;P&gt;out=a1.Dissertation&lt;/P&gt;&lt;P&gt;dbms=csv&lt;/P&gt;&lt;P&gt;replace;&lt;/P&gt;&lt;P&gt;run;&lt;BR /&gt;data a1.dissertation1;&lt;BR /&gt;set a1.dissertation;&lt;BR /&gt;where Whole_1st=1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc mixed data=a1.dissertation1 ic;&lt;BR /&gt;class SubjectID SLC Group Trial1;&lt;BR /&gt;model GMP_syl= Trial1/solution;&lt;BR /&gt;random intercept Trial1/sub=SubjectID;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sort data=a1.dissertation1 out=a1.dissertation2;&lt;BR /&gt;by SLC Group;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc mixed data=a1.dissertation2 ic;&lt;BR /&gt;class SubjectID SLC Group Trial1;&lt;BR /&gt;model GMP_syl= Trial1 /solution outp=R;&lt;BR /&gt;random intercept Trial1/sub=SubjectID;&lt;BR /&gt;run;&lt;BR /&gt;data R1; set R;&lt;BR /&gt;absr=ABS(RESID);&lt;BR /&gt;run;&lt;BR /&gt;proc glm data=R1;&lt;BR /&gt;class SLC Group;&lt;BR /&gt;model ABSR=;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc mixed data=a1.dissertation2 covtest method=ml ;&lt;BR /&gt;class SLC Group SubjectID Trial1;&lt;BR /&gt;model GMP_syl=SLC Group SLC*Group/solution outp=R;&lt;BR /&gt;random intercept Trial1/subject=SubjectID type=ARH(1);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc mixed data=a1.dissertation2 covtest method=ml ;&lt;BR /&gt;class SLC Group SubjectID Trial1;&lt;BR /&gt;model GMP_syl=SLC Group SLC*Group/solution outp=R;&lt;BR /&gt;random intercept Trial1/subject=SubjectID type=CSH;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ods graphics on;&lt;/P&gt;&lt;P&gt;proc univariate data=R normal;&lt;BR /&gt;BY SLC Group;&lt;BR /&gt;var Resid;&lt;BR /&gt;histogram / normal&lt;BR /&gt;ctext = blue;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc mixed data=a1.dissertation2 empirical covtest ic;&lt;BR /&gt;class SLC Group SubjectID Trial1;&lt;BR /&gt;model GMP_syl=SLC Group SLC*Group/solution ddfm=bw outp=R;&lt;BR /&gt;random intercept Trial1/type=ARH(1) subject=SubjectID g;&lt;BR /&gt;run;&lt;BR /&gt;proc mixed data=a1.dissertation2 empirical covtest ic;&lt;BR /&gt;class SLC Group SubjectID Trial1;&lt;BR /&gt;model GMP_syl=SLC Group SLC*Group/solution residual;&lt;BR /&gt;random intercept/subject=SubjectID solution;&lt;BR /&gt;repeated Trial1/subject=SubjectID type=ARH(1);&lt;BR /&gt;lsmeans SLC /diff slice=SLC;&lt;BR /&gt;contrast 'SLC1 vs SLC2' SLC 1 -1 0;&lt;BR /&gt;contrast 'SLC1 vs SLC3' SLC 1 0 -1;&lt;BR /&gt;contrast 'SLC2 vs SLC3' SLC 0 1 -1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc glimmix data=a1.dissertation2;&lt;BR /&gt;class SLC Group SubjectID Trial1;&lt;BR /&gt;model GMP_syl=SLC Group SLC*Group/dist=gamma;&lt;BR /&gt;random intercept /subject=SubjectID;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 02:08:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/434151#M22868</guid>
      <dc:creator>nlpurumi</dc:creator>
      <dc:date>2018-02-14T02:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: error when running repeat statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/434422#M22900</link>
      <description>&lt;P&gt;The Littell et al. text is not a one-day project &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp; I'm looking forward to the next version.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, I saw your message and then when I looked again, it was gone. Odd.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;GLIMMIX offers all the same covariance structures as does MIXED, except for the Kronecker products. And GLIMMIX has a few more than MIXED. GLIMMIX also provides the option of sandwich estimators ("empirical"), including modifications that perform better with small samples that are not available in MIXED. In my opinion, with few exceptions, GLIMMIX is a better tool than MIXED; I rarely use MIXED anymore.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The empirical options does not work at all well for analysis of this data set. According to&amp;nbsp;&lt;A href="http://newprairiepress.org/cgi/viewcontent.cgi?article=1259&amp;amp;context=agstatconference" target="_self"&gt;an old paper by Walt Stroup&lt;/A&gt;&amp;nbsp;(and other sources):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"This approach assumes that the number of subjects per treatment is substantially greater than the number of times of observation. When the number of observation times is equal to or greater than the number of subjects per treatment, as often happens in agricultural experiments, the empirical estimate of Var(K'b) may actually be less than the model-based estimate and the resulting test-statistics may be wildly inflated."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using ddfm=kr2 works much better. Try both and see. (In GLIMMIX, empirical=mbn works well, too, but not the classic empirical.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to specify the existence of 48 subjects rather than 24, which you can do by specifying &lt;FONT face="courier new,courier"&gt;subject=subjectid(group)&lt;/FONT&gt; rather than &lt;FONT face="courier new,courier"&gt;subject=subjectid&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the response &lt;EM&gt;mean&lt;/EM&gt; could&amp;nbsp;theoretically change with levels of Trial1, then Trial1 needs to be included as a fixed effect in the MODEL statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is what I would consider as a first pass, not necessarily final:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*  Import data from CSV */
PROC IMPORT OUT= WORK.dissertation 
            DATAFILE= "Dissertation.csv" 
            DBMS=CSV REPLACE;
     GETNAMES=YES;
     DATAROW=2; 
RUN;
/*  Delete unfilled columns and unfilled rows */
data dissertation;
    set dissertation;
    drop var20-var56;
    where whole_1st= 1;
    run;

/*   Variable transformation */
data dissertation;
    set dissertation;
    gmp_syl_log = log(gmp_syl);
    gmp_syl_sqrt = sqrt(gmp_syl);
    run;

title1 "Coding check";
proc freq data=dissertation;
    table group subjectid slc block trial1;
    run;

title1 "Pattern of observations";
proc tabulate data=dissertation(where=(gmp_syl ne .));
    class group subjectid slc trial1 block;
    table group*subjectid, slc*trial1 / misstext="X";
    run;

proc sort data=dissertation;
    by group subjectid slc trial1;
    run;
title1 "Observed data";
proc sgpanel data=dissertation noautolegend;
    panelby slc group / columns=2;
    series x=trial1 y=gmp_syl / group=subjectid markers;
    run;
title1 "Observed data, log scale";
proc sgpanel data=dissertation noautolegend;
    panelby slc group / columns=2;
    series x=trial1 y=gmp_syl_log / group=subjectid markers;
    run;
proc sgpanel data=dissertation;
    panelby group subjectid / columns=6;
    series x=trial1 y=gmp_syl_log / group=slc markers;
    run;

title1 "AR(1) among TRIAL1 levels using MIXED";
proc mixed data=dissertation covtest ;*plots=all;
    class group subjectid slc trial1;
    model gmp_syl_log = group|slc|trial1 / ddfm=kr2;
    random intercept / subject=subjectid(group);
    repeated trial1 / subject=slc*subjectid(group) type=ar(1);
    lsmeans trial1 / diff adjust=simulate(seed=98375);
    lsmeans group*slc ;
    run;

title1 "AR(1) among TRIAL1 levels using GLIMMIX";
proc glimmix data=dissertation plots=(studentpanel boxplot(fixed student));
    class group subjectid slc trial1;
    model gmp_syl_log = group|slc|trial1 / ddfm=kr2;
    random intercept / subject=subjectid(group);
    random trial1 / subject=slc*subjectid(group) type=ar(1) residual;
    lsmeans trial1 / diff adjust=simulate(seed=98375) lines;
    lsmeans group*slc / plot=meanplot(sliceby=group join cl);
    lsmestimate group*slc "Group effect: SLC 1 v 2" 1 -1 0 -1 1 0,
                          "Group effect: SLC 1 v 3" 1 0 -1 -1 0 1,
                          "Group effect: SLC 2 v 3" 0 1 -1  0-1 1
        / adjust=simulate(seed=29847);
    run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This model&amp;nbsp;has three hierarchical design levels: Subject (assigned randomly to Group), Session within Subject (assigned--not randomly--to SLC), and RepeatedMeasure nested within Session within Subject (assigned--not randomly--to Trial1).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;gmp_syl is strongly skewed, but also appears to have an upper bound that plays a bit of havoc with the distribution. I do not know how this variable was obtained, but this upper bound is something to consider.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;On the log-transformed scale, there is no substantial evidence of heteroscedasticity.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;AR(1) was “best” relative to CS, ARH(1), AR(1)+RE, AR(1) by SLC, TOEP based on AICc.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I show code for both MIXED and GLIMMIX (which has some nice features that are not available in MIXED).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Feel free to ask questions after you have studied the syntax, consulted the documentation and the Littell et al. text, and such.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have fun!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2018 23:48:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/434422#M22900</guid>
      <dc:creator>sld</dc:creator>
      <dc:date>2018-02-05T23:48:50Z</dc:date>
    </item>
    <item>
      <title>Re: error when running repeat statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/434432#M22901</link>
      <description>&lt;P&gt;&lt;A href="https://faculty.washington.edu/heagerty/Courses/VA-longitudinal/private/Littell-StatMed2000.pdf" target="_self"&gt;This paper&lt;/A&gt; is a good resource for different covariance structures.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 00:51:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/434432#M22901</guid>
      <dc:creator>sld</dc:creator>
      <dc:date>2018-02-06T00:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: error when running repeat statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/434458#M22903</link>
      <description>&lt;P&gt;Thanks a lot for your help. I am surprised by the level of help I can get from this SAS community. Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a few questions regarding the codes you provided.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. I understood that you chose AR(1) after transforming the data by log. However, I don't see any code to test normality/homoscedasticity assumption except you included codes to observe the distribution of the data. I wonder how you test (or code) it. Or do you think I can use the same codes I used&amp;nbsp;to test these two assumptions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. I see many places where it says "98375." Where is this number coming from?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. In the second to the last commands where it starts with "proc mixed" I wonder if I can include "group*slc" next to your code in the model statement to check interaction effect. Or is the vertical line that divides independent variables already include meaning of any possible interactions among these variables?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4. In this proc mixed command, I do not see the empirical statement.&lt;/P&gt;&lt;P&gt;As far as I know, if errors in your data is not normally distributed, you have to use "empirical" statement to accommodate it.&lt;/P&gt;&lt;P&gt;Do I not need it because it is normally distributed after the log tranformation??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After writing above question, I read your explanation about why my data does not meet the requirement for empirical statement.&lt;/P&gt;&lt;P&gt;You cited that&amp;nbsp;"this approach assumes that the number of subjects per treatment is substantially greater than the number of times of observation. When the number of observation times is equal to or greater than the number of subjects per treatment, as often happens in agricultural experiments, the empirical estimate of Var(K'b) may actually be less than the model-based estimate and the resulting test-statistics may be wildly inflated."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, now I am curious isn't my data number of subject (24 for each group) exceeds the number of observation (10 for each condition)? Or is the degree too small?&lt;/P&gt;&lt;P&gt;Or is this citation talking about the size of number of subject (48 altogether) and the number of observation at the whole study level (30*48=1440)?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you mentioned to use "ddfm=kr2", does it mean to replace empirical statement in proc mixed?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you said, "you need to specify the existence of 48 subjects rather than 24, which you can do by specifying&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="courier new,courier"&gt;subject=subjectid(group)&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;rather than&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="courier new,courier"&gt;subject=subjectid.", do you mean when I try to replace "empirical statement" to "ddfm=kr2"?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the response&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;mean&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;could&amp;nbsp;theoretically change with levels of Trial1, then Trial1 needs to be included as a fixed effect in the MODEL statement.&amp;nbsp; &amp;nbsp;--&amp;gt; Thanks for your advice! I see that you included them after model in both proc mixed and proc glimmix.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;5. I see that glimmix provides really neat results. When I try to justify the reason for going with glimmix, I wonder if I can describe my study following the flow chart of CH1 in Littell, et al. (2006). How do you view my design?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Response:&lt;/P&gt;&lt;P&gt;Non-normal&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Errors: Correlated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Random Effects:&lt;/P&gt;&lt;P&gt;Yes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Non-linearity:&lt;/P&gt;&lt;P&gt;None&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tool in SAS/STAT:&lt;/P&gt;&lt;P&gt;Glimmix&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;6. Regarding the levels of the design: I view a little differently from yours, and I wonder if it will change any of the SAS codes.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Subject (was not assigned randomly to Group, native English vs. native Mandarin speakers), Session within Subject (assigned--not randomly--to SLC), and RepeatedMeasure nested within Session within Subject (assigned--not randomly--to Trial1).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please help me to answer above questions further?&lt;/P&gt;&lt;P&gt;Thanks so much again!&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 15:26:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/434458#M22903</guid>
      <dc:creator>nlpurumi</dc:creator>
      <dc:date>2018-02-06T15:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: error when running repeat statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/434600#M22910</link>
      <description>&lt;P&gt;I'm glad you've found it useful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(1) I rarely use formal tests to assess normality and homogeneity of variance, relying instead on graphical assessments of residuals (and lots of analysis experience). Many (even most?) of my applied stat colleagues take the same approach.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(2) I made it up. It is the seed for a random number generator used in the simulate method. Read the documentation for the LSMEANS statement in MIXED (or GLIMMIX) and GLM.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(3) If you run the code, you'll see that interaction in the results. " | " is an expansion operator. Read&amp;nbsp;&lt;A href="https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_glm_sect027.htm" target="_self"&gt;Specification of Effects&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(4) No, the empirical estimate has nothing to do with whether the data follow a normal distribution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The empirical estimate and the Kenward-Rogers method are two different approaches to reducing the bias of standard errors. Read the Stroup paper I linked to in a previous message. You use one or the other; you cannot use both at the same time.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your sample size is too small for the classic empirical estimate to work. I've seen references stating that you need 2 orders of magnitude more observations than times.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No, specification of subject=&amp;lt;&amp;gt; has nothing to do with empirical or KR. It has everything to do with correctly specifying your experimental design. You have 48 subjects, but you have coded them 1, ..., 24 within each of two groups. If you use "subject=subjectid" then you have told the procedure that you have &lt;EM&gt;only 24 subjects&lt;/EM&gt; which is not correct. To fix that, you could either recode subjectid to have 48 unique values, or you can use "subject=subjectid(group)"; the latter approach works better with the estimation of denominator degrees of freedom and is algorithmically more efficient. Keep reading Littell et al.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(5) Using GLIMMIX requires no more justification than using MIXED. GLIMMIX is capable of accommodating data with distributions other than normal, but it does normal as well and generally duplicates exactly what you would get for the same model using MIXED.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(6) Ideally levels of an experimental factor are randomly assigned to experimental units, but in practice that often is impossible (for example, gender or time or your "group"). Typically we don't fret about that (we "pretend" that we have random assignment), but it is important to keep in mind that random assignment minimizes bias, and that lack of random assignment may induce bias that needs to be considered in interpretation of results. I do not see that the model needs to be adjusted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The statistical model required for the analysis of this study is fairly complicated, and certainly more complicated than you were and are prepared for. Keep reading! Then read more! Take a class, either in person or online (e.g., &lt;A href="https://onlinecourses.science.psu.edu/stat502/" target="_self"&gt;https://onlinecourses.science.psu.edu/stat502/&lt;/A&gt;). And if you are at a university, see whether you can find a statistician to consult with. It's a lot easier across a table than across the internet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 17:10:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/434600#M22910</guid>
      <dc:creator>sld</dc:creator>
      <dc:date>2018-02-06T17:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: error when running repeat statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/434612#M22912</link>
      <description>&lt;P&gt;Thank you! Yes, I will continue to study about SAS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 17:33:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/434612#M22912</guid>
      <dc:creator>nlpurumi</dc:creator>
      <dc:date>2018-02-06T17:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: error when running repeat statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/434761#M22925</link>
      <description>&lt;P&gt;Could you please explain me what this one line means? There is not enough explanation in the proc mixed manual except that it says, "ADJUST=SIMULATE&amp;lt; (sim-options) &amp;gt;".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;lsmeans trial1 / diff adjust=simulate(seed=98375);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2018 15:56:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/434761#M22925</guid>
      <dc:creator>nlpurumi</dc:creator>
      <dc:date>2018-02-07T15:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: error when running repeat statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/435061#M22942</link>
      <description>&lt;P&gt;I still wanted to test the normality and homoscedasticity assumptions with codes and I faced an error message like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For normality assumption testing, the code I used is this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc mixed data=dissertation1 covtest method=ml;*plots=all;&lt;BR /&gt;class group subjectid slc trial1;&lt;BR /&gt;model gmp_syl_log = group|slc|trial1/ ddfm=kr2 outp=R;&lt;BR /&gt;random intercept / subject=subjectid(group);&lt;BR /&gt;repeated trial1 / subject=slc*subjectid(group) type=sp(pow)(trial1);&lt;BR /&gt;/*lsmeans trial1 / diff adjust=simulate(seed=98375);&lt;BR /&gt;lsmeans group*slc ;*/&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;ods graphics on;&lt;BR /&gt;proc univariate data=R normal;&lt;BR /&gt;BY group slc;&lt;BR /&gt;var Resid;&lt;BR /&gt;histogram / normal&lt;BR /&gt;ctext = blue;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error I received is this:&lt;/P&gt;&lt;P&gt;ERROR: Data set WORK.R is not sorted in ascending sequence. The current BY group has SLC = 3 and&lt;BR /&gt;the next BY group has SLC = 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please help me one more time?&lt;/P&gt;&lt;P&gt;In addition, I changed the covariance structure to sp(pow)(trial1) because the trials had unequally spaced time intervals. There were different numbers of fillers.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Linda&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2018 20:55:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/435061#M22942</guid>
      <dc:creator>nlpurumi</dc:creator>
      <dc:date>2018-02-07T20:55:32Z</dc:date>
    </item>
    <item>
      <title>Re: error when running repeat statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/435135#M22950</link>
      <description>&lt;P&gt;The GLIMMIX documentation (for 14.3 anyway) has more detail. Read&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_glimmix_syntax13.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en#statug.glimmix.gmxlsmadjust" target="_self"&gt;GLIMMIX | LSMEANS | ADJUST=&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;then ask again if you still can't make sense of it.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 00:39:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/435135#M22950</guid>
      <dc:creator>sld</dc:creator>
      <dc:date>2018-02-08T00:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: error when running repeat statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/435136#M22951</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;The error I received is this:&lt;/P&gt;
&lt;P&gt;ERROR: Data set WORK.R is not sorted in ascending sequence. The current BY group has SLC = 3 and&lt;BR /&gt;the next BY group has SLC = 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The ERROR tells you what you need to know: when you use a BY statement, the data set must be sorted in advance in the same order specified by the BY statement. Try sorting the dataset R and see if that works.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;In addition, I changed the covariance structure to sp(pow)(trial1) because the trials had unequally spaced time intervals. There were different numbers of fillers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The variable for distance in SP(POW)(&lt;EM&gt;c-list&lt;/EM&gt;) must be numeric and it must reflect the actual "distance" represented by each level of TRIAL1. Read&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_mixed_syntax14.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en#statug.mixed.repeatedstmt_type" target="_self"&gt;MIXED | REPEATED | TYPE=&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using SP(POW)(TRIAL1) will not work because (1) TRIAL1 is in the CLASS statement and so is not numeric, and (2) the levels of TRIAL1 (1,2,3,...,10) do not reflect the different numbers of "fillers".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 00:49:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/435136#M22951</guid>
      <dc:creator>sld</dc:creator>
      <dc:date>2018-02-08T00:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: error when running repeat statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/435150#M22952</link>
      <description>&lt;P&gt;Thanks for your advice. After changing the order of variables and sort the R dataset, the normality test ran well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regarding the covariance structure, there is not specific interval and the time intervals among trials vary and depend on each individual. This is because each individual had the capability to move on to the next trial when they completed responding to the current task in each trial.&lt;/P&gt;&lt;P&gt;In this type of unequally time spaced dataset, do you have any recommendation in terms of what code should be used to specify covariance structure? Can I just use "UN" instead of "AR(1), ARH(1) for heteroscedastic data, or SP(pow) (c-list)"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or can I use VC because following&amp;nbsp;description about VC (&lt;A href="http://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_mixed_syntax14.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en#statug.mixed.repeatedstmt_type" target="_blank"&gt;http://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_mixed_syntax14.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en#statug.mixed.repeatedstmt_type&lt;/A&gt;) says that&amp;nbsp;&lt;SPAN class=" aa-term "&gt;&lt;SPAN class=" aa-keyword"&gt;VC&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;specifies&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;standard variance components and is the default structure for both the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_mixed_syntax13.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en" rel="nofollow"&gt;RANDOM&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and REPEATED statements. In the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_mixed_syntax13.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en" rel="nofollow"&gt;RANDOM&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;statement, a distinct variance component is assigned to each effect. In the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_mixed_syntax14.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en" rel="nofollow"&gt;REPEATED&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;statement, this structure is usually used only with the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_mixed_syntax14.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en#statug.mixed.repeatedstmt_group" rel="nofollow"&gt;GROUP=&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;option to specify a heterogeneous variance model.&lt;/P&gt;&lt;P&gt;I like the fact that VC with "Group=" option handles heterogeneous variance model, which is the case in my result.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SP(pow) (c-list) was something I found in &lt;SPAN&gt;&amp;nbsp;Littell et al.'s&lt;/SPAN&gt;(2006) book.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I ask one more question,&amp;nbsp;I want to report the F statistics in my document.&lt;/P&gt;&lt;P&gt;I wonder if I can assume the second degrees of freedom I need to report is written under the heading of Den DF in the second column of the SAS output.&lt;/P&gt;&lt;P&gt;So if I write, "a significant group by SLC interaction (&lt;EM&gt;F(2,&lt;U&gt;359&lt;/U&gt;)=18.14, p&amp;lt;.0001&lt;/EM&gt;), the main effect of group (&lt;EM&gt;F(1,&lt;U&gt;46.2&lt;/U&gt;)=48.96, p&amp;lt;.0001&lt;/EM&gt;), and the main effect of SLC (&lt;EM&gt;F(2,&lt;U&gt;359&lt;/U&gt;)=148.47, p&amp;lt;.0001&lt;/EM&gt;) were observed." will this be a correct statement?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ex) SAS Output:&lt;/P&gt;&lt;DIV class="branch"&gt;&lt;DIV align="center"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gmp_syl.png" style="width: 442px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/18394i6A91D22D5DE5DDBB/image-size/large?v=v2&amp;amp;px=999" role="button" title="gmp_syl.png" alt="gmp_syl.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 08 Feb 2018 02:45:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/435150#M22952</guid>
      <dc:creator>nlpurumi</dc:creator>
      <dc:date>2018-02-08T02:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: error when running repeat statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/435158#M22953</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;Regarding the covariance structure, there is not specific interval and the time intervals among trials vary and depend on each individual. This is because each individual had the capability to move on to the next trial when they completed responding to the current task in each trial.&lt;/P&gt;
&lt;P&gt;In this type of unequally time spaced dataset, do you have any recommendation in terms of what code should be used to specify covariance structure? Can I just use "UN" instead of "AR(1), ARH(1) for heteroscedastic data, or SP(pow) (c-list)"?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="branch"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd say that you need to rethink what TRIAL1 represents. To this point, I have been thinking of it as a repeated measurement through time in response to a consistent treatment. But apparently each level of TRIAL1 represents a level of another factor ("task"), complicated by the fact that the response of a subject to the different tasks may be autocorrelated and that the degree of autocorrelation may vary by subject. The complexity of this study has now exceeded what we can resolve in this forum. You will want to find a statistical consultant at your institution; this problem needs a lot of discussion, and the context of the study is important and needs to be considered.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;If I ask one more question,&amp;nbsp;I want to report the F statistics in my document.&lt;/P&gt;
&lt;P&gt;I wonder if I can assume the second degrees of freedom I need to report is written under the heading of Den DF in the second column of the SAS output.&lt;/P&gt;
&lt;P&gt;So if I write, "a significant group by SLC interaction (&lt;EM&gt;F(2,&lt;U&gt;359&lt;/U&gt;)=18.14, p&amp;lt;.0001&lt;/EM&gt;), the main effect of group (&lt;EM&gt;F(1,&lt;U&gt;46.2&lt;/U&gt;)=48.96, p&amp;lt;.0001&lt;/EM&gt;), and the main effect of SLC (&lt;EM&gt;F(2,&lt;U&gt;359&lt;/U&gt;)=148.47, p&amp;lt;.0001&lt;/EM&gt;) were observed." will this be a correct statement?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="branch"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, the format for the F statistic is F(numerator df, denominator df).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 03:31:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/error-when-running-repeat-statement/m-p/435158#M22953</guid>
      <dc:creator>sld</dc:creator>
      <dc:date>2018-02-08T03:31:53Z</dc:date>
    </item>
  </channel>
</rss>

