<?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: Statement is not valid or it is used out of proper order for Proc GLIMMIX in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-it-is-used-out-of-proper-order-for/m-p/979171#M378758</link>
    <description>&lt;P&gt;If your Y variable is 0 1 ,the right syntax is&lt;/P&gt;
&lt;PRE&gt;model infection(ref='0')=group /s dist=&lt;STRONG&gt;binary&lt;/STRONG&gt; link=logit;&lt;/PRE&gt;
&lt;P&gt;If your Y is a count number of infection=0 ,the right syntax is&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;model count/n=group /s dist=&lt;STRONG&gt;binomial&lt;/STRONG&gt; link=logit;&lt;/PRE&gt;</description>
    <pubDate>Thu, 20 Nov 2025 08:29:59 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2025-11-20T08:29:59Z</dc:date>
    <item>
      <title>Statement is not valid or it is used out of proper order for Proc GLIMMIX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-it-is-used-out-of-proper-order-for/m-p/979160#M378751</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;!--  StartFragment   --&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;I am running the following code on a dataset; however, I am getting this error message: ERROR 180&lt;/SPAN&gt;&lt;SPAN class=""&gt;-&lt;/SPAN&gt;&lt;SPAN class=""&gt;322&lt;/SPAN&gt;&lt;SPAN class=""&gt;: &lt;/SPAN&gt;&lt;SPAN class=""&gt;Statement is not valid or is used out of proper order. I would appreciate inputs from the SAS community to help resolve this&lt;/SPAN&gt;&lt;SPAN class=""&gt;. Thank you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;For context, I was trying to determine the impact of an intervention (variable group: 1 = control, 2 = intervention) on the outcome variable (infection: 1 = Yes, 0 = No). The trial was conducted across 8 clusters (villages), and information on the same individuals in each village was collected at two time points: baseline and follow-up (time=0 baseline, 1 follow-up). FullID pertains to individual ID.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;proc glimmix data=trial;&lt;BR /&gt;class village group;&lt;BR /&gt;model infection (ref='0')/n=group /s dist=binomila link=logit;&lt;BR /&gt;random intercept time/subject= village fullid type=vc;&lt;BR /&gt;lsmeans group/cl ilink;&lt;BR /&gt;ods select lsmeans;&lt;BR /&gt;run;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;!--  EndFragment   --&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Nov 2025 02:56:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-it-is-used-out-of-proper-order-for/m-p/979160#M378751</guid>
      <dc:creator>MLSM</dc:creator>
      <dc:date>2025-11-20T02:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: Statement is not valid or it is used out of proper order for Proc GLIMMIX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-it-is-used-out-of-proper-order-for/m-p/979163#M378754</link>
      <description>&lt;P&gt;Best practice on this forum when discussing error messages is to copy from the LOG the text of the code submitted and all the notes, messages, warnings and/or errors. Then on the forum open a text box using the&lt;/P&gt;
&lt;P&gt;&amp;lt;/&amp;gt; icon that appears above the message window and paste all of the copied text.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The text box will maintain formatting and&amp;nbsp; many of these error messages will provide diagnostic information such as column and statement that SAS determines the error appears which gives us more clues as to likely solutions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Generically this error could come from a statement a procedure doesn't use or something such as a missing semicolon. Another possibility incompatible options.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With that, did the this line show the error?&lt;/P&gt;
&lt;PRE&gt;model infection (ref='0')/n=group /s dist=binomila link=logit;&lt;/PRE&gt;
&lt;P&gt;Most of the statements that use a / to indicate the start of options only allow a single slash. So if that line threw the error try deleting the / before the S before Dist=. Might want to use Dist=Binomial as well.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Nov 2025 04:19:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-it-is-used-out-of-proper-order-for/m-p/979163#M378754</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2025-11-20T04:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: Statement is not valid or it is used out of proper order for Proc GLIMMIX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-it-is-used-out-of-proper-order-for/m-p/979171#M378758</link>
      <description>&lt;P&gt;If your Y variable is 0 1 ,the right syntax is&lt;/P&gt;
