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;
Learn from the Experts! Check out the huge catalog of free sessions in the Ask the Expert webinar series.
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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 944 views
  • 3 likes
  • 5 in conversation