BookmarkSubscribeRSS Feed
taggerung
Calcite | Level 5

Hello, I've got some code that I'm doing multiple linear regression on. 

I've got data from an Excel file and that code is okay. It's when I'm referencing the data for the regression that I have problems on.

I know it's with the Datalines code. But I don't know what to do with it. I'm sorry for the bother. Could you please help?

The errors are 

ERROR 22-322: Syntax error, expecting one of the following: ;, CANCEL, PGM.
 
ERROR 200-322: The symbol is not recognized and will be ignored.

 

LibName Perm '/folders/myfolders/';

Proc import DataFile='/folders/myfolders/SimioHours.xlsx'
	Out=perm.SimioHours
	dbms=xlsx replace;
	
Run;

Proc Contents data=perm.SimioHours;
Run;

Proc Print data=perm.SimioHours;
Run;

Data SimioHoursRegression;
Input BrightBox	Service_Panel_Upgrade Number_Inverters Number_Panels Number_Employee_Days Standard_Install_Hours Additional_SOW_Hours;
Datalines = '/folders/myfolders/simiohours.sas7bdat'
;

Proc Reg; Model Standard_Install_Hours= BrightBox Service_Panel_Upgrade Number_Inverters Number_Panels Number_Employee_Days	Additional_SOW_Hours;
Run;
2 REPLIES 2
Reeza
Super User

Add some comments to your code so we understand what you're trying to accomplish in each step. 

 

The code doesn't make sense, so without knowing what you're trying to do, I can make a guess on how to change it.


You  can find examples at Video.sas.com > How To Tutorials> Analytics U has an example of how to perform a regression analysis. 

 

The problematic portions of your code are below. 

 

The data step doesn't make sense, you don't refer to a SAS data set like that so I"m not sure what you're trying to do with this step at all. 

 

For the regression you don't have a DATA= statement which would tell SAS what data set to use for the regression

 

Data SimioHoursRegression;
Input BrightBox	Service_Panel_Upgrade Number_Inverters Number_Panels Number_Employee_Days Standard_Install_Hours Additional_SOW_Hours;
Datalines = '/folders/myfolders/simiohours.sas7bdat'
;

I think your regression should be:

Proc Reg DATA = perm.simiohours;
Model Standard_Install_Hours= BrightBox Service_Panel_Upgrade Number_Inverters Number_Panels Number_Employee_Days	Additional_SOW_Hours;
Run;
taggerung
Calcite | Level 5

That and getting rid of the Input statement got the same regression and no errors. Thanks a ton!

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!

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
  • 2 replies
  • 1815 views
  • 2 likes
  • 2 in conversation