BookmarkSubscribeRSS Feed
Ted1
Fluorite | Level 6

Hey SAS community,

Trying to perform a basic ANOVA analysis with a data set using PROC GLIMMIX, since my "YEAR" covariance parameter gives me a "." value, I know that I need to add a "nobound" statement to the proc. However, when I do this and run the code I get "QUANEW Optimization cannot be completed." in the log and no analysis is computed.  My code is. 

data First;
input year trial$ variety$ block trt  X;
cards;

(data) 

run;

proc glimmix data=First nobound;
class year trial block trt;
model X = trt /dist=lognormal link=identity 
random year trial(year) block(trial);
Covtest "Year = 0" 0 . . .;
Covtest "Trial = 0" . 0 . .;
Covtest "Block = 0" . . 0 .;
lsmeans trt / pdiff adjust=tukey ilink lines;
output out=second predicted=pred student=sresid student(noblup)=smresid;
ods output lsmeans=third;
run;

 

Furthermore, I get this problem with the "nobound" statement regardless if I add the transformation or not. 

If anyone has ideas to assisted me that would be greatly appreciated. 

Thanks.

 

Sincerely,

Ted 

9 REPLIES 9
ballardw
Super User

Any time you do not understand how a log message relates to your problem include the CODE with ALL the messages for the procedure or data step. Copy the text from the log with all the messages and then paste into a text box opened on the forum with the </> icon.

There may be details in the message that reveal why that you have not included.

Also, providing data which causes the message may be extremely helpful if it turns out to relate to levels or groups of variables without variability for example.

KevinScott
SAS Employee

Without knowing more about your problem and the input data to your PROC GLIMMIX code, I can only offer a few general suggestions:

 

1. If you cannot obtain proper convergence for the specified model, you may need to consider fitting a simpler model, that is, a model with fewer parameters. Looking at the model below, a considerable number of parameters may be associated with the random effects that need to be estimated. 


2. While convergence cannot be guaranteed, you may want to try altering the default optimization options available in the NLOPTIONS statement. See the NLOPTIONS statement description using the following links:

SAS Help Center: NLOPTIONS Statement

SAS Help Center: NLOPTIONS Statement: Shared Concepts and Topics



For instance, changing the optimization technique (NLOPTIONS TECH= option) or increasing the maximum number of iterations (NLOPTIONS MAXITER= option) may be helpful. Options for alternative stopping criteria are also available. The options for displaying the optimization history may provide useful information.

 

For more information, please see the following:

 

SAS Help Center: Choosing an Optimization Algorithm

Ted1
Fluorite | Level 6

Below is what the log gives in its entirety. As for the data itself, I am permitted to share that information.

 

20414 data First;
20415 input year trial$ variety$ block trt X
20416 cards;

NOTE: The data set WORK.First has 132 observations and 21 variables.
NOTE: DATA statement used (Total process time):
real time 0.02 seconds
cpu time 0.01 seconds


