BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sgupta
Calcite | Level 5

Hello all,

 

I am trying to run logistic reg code but I am getting below error : 

 

NOTE: PROCEDURE LOGISTIC used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds

ERROR: Variable education not found.
NOTE: The SAS System stopped processing this step because of errors.
7 proc logistic data=work.bank1 desc;
8 model y= age job marital education default campaign cons_price_idx cons_conf_idx
8 ! euribor3m/ctable ;
9 run;

 

The error says education variable is missing but I can see the variable in bank1.xls file when open in sas.What can I do to resolve this issue?Below is the code I am running

 

proc logistic data=work.bank1 desc;
model y= age job marital education default campaign cons_price_idx cons_conf_idx euribor3m/ctable ;
run;

 

Please reply

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

That's exactly what I meant. So, the solution (regarding this specific error at least) is as simple as deleting the "n" in "education" in your PROC LOGISTIC step: educatio

View solution in original post

8 REPLIES 8
FreelanceReinh
Jade | Level 19

Hello @sgupta,

 

It's not enough that variable EDUCATION is contained in some Excel file. As a rule, for the PROC LOGISTIC step it's mandatory that this variable is also contained in the SAS dataset WORK.BANK1, i.e. in a file bank1.sas7bdat. You can check whether this is the case by submitting the following code:

proc contents data=work.bank1;
run;

What do you see in the output of the above PROC CONTENTS step?

sgupta
Calcite | Level 5
I can see below output

[image: Inline image 1]

##- Please type your reply above this line. Simple formatting, no
attachments. -##
sgupta
Calcite | Level 5

when I run it I can see 

 

under Alphabetic List of Variables and Attributes:

Variable       Type.......                                Label

EDUCATIO Num 8 BEST14. BEST14. EDUCATION

 

what does it mean.do i need to add something in code?

 

 

 

 

FreelanceReinh
Jade | Level 19

That's exactly what I meant. So, the solution (regarding this specific error at least) is as simple as deleting the "n" in "education" in your PROC LOGISTIC step: educatio

sgupta
Calcite | Level 5

Thanks 

I similarly changed other variables and I am able to see output now.

 

But can Run the original code with varibale names same as Label names?will adding label statement help?

FreelanceReinh
Jade | Level 19

You're welcome.

 

No, you have to provide variable names to PROC LOGISTIC, not variable labels. Please note that variable labels, unlike variable names, may contain virtually any kind of special characters etc., which would cause nothing but problems.

 

If you don't like variable names such as educatio (which is the Latin word for "education", hence quite honorable 🙂 ), please feel free to rename your variables.

ballardw
Super User

@sgupta wrote:

 

But can Run the original code with varibale names same as Label names?will adding label statement help?


 

I assign labels to almost every variable in my permanent data sets because they make reading the results in procedures much easier. SAS will usually show at least some if not all of the next of the label in analysis procedures.

If I have a variable named age_ptt and that text appears in the output, I am about the only one that might know what it stands for. if I haven't used the data for a while I might not even remember. But if I associate a label age_ptt="Age Prior to Treatment", then when the label appears in a procedure output it has much better use.

 

The exceptions to adding label are variables such as Year, though if there are multiple year/date variables even that may get a label, and common data elements such as Phone or Zip.

FreelanceReinh
Jade | Level 19

I'm sorry, but I can't see your output. It shows as text "[image: Inline image 1]" in my browser. Strange.

 

But the only relevant information is: Does the PROC CONTENTS output show a variable named EDUCATION (upper or lower case doesn't matter) or maybe only a variable whose label is "Education"?

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 8 replies
  • 28611 views
  • 5 likes
  • 3 in conversation