My SAS was yelling at me like this:
whsub
NOTE: 5079 observations are not included because of missing values.
NOTE: Convergence criteria met.
WARNING: Output 'ParameterEstimates' was not created. Make sure that the output object name,
label, or path is spelled correctly. Also, verify that the appropriate procedure
options are used to produce the requested output object. For example, verify that the
NOPRINT option is not used.
NOTE: PROCEDURE MIXED used (Total process time):
real time 0.94 seconds
cpu time 0.89 seconds
ERROR: File WORK.NUT_WHSUB.DATA does not exist.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.NUT_WHSUB may be incomplete. When this step was stopped there were
0 observations and 1 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
NOTE: Appending WORK.NUT_WHSUB to WORK.ESTIMATES_NUT.
NOTE: There were 0 observations read from the data set WORK.NUT_WHSUB.
NOTE: 0 observations added.
NOTE: The data set WORK.ESTIMATES_NUT has 0 observations and 1 variables.
NOTE: Deleting WORK.NUT_WHSUB (memtype=DATA).
NOTE: PROCEDURE DATASETS used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
My code is like this:
%macro loop(data, outcome);
ods exclude all;
%let dsid=%sysfunc(open(&data));
%do i = 7861 %to 7976;
%let x&i=%sysfunc(varname(&dsid,&i));
%put &&x&i;
ods output ParameterEstimates=NUT_&&x&i;
proc mixed data=&data method = REML covtest plots(MAXPOINTS=10000);
class SmkNow sex hisp NHW education_missing education_college /ref=FIRST;
model &outcome = &&x&i smoke smoke*&&x&i calor years smoke*years &&x&i*years &&x&i*smoke*years calor*years SmkNow PY height AgeEntry sex hisp NHW BMI education_missing education_college/ solution ddfm = sat;
random intercept years / subject = RID;
run;
quit;
data NUT_&&x&i; length Nutrient $ 2000;set NUT_&&x&i; Nutrient="&&x&i"; run;
%if &i=7861 %then %do;
data Estimates_nut;
set NUT_&&x&i;
run;
%end;
%else%do;
proc datasets;
append base=Estimates_nut data=NUT_&&x&i force;
delete NUT_&&x&i;
quit;
%end;
%end;
ods exclude none;
%mend;
%loop(work.sgrqnutrmerged, FEV1postBD);
Also, every nutrient I run, the log showed errors like above. Could anyone tell me which part I did wrongly?
There is no PARAMETERESTIMATES table that can be output from PROC MIXED.
I believe that if you want estimates of the fixed terms in the model, you need to use
ods output solutionF=NUT_whsub;
Since you are using a macro, please turn on the macro debugging option by running this command
options mprint;
and run one iteration of your macro again
Please show us the ENTIRE log for this code (that's 100% of the log, every single line; do NOT select parts to show us and not show us other parts). Please copy the log as text and paste it into the window that appears when you click on the </> icon.
whsub MPRINT(LOOP): ods output ParameterEstimates=NUT_whsub; MPRINT(LOOP): proc mixed data=gai.sgrqnutrmerged method = REML covtest plots(MAXPOINTS=10000); MPRINT(LOOP): class SmkNow sex hisp NHW education_missing education_college /ref=FIRST; MPRINT(LOOP): model FEV1postBD = whsub smoke smoke*whsub calor years smoke*years whsub*years whsub*smoke*years calor*years SmkNow PY height AgeEntry sex hisp NHW BMI education_missing education_college/ solution ddfm = sat; MPRINT(LOOP): random intercept years / subject = RID; MPRINT(LOOP): run; NOTE: 5079 observations are not included because of missing values. NOTE: Convergence criteria met. WARNING: Output 'ParameterEstimates' was not created. Make sure that the output object name, label, or path is spelled correctly. Also, verify that the appropriate procedure options are used to produce the requested output object. For example, verify that the NOPRINT option is not used. NOTE: PROCEDURE MIXED used (Total process time): real time 0.95 seconds cpu time 0.95 seconds MPRINT(LOOP): quit; MPRINT(LOOP): data NUT_whsub; MPRINT(LOOP): length Nutrient $ 2000; MPRINT(LOOP): set NUT_whsub; ERROR: File WORK.NUT_WHSUB.DATA does not exist. MPRINT(LOOP): Nutrient="whsub"; MPRINT(LOOP): run; NOTE: The SAS System stopped processing this step because of errors. WARNING: The data set WORK.NUT_WHSUB may be incomplete. When this step was stopped there were 0 observations and 1 variables. NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds MPRINT(LOOP): proc datasets; MPRINT(LOOP): append base=Estimates_nut data=NUT_whsub force; NOTE: Appending WORK.NUT_WHSUB to WORK.ESTIMATES_NUT. NOTE: There were 0 observations read from the data set WORK.NUT_WHSUB. NOTE: 0 observations added. NOTE: The data set WORK.ESTIMATES_NUT has 0 observations and 1 variables. MPRINT(LOOP): delete NUT_whsub; MPRINT(LOOP): quit; NOTE: Deleting WORK.NUT_WHSUB (memtype=DATA). NOTE: PROCEDURE DATASETS used (Total process time): real time 0.00 seconds cpu time 0.00 seconds MPRINT(LOOP): ods exclude none;
Hi please see this
Looks like you either did not tell PROC MIXED to output anything. Or perhaps it did not output anything because of some issue with the model being tested?
Hi, output is this
%loop(worksgrqnutrmerged, FEV1postBD);
after %mend; statement
@greenie wrote:
Hi, output is this
%loop(worksgrqnutrmerged, FEV1postBD);after %mend; statement
That is just a macro call. It does not tell us what code the macro generated.
I'm not very sure. I used these code to run proc phreg and proc glm, both works. Only this proc mixed does not work..
@greenie wrote:
I'm not very sure. I used these code to run proc phreg and proc glm, both works. Only this proc mixed does not work..
Run one model manually, i.e. with NO macro looping or macro variables.
Add before you run the procedure:
Ods trace on;
Then run Ods Trace off; afterwards to turn the trace off.
That will show you the names of the tables generated by your code that you can place on the ODS OUTPUT statement.
The log is telling you that ParameterEstimates is not create by Proc Mixed. So you need to find the name of the table that is generated to use in your ODS OUTPUT.
Hi I run one manually: but what is the table name you mean?
97 Ods trace on; 98 proc mixed data=work.sgrqnutrmerged method = REML covtest plots(MAXPOINTS=10000); 99 class SmkNow sex hisp NHW education_missing education_college /ref=FIRST; 100 model FEV1postbd = prot smoke smoke*prot calor years smoke*years prot*years 100! prot*smoke*years calor*years SmkNow PY height AgeEntry sex hisp NHW BMI 100! education_missing education_college/ solution ddfm = sat; 101 random intercept years / subject = RID; 102 run; Output Added: ------------- Name: ModelInfo Label: Model Information Template: Stat.Mixed.ModelInfo Path: Mixed.ModelInfo ------------- Output Added: ------------- Name: ClassLevels Label: Class Level Information Template: Stat.Mixed.ClassLevels Path: Mixed.ClassLevels ------------- Output Added: ------------- Name: Dimensions Label: Dimensions Template: Stat.Mixed.Dimensions Path: Mixed.Dimensions ------------- Output Added: ------------- Name: NObs Label: Number of Observations Template: Stat.Mixed.NObs Path: Mixed.NObs ------------- NOTE: 1167 observations are not included because of missing values. Output Added: ------------- Name: IterHistory Label: Iteration History Template: Stat.Mixed.IterHistory Path: Mixed.IterHistory ------------- Output Added: ------------- Name: ConvergenceStatus Label: Convergence Status Template: Stat.Mixed.ConvergenceStatus Path: Mixed.ConvergenceStatus ------------- NOTE: Convergence criteria met. Output Added: ------------- Name: CovParms Label: Covariance Parameter Estimates Template: Stat.Mixed.CovParms Path: Mixed.CovParms ------------- Output Added: ------------- Name: FitStatistics Label: Fit Statistics Template: Stat.Mixed.FitStatistics Path: Mixed.FitStatistics ------------- Output Added: ------------- Name: SolutionF Label: Solution for Fixed Effects Template: Stat.Mixed.SolutionF Path: Mixed.SolutionF ------------- Output Added: ------------- Name: Tests3 Label: Type 3 Tests of Fixed Effects Template: Stat.Mixed.Tests3 Path: Mixed.Tests3 ------------- NOTE: PROCEDURE MIXED used (Total process time): real time 1.08 seconds cpu time 1.03 seconds 103 Ods Trace off;
There is no PARAMETERESTIMATES table that can be output from PROC MIXED.
I believe that if you want estimates of the fixed terms in the model, you need to use
ods output solutionF=NUT_whsub;
This works! OMG problem solved! Thank you so much and thank eveybody's help!
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.