BookmarkSubscribeRSS Feed
alex_PARIS
Calcite | Level 5
Hi everybody,

Newby on the forum and with sas, I would like to do a regression for exemple :
model car_solded = earn population

After I would like plot the results and residues on the same graph but depending on time. But I have the problem below:
ERROR: A variable was specified in the PLOT statement which is not specified in a VAR or
MODEL statement

The complete example is below:
proc reg data=data.data_used;
title 'regression lineaire';
model car_solded = earn population /r p;
plot r.*Time;
run;


Could someone helping me.
Thanks a lot
1 REPLY 1
Robert_Bardos
Fluorite | Level 6
The documentation for PROC REG says

VAR
lists variables for which crossproducts are to be computed, variables that can be interactively added to the model, or variables to be used in scatter plots.


So you probably need a VAR statement here (as the ERROR message suggests BTW.)

As an aside: why can't these error messages say which variable? Should be pretty much known ...

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!

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
  • 1 reply
  • 631 views
  • 0 likes
  • 2 in conversation