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;
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;
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.
@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;
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 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.