Hello,
New SAS user here. I am trying to add a variable "FERTILITY_TEEN" to my multivariate regression model. However, while the datasets have been properly merged and I can even run proc means on this variable, SAS won't recognize the variable when I try to run the regression. Do you have any idea why SAS wouldn't recognize the name of the variable in the proc reg statement? I find it particularly strange given that it read it in the proc means statement. I've attached some screenshots for reference.
Thanks so much,
SAStuck
Most likely cause: spelling the name differently than it occurs in the data set. Second is it isn't there at all.
Post code and log into code box opened using the forum {I} menu icon.
Many people don't want to take the chance on reading DOCX or XLSX files from an unknown source. Others just don't want to bother with the way the forum is currently handling some attachments. Reading the code in a code box is just plain easier as you can copy from the log or the SAS editor and paste directly into the code box and maintain the format of the text.
No need to make a word file so you can post a photograph of your screen. Just use the Photos icon on the editor tool bar.
But to get an answer you need to post the code you ran. To post the code or log copy it as text (don't take a picture of it!) and paste it into the pop-up window that the Insert Code or Insert SAS Code buttons on the tool bar open.
You are either trying to reference the variable by its label instead of its name or you ran the regression on a different dataset than the one used for proc means.
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.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.