BookmarkSubscribeRSS Feed
iressa131
Calcite | Level 5

hello one of the variables in my dataset is just 'R'. I'm and trying to fit a few log-linear models but whenever i type in 'R' either alone or within an interaction term it turns blue. i looked it up and see that under the Model statement, R requests analysis of residuals. However my output seems like what is should be for the GENMOD procedure i ran and there are no plots/tables referencing residuals. In my analysis of maximum likelihood tables, the reference level of 'R' is correct referenced  so it appears that it worked as it should have 

 

But i'm just worried that my values are off. Does anyone know if this disrupts my output values?

Here is my code but on here it doesn't color it the way it is on my computer. Everything is the same expect the two 'r' in the interaction terms are blue.

proc genmod data=lm.hw4q1;
class m (ref='No') i (ref='No') r (ref= 'West') /param=reference;
model count = r m i i*r m*r /dist=Poisson;
run;

 

 

4 REPLIES 4
Shmuel
Garnet | Level 18

Have you tried to rename the variable R ?

(I'm not familiar with that proc and hope I have renamed the right Rs in your code)

proc genmod data=lm.hw4q1 (rename=(R=myR));
class m (ref='No') i (ref='No') myr (ref= 'West') /param=reference;
model count = myr m i i*myr m*myr /dist=Poisson;
run;
Kurt_Bremser
Super User

The Enhanced Editor is not perfect in its decisions when to use which color, so it can interpret your variable name wrongly as an option (that would be used in a slightly other place like following a forward slash).

From my experience, as long as the log looks like it should, you are OK.

ChrisHemedinger
Community Manager

@Kurt_Bremser is correct about the editor and how it colors keywords.  If the token is a valid keyword in the context of the statement, it gets the keyword color treatment.  But ultimately it's the SAS language processor that decides how to interpret it. 

 

If you want to be more explicit about this as a variable name, you can try the literal syntax -- but I'm not sure it makes this more readable:

 

proc genmod data=lm.hw4q1;
class m (ref='No') i (ref='No') 'r'n (ref= 'West') /param=reference;
model count = 'r'n m i i*'r'n m*'r'n /dist=Poisson;
run;
Register for SAS Innovate 2025!! The premier event for SAS users, May 6-9 in Orlando FL. Sign up now for the best deals!
ballardw
Super User

The "R" to request residuals is an option which would go after the /. If you were to include in in your model the statement would be:

model count = r m i i*r m*r /  dist=Poisson  R;

So there should be no problem with a variable named R or Poisson or Pred or any of the other options. Though the code might appear somewhat misleading ...

 

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1157 views
  • 3 likes
  • 5 in conversation