BookmarkSubscribeRSS Feed
bioresearch
Calcite | Level 5

I am trying to run a regeression program on sashelp.car using KEEP statement and here is the code that I used;

 

data auto;
set sashelp.cars;
keep make model MSRP;
run;
proc reg data=auto;
model MSRP=make model;
run;

and the log is;

 

 
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 proc reg data=auto;
74 model MSRP=make model;
ERROR: Variable Make in list does not match type prescribed for this list.
ERROR: Variable Model in list does not match type prescribed for this list.
NOTE: The previous statement has been deleted.
75 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
 
 
76
77
78 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
91
 
while the error message is '
ERROR: Variable Make in list does not match type prescribed for this list.
ERROR: Variable Model in list does not match type prescribed for this list.'
6 REPLIES 6
Reeza
Super User

Make and Model are character variables/categorical variables. 

 

You can use them in PROC GLM if that's the model you're trying to build. Also, you don't necessarily need to subset your data ahead of time, you can use the KEEP data set option. 

 

proc glm data=sashelp.cars (keep = msrp make model);
class make model;
model msrp = make model;
run;

PS. This doesn't make logical sense, but I'm assuming you're just trying things. FYI - the first e-course on Statistics and SAS is free. 

 


@bioresearch wrote:

I am trying to run a regeression program on sashelp.car using KEEP statement and here is the code that I used;

 

data auto;
set sashelp.cars;
keep make model MSRP;
run;
proc reg data=auto;
model MSRP=make model;
run;

and the log is;

 

 
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 proc reg data=auto;
74 model MSRP=make model;
ERROR: Variable Make in list does not match type prescribed for this list.
ERROR: Variable Model in list does not match type prescribed for this list.
NOTE: The previous statement has been deleted.
75 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
 
 
76
77
78 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
91
 
while the error message is '
ERROR: Variable Make in list does not match type prescribed for this list.
ERROR: Variable Model in list does not match type prescribed for this list.'

 

bioresearch
Calcite | Level 5

This actually produced a valid statement but did not give me what I intended to bring out of the output.

 

Therefore, I need more solutions.

 

Thanks very much.

Reeza
Super User

@bioresearch wrote:

This actually produced a valid statement but did not give me what I intended to bring out of the output.

 

Therefore, I need more solutions.

 

Thanks very much.


How are we suppose to know your 'intentions'? 

 

 

bioresearch
Calcite | Level 5
What I want is to run a regression analysis of that data.

##- Please type your reply above this line. No attachm Ients. -##
Reeza
Super User

'regression analysis' is vague. Are you looking to run a linear or logistic regression model? What's your independent variable? What's your dependent variable? Running a linear regression analysis with only two categorical variables doesn't make a heck of a lot of sense in practical terms. 

 

 


@bioresearch wrote:
What I want is to run a regression analysis of that data.

##- Please type your reply above this line. No attachm Ients. -##



utrocketeng
Quartz | Level 8

seems as though you are trying to do linear regression with Character predictors.  try this example for a linear regression with continuous factors:

 

data auto;
set sashelp.cars;
/*keep make model MSRP;*/
run;

proc reg data=auto;
model MSRP=EngineSize Cylinders;
run;

 

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