BookmarkSubscribeRSS Feed
sastuck
Pyrite | Level 9

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

2 REPLIES 2
ballardw
Super User

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.

Tom
Super User Tom
Super User

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.

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!

SAS Enterprise Guide vs. SAS Studio

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.

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
  • 2 replies
  • 1436 views
  • 1 like
  • 3 in conversation