&lt;PRE&gt;model infection(ref='0')=group /s dist=&lt;STRONG&gt;binary&lt;/STRONG&gt; link=logit;&lt;/PRE&gt;
&lt;P&gt;If your Y is a count number of infection=0 ,the right syntax is&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;model count/n=group /s dist=&lt;STRONG&gt;binomial&lt;/STRONG&gt; link=logit;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Nov 2025 08:29:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-it-is-used-out-of-proper-order-for/m-p/979171#M378758</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-11-20T08:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Statement is not valid or it is used out of proper order for Proc GLIMMIX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-it-is-used-out-of-proper-order-for/m-p/979272#M378766</link>
      <description>&lt;P&gt;Thank you. I've tried using the suggested codes for categorical data, corrected the spelling, and ensured the inclusion of a semicolon, but I'm still receiving the following error. I've pasted the error message from the SAS log here.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;808 proc&lt;/P&gt;&lt;P&gt;808! glimmix data=trial;&lt;BR /&gt;-------&lt;BR /&gt;180&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;809 class village group;&lt;BR /&gt;-----&lt;BR /&gt;180&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;810 model infection (ref='0')/n= group /s dist=binary link=logit;&lt;BR /&gt;-----&lt;BR /&gt;180&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;811 random intercept time/subject=village fullid type=vc;&lt;BR /&gt;------&lt;BR /&gt;180&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;812 run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Nov 2025 03:51:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-it-is-used-out-of-proper-order-for/m-p/979272#M378766</guid>
      <dc:creator>MLSM</dc:creator>
      <dc:date>2025-11-21T03:51:03Z</dc:date>
    </item>
    <item>
      <title>Re: Statement is not valid or it is used out of proper order for Proc GLIMMIX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-it-is-used-out-of-proper-order-for/m-p/979274#M378767</link>
      <description>&lt;P&gt;You did not follow my code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As I said, if your Y variable is 0 or 1, you should this:&lt;/P&gt;
&lt;PRE&gt;model infection (ref='0')= group /s dist=binary link=logit;&lt;/PRE&gt;
&lt;P&gt;not this&lt;/P&gt;
&lt;PRE&gt;model infection (ref='0')&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;/n&lt;/STRONG&gt;&lt;/FONT&gt;= group /s dist=binary link=logit;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Nov 2025 06:36:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-it-is-used-out-of-proper-order-for/m-p/979274#M378767</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-11-21T06:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: Statement is not valid or it is used out of proper order for Proc GLIMMIX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-it-is-used-out-of-proper-order-for/m-p/979275#M378768</link>
      <description>&lt;P&gt;And here is an example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;1    proc glimmix data=sashelp.heart(obs=1000);
2    class  bp_status;
3  &lt;STRONG&gt;  model status(ref='Dead')=bp_status /s dist=binary link=logit;&lt;/STRONG&gt;
4    lsmeans bp_status/cl ilink;
5    ods select lsmeans;
6    run;




NOTE: GLIMMIX 过程正在对概率 Status=“Alive”建模。
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: “PROCEDURE GLIMMIX”所用时间（总处理时间）:
      实际时间          2.49 秒
      CPU 时间          0.45 秒
&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Nov 2025 06:42:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-it-is-used-out-of-proper-order-for/m-p/979275#M378768</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-11-21T06:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: Statement is not valid or it is used out of proper order for Proc GLIMMIX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-it-is-used-out-of-proper-order-for/m-p/979293#M378774</link>
      <description>&lt;P&gt;Based on your log, check to see whether there is a syntax error or missing semicolon on the LINE BEFORE the PROC GLIMMIX statement. If you can't find it, paste the log starting from a few lines BEFORE what you've shown us.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Nov 2025 14:14:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-it-is-used-out-of-proper-order-for/m-p/979293#M378774</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2025-11-21T14:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: Statement is not valid or it is used out of proper order for Proc GLIMMIX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-it-is-used-out-of-proper-order-for/m-p/980515#M378949</link>
      <description>Thank you very much. I have revised the syntax, and it run.</description>
      <pubDate>Wed, 10 Dec 2025 03:04:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-it-is-used-out-of-proper-order-for/m-p/980515#M378949</guid>
      <dc:creator>MLSM</dc:creator>
      <dc:date>2025-12-10T03:04:37Z</dc:date>
    </item>
  </channel>
</rss>

