Hi all,
I'm running into an issue with my code. Briefly, I'm looking at how certain psychological constructs impact the effectiveness of a behavioral treatment. One of the treatments is time-out, where observers watch the kid for 30 seconds, and then record behavior for 10 seconds, and repeats this until the time-out ends. Naturally, it's an unbalanced dataset with some kids getting a few time-outs, and others getting many time-outs. I'm approaching it in a multi-level design:
Level 1 = the interval where data are collected (ranges from 1-197)
Level 2 = the unique ID # to identify the time-out (there are 545 unique time-outs)
Level 3 = the unique ID # to identify the child
So, interval data is nested in time-out, which is nested in child.
I'm running this in a stepwise approach. My first two models converged (see end of message). But model 3, where I want to include the full nesting term provides the following error:
Model 3 - not converging, receiving above error.
PROC GLIMMIX DATA=impstdmrpsra2 METHOD=LAPLACE;
CLASS MRPSID UnqTONum IntervalNum Meds TOTxCond;
MODEL Effective = meds TOTxCond week ptadhd ptcp pticu24 pticu24*TOTxCond / SOLUTION CL;
RANDOM intercept / SUBJECT=MRPSID;
RANDOM intercept / SUBJECT= UnqTONum(MRPSID);
RANDOM intercept / SUBJECT=IntervalNum(UnqTONum(MRPSID)) TYPE=UN;
options mprint mlogic symbolgen ;
RUN;
Model 1 - converges.
PROC GLIMMIX DATA=impstdmrpsra2 METHOD=LAPLACE;
CLASS MRPSID Meds TOTxCond;
MODEL Effective = meds TOTxCond week ptadhd ptcp pticu24 pticu24*TOTxCond / SOLUTION CL;
RANDOM intercept / SUBJECT=MRPSID TYPE=UN;
RUN;
Model 2 - converges.
PROC GLIMMIX DATA=impstdmrpsra2 METHOD=LAPLACE;
CLASS MRPSID UnqTONum Meds TOTxCond;
MODEL Effective = meds TOTxCond week ptadhd ptcp pticu24 pticu24*TOTxCond / SOLUTION CL;
RANDOM intercept / SUBJECT=UnqTONum(MRPSID) TYPE=UN;
RUN;
You should paste the LOG into a text box opened with the </> .
Reason is the location of the _ in this bit is important because it will appear in the location that SAS reports the syntax error.
74 RANDOM intercept / SUBJECT=IntervalNum(UnqTONum(MRPSID)) TYPE=UN; _ 22 200 ERROR 22-322: Syntax error, expecting one of the following: a name, ), *. ERROR 200-322: The symbol is not recognized and will be ignored.
Another reason to post the text into a text box is that the forum software reformats pasted text in the main window, such are removing the spaces that would align the _ in the error message. Sometimes there can be other not visible characters that creep into code files (copy paste from html or word processor documents for example) that the code parser finds by you don't see. Someone with the tools and interest can often find those in the text box.
Also please note that descriptions such as "So, interval data is nested in time-out, which is nested in child" really should reference variable names for clarity.
Is that true? I feel like I've read on SAS documentation that you can have multiple levels of nesting, such as what I have in my model. But if that is the case, then how do models account for multiple levels?
Level 1 = IntervalNum
Level2 = UnqTONum
Level3 = MRPSID
SUBJECT=IntervalNum(UnqTONum(MRPSID)) should be changed to
SUBJECT=IntervalNum(UnqTONum MRPSID)
Thanks,
Jill
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.