20549 ;
20550 /*
20551 run;
NOTE: Writing HTML Body file: sashtml65.htm
20552 proc glimmix data=First nobound;
20553 class year trial block;
20554 model X = trt /dist=lognormal link=identity;
20555 random year trial(year) block(trial);
20556 Covtest "Year = 0" 0 . . .;
20557 Covtest "Trial = 0" . 0 . .;
20559 Covtest "Block = 0" . . 0 .;
20559 lsmeans trt / pdiff adjust=tukey ilink lines;
20560 output out=second predicted=pred student=sresid student(noblup)=smresid;
20561 ods output lsmeans=third;
20562 run;

 

NOTE: Some observations are not used in the analysis because of: missing response values (n=13).
ERROR: QUANEW Optimization cannot be completed.
WARNING: The initial estimates did not yield a valid objective function.
WARNING: Output 'lsmeans' 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: The data set WORK.SECOND has 132 observations and 24 variables.
NOTE: PROCEDURE GLIMMIX used (Total process time):
real time 0.63 seconds
cpu time 0.40 seconds


20563 data btdata;
20564 set third;
20565 btlsmean=exp(estimate);
20566 btse_mean = exp(estimate)*stderr;
20567 run;

NOTE: There were 2 observations read from the data set WORK.THIRD.
NOTE: The data set WORK.BTDATA has 2 observations and 11 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds


20568 proc print data=btdata;
20569 run;

NOTE: There were 2 observations read from the data set WORK.BTDATA.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds


20570 proc sgplot data=second;
20571 scatter y=smresid x= trt;
20572 refline 0;
20573 run;

NOTE: PROCEDURE SGPLOT used (Total process time):
real time 0.50 seconds
cpu time 0.32 seconds

WARNING: Y=SMRESID is invalid. The option expects that the column not contain all missing values.
NOTE: There were 132 observations read from the data set WORK.SECOND.

20574 proc sgplot data=second;
20575 vbox smresid/group= trt datalabel;
20576 run;

NOTE: PROCEDURE SGPLOT used (Total process time):
real time 0.08 seconds
cpu time 0.04 seconds

WARNING: There are insufficient nonmissing observations to create a boxplot.
WARNING: The BoxPlot statement named 'VBOX' will not be drawn because one or more of the required
arguments were not supplied.
WARNING: A blank graph is produced. For possible causes, see the graphics template language
documentation.
NOTE: There were 132 observations read from the data set WORK.SECOND.

20577 proc sgscatter data=second;
20578 plot sresid*(pred trt);
20579 run;

NOTE: PROCEDURE SGSCATTER used (Total process time):
real time 0.07 seconds
cpu time 0.03 seconds

WARNING: X=PRED is invalid. The option expects that the column not contain all missing values.
WARNING: Y=SRESID is invalid. The option expects that the column not contain all missing values.
NOTE: There were 132 observations read from the data set WORK.SECOND.

20580 Proc univariate data=second normal plot;
20581 Var sresid;
20582 histogram sresid / normal kernel;
20583 Run;

WARNING: Insufficient number of nonmissing observations to create a histogram for sresid.
NOTE: PROCEDURE UNIVARIATE used (Total process time):
real time 0.02 seconds
cpu time 0.01 seconds


20584 proc sort data=second;
20585 by sresid;
20586 run;

NOTE: There were 132 observations read from the data set WORK.SECOND.
NOTE: The data set WORK.SECOND has 132 observations and 24 variables.
NOTE: PROCEDURE SORT used (Total process time):
real time 0.00 seconds
cpu time 0.01 seconds


20587 proc print data=second;
20588 run;

NOTE: There were 132 observations read from the data set WORK.SECOND.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.05 seconds
cpu time 0.04 seconds

 

SteveDenham
Jade | Level 19

The key in the log isn't necessarily the ERROR statement, but the WARNING immediately following. If you can't get started from the initial values, then the default QUANEW optimization will never converge. The model you have specified has trt as a continuous variable, so even if it converged you wouldn't have anything for the LSMEANS statement.

 

Something you might consider given this is to add trt to the CLASS statement. Next, how many years worth of data do you have?  How many trials within each year?  If the N for these aren't large enough to provide stable estimates, you will probably have at least some sort of convergence difficulty. The next thing to consider is that the lognormal distribution might not be the best to choose from a convergence standpoint.  Have you tried a gamma or exponential distribution with a log link? These will approximate a lognormal and may be more likely to converge.  Finally, can you rewrite your RANDOM statements to use the /subject= syntax?  That will also improve the odds of convergence.  If all of these lead back to the same issue, then there are other possibilities involving the PARMS statement or some options for the PROC GLIMMIX statement.

 

SteveDenham

Ted1
Fluorite | Level 6

Thanks for reaching back. 

 

I had to edit the log slightly since I am dealing with data I am not permitted to share. In the actual analysis the independent variable was not treated as continuous and was included in the class statement.  I am dealing with 2 years of data, 5 trial sites the first year and 7 in the second year. 

 

Will try your suggestions thanks. 

ballardw
Super User

@Ted1 wrote:

Thanks for reaching back. 

 

I had to edit the log slightly since I am dealing with data I am not permitted to share. In the actual analysis the independent variable was not treated as continuous and was included in the class statement.  I am dealing with 2 years of data, 5 trial sites the first year and 7 in the second year. 

 

Will try your suggestions thanks. 


If you are having to edit code because your variable names are "too sensitive" then you, or someone in your organization, is placing too much information into variable names. If you have a variable name like "sensitive_value_trt" it may be that perhaps your should have "sensitive value" as the value of a second innocuous variable and leave "trt" by itself. Which would with careful data structuring allow multiple "sensitive values" as model or reporting variables as needed.

SteveDenham
Jade | Level 19

I know that the design looks like year and site are random effects, but there really are not enough levels for this analysis with the number of records you have.  Consider making year and trial site fixed effects, and along with all the other stuff I threw out there, see if that alleviates the problem of not being able to get initial estimates to yield a valid objective function.  If it works, then you can use the solution to cobble together initial values that may work for the model with full random effects.

 

The other thing that occurs to me is that you may have a lot of empty (or nearly empty) cells. This is another cause of the failure to find initial estimates that yield a valid objective function. Look at a PROC FREQ or PROC MEANS output for each of your combinations of random effects. Since nested components are handled the same as crossed components in the Z matrix, this might give you a better feel for the arrangement of data.

 

SteveDenham

jiltao
SAS Super FREQ

your model specification is unusual to me. I suspect the model, especially the random effects, might be specified inappropriately for your data. Can you send us the data?

Thanks,

Jill

StatsMan
SAS Super FREQ

On top of @KevinScott 's and  @SteveDenham 's excellent suggestions, try simplifying the model a bit. You have 132 observations (13 with missing values) and have year, site(year) and block(site year) as random effects. Try removing block(site year) as a random effect and see if that helps. You may not have enough data to get a variance component down to the block level.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 9 replies
  • 1196 views
  • 5 likes
  • 6 in conversation