BookmarkSubscribeRSS Feed
AXR
Calcite | Level 5 AXR
Calcite | Level 5

Hi, I am using the margins macro with a gamma distribution and a log link to output the average marginal effect of a continuous variable within levels of a categorical variable. When I run the macro, after some time, I get the following error. I believe this error is associated with the continuous variable (var3) in the effect statement because when I take it out the margins run without error for the categorical variable in the margins statement (var2).

SAS error 2020-07-13 212813.png

 

I use the following code:

%Margins(data = dat,
			response = var1,
			model = var2|var3  var2|var4 var2|var5 var6-var12
			effect = var3,
			margins = var2,
			class = var2 var5 var6 var_id,
			dist = gamma,
			link = log,
			geesubject = var_id,
			geecorr = ind,
			options = diff cl);

 

4 REPLIES 4
ChrisNZ
Tourmaline | Level 20

I have no idea what the margins macro is. 

That macro is trying to store too many values in a macro variable.

If storing this many values is justified (is it?), you need to alter the macro so it does not use a macro variable to pass a list of values.

 

ChrisNZ
Tourmaline | Level 20

I suppose it's this macro: https://support.sas.com/kb/63/038.html

Try replacing line

%let _version = 1.05;

with

%let _version = DEBUG;

to see where the error takes place so you can work there.

AXR
Calcite | Level 5 AXR
Calcite | Level 5

Hi @ChrisNZ thanks for your response.

 

Unfortunately, changing the macro code to DEBUG didn't change anything. I get the same error message.

ChrisNZ
Tourmaline | Level 20

Read my message again

 

Try replacing ... to see where the error takes place 

You need to change how the macro works. So you need to investigate where the macro variable is used.

DEBUG will some of the macro's workings and help you do that.

DEBUG2 will display even more.

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 4 replies
  • 496 views
  • 0 likes
  • 2 in conversation