Hi all,
I used proc mixed to estimate REML . It is,
PROC IML;
........
.........;
submit;(This command is RED COLOUR)
proc mixed data=mix method=reml;
class ID;
model Y= X1 X2 X3 / solution outpm=outpm;
repeated / type=cs subject = ID R;
ods output R=R SolutionF=SolutionF;
run;quit;
endsubmit;
.....continue IML programme....(here some codes are red)
I have three questions...
1) How can I stop printing the outcome of this (Proc mixed)? (I used no print option but not working)
2) I used both iml and proc mixed for my programme. It take too much time to run and complete simulation. How can I solve this?
3) Why do some codes are red?
Thank you for your Help.
You can turn of the listing (or other output locations) so that only the ODS OUTPUT is running.
You can use ODS SELECT or ODS EXCLUDE.
The SUBMIT statement is red because the command is RSUBMIT. Code within the RSUBMIT/ENDRSUBMIT block will be run on the remote session.
Thank you so much Tom. It work(RSUBMIT). I have still some red code after the the proc mixed. My program look like following.
proc iml;
*********************************;
*******Generating X matrix********;
**********************************;
call randseed(2346);
xi=j(N1,1);
X=j(N1,7);
call randgen(xi,'Normal');
X[ ,1]=xi;
.........
.......more here..
call randseed(1234);
create Mix var {"Y" "x1" "x2" "x3" "x4" "x5" "x6" "x7" "Indiv"}; /* name the variables */
append;
close Mix;
Rsubmit;
ods select noitprint;
proc mixed data=Mix method=reml ;
class Indiv;
model y = x1 x2 x3 x4 x5 x6 x7 / solution outpm=outpm;
repeated / type=cs subject=Indiv R;
ods output R=R SolutionF=SolutionF;
run;quit;
endRsubmit;
use R; read all var _NUM_ into cov;close;
use SolutionF; read all var {Estimate} in bet; close;
--------------------------------------more....
--------------------------------------------
my program is long. You can see bold underlined words. They are still red. I am thinking that the way I connect IML and PROC MIXED is wrong.Please let me know
If you know this.
AGAIN...NOW MY PROGRAM IS NOT WORKING TO RSUBMIT..IT SAYS FOLLOWING ERROR.
1432 RSUBMIT;
ERROR: Invalid or unspecified remote session ID. Set OPTIONS REMOTE=session_id.
ERROR: Remote submit to UNKNOWN canceled.
1433
I have no idea why it is not working now.
Thank you so much.
Don't worry about the red color. Your original syntax (SUBMIT...ENDSUBMIT) was correct. SUBMIT is a valid SAS/IML statement.
Are you running a simulation? For the explanatory variable, are you generating explanatory variables as a cluster of multivariate normal data? If so, see
Sampling from the multivariate normal distribution - The DO Loop
or
http://blogs.sas.com/content/iml/2011/09/21/generate-a-random-sample-from-a-mixture-distribution/
For simulating multivariate data and mixed models, I recommend the book Simulating Data with SAS , especially Chapter 8 (multivariate distributions) and Chapter 12 (Simulating from Advanced Regression Models).
Could I just confirm the use of SUBMIT and ENDSUBMIT in SAS IML.
I too am getting red color commands after I use the SUBMIT ENDSUBMIT in IML. For example:
PROC IML;
obs = 1;
count = 1;
do i = 1 to 8 while(obs<5);
count = count+1;
create newdata from count [colname="count"]; append from count; close newdata;
SUBMIT;
data newdata;
set newdata;
if count=4 then delete;
run;
PROC APPEND BASE=results Data=newdata;
Run;
ENDSUBMIT;
use results; read all var _NUM_ into numobs; close results;
obs = NROW(numobs);
END;
QUIT;
Here the use, read, and close command after the ENDSUBMIT is red (and any others inserted before QUIT) even though, as I understand, we are back in IML after the ENDSUBMIT. Is this just a color glitch? It seems to run fine but just want to make sure.
Thanks,
Scott
Yes. The editor tries to color keywords as best it can, but PROC IML has it's own syntax that sometimes differs from syntax of other procedures. Your syntax looks fine to me.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.