BookmarkSubscribeRSS Feed
rashmiram0522
Calcite | Level 5

Hi,

 

I am trying to build regression model but I am getting an error "Variable not found" whereas variable is present in the dataset?

This is the code I am writing

 


PROC REG data=Smoking;
MODEL Pressure = Smoker;
RUN;
QUIT;

Thanks,

Rashmi.

5 REPLIES 5
stat_sas
Ammonite | Level 13

Hi,

 

Please share your log and a sample data. This will help community members to respond accordingly.

rashmiram0522
Calcite | Level 5

Hi,

 

This is the log: 

 

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
61
62 PROC REG data=Smoking;
63 MODEL Pressure = Smoker;
ERROR: Variable PRESSURE not found.
NOTE: The previous statement has been deleted.
64 RUN;
 
WARNING: No variables specified for an SSCP matrix. Execution terminating.
NOTE: PROCEDURE REG used (Total process time):
real time 0.00 seconds
CPU time 0.00 seconds
 
 
65 QUIT;
66
67
68 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
81
 
 
I have attached my data set here.
 
Thanks.
stat_sas
Ammonite | Level 13

Problem seems to be with smoker variable which is a character type. proc reg requires numeric predictors.

PGStats
Opal | Level 21

Please check the names and types of your variables in your dataset.Do not confuse the name and the label of variables. If SMOKER is character, you will need to switch to proc GLM and declare SMOKER in a CLASS statement.

PG
rashmiram0522
Calcite | Level 5

Thank you.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 1853 views
  • 0 likes
  • 3 in conversation