BookmarkSubscribeRSS Feed
JuanVte
Calcite | Level 5
Dear all,

When I execute the code below, I am having the following warning message:

WARNING: The relative Hessian convergence criterion of 0.2919725428 is greater than the limit
of 0.0001. The convergence is questionable.
WARNING: The procedure is continuing but the validity of the model fit is questionable.


However, if I show the content of the variable SYSERR, it is equal to 0 instead of 4, as indicated in sas documentation:

SYSERR can contain the following values:

Value Description
0 Execution completed successfully and without warning messages.
1 Execution was canceled by a user with a RUN CANCEL statement.
2 Execution was canceled by a user with an ATTN or BREAK command.
3 An error in a program run in batch or non-interactive mode caused SAS to enter syntax-check mode.
4 Execution completed successfully but with warning messages.
[...]

************************************************

data sim_data;
call streaminit(17427);
do k = 1 to 200;
x = 'pl';
y = rand('NEGBINOMIAL', 0.80, 1);
output;
end;
do k = 1 to 200;
x = 'tx';
y = rand('NEGBINOMIAL', 0.85, 1);
output;
end;
run;

proc genmod data=sim_data;
class x (param=ref ref='pl');
model y = x / dist=NEGBIN ;
lsmeans x;
run;

%put &syserr;

Any idea??
5 REPLIES 5
data_null__
Jade | Level 19
Perhaps you could use SYSWARNINGTEXT automatic variable.

[pre]
AUTOMATIC SYSWARNINGTEXT The procedure is continuing but the validity of the model fit is questionable
[/pre]
JuanVte
Calcite | Level 5
Thanks for your help!

the problem is that SYSWARNINGTEXT is only updated with a new warning message. If you run a process that works, in this variables is still stored the previous warning message so I can not distinguish between the proces that works and the one that doesn't work.

Try this just after my syntax above:

data _null_;
set _null_;
run;

%put &syserr &SYSWARNINGTEXT ;
data_null__
Jade | Level 19
The concergence status output has the relevant information.

[pre]
Output Added:
-------------
Name: ConvergenceStatus
Label: Convergence Status
Template: Stat.Genmod.ConvergenceStatus
Path: Genmod.ConvergenceStatus
-------------
[/pre]
JuanVte
Calcite | Level 5
Thanks!

yes, at the moment I will try that. However, I would like to control over other possible warnings. I am doing a macro to calculate required sample size based on GLMz models. For that I am doing simulations where if one of them doesn't work I have to repead. In general terms, I think (because I still don't know) that in 10,000 iteration I can find more problems than the convergence one, so I would like to have a general way to repeat any iteration with a warning message.

Thanks for your help!!
Juanvte.
PatrickG
SAS Employee
This works correctly at SAS 9.3 (which is about to be released -- keep sitting there).

As for the problem at 9.2 - this appears to be an issue with Proc Genmod. The SAS Macro Facility merely fetches the value for &syserr from the rest of the SAS System, where it's supposed to be set correctly by the data steps / procs.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 2621 views
  • 0 likes
  • 3 in conversation