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;
It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
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-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!

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