Programming the statistical procedures from SAS

SAS says data contains no columns when using linear regression

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

SAS says data contains no columns when using linear regression

I'm new to SAS (using the university edition) and am having issues with using Linear Regression.

I loaded a CSV file and then in Tasks and Utilities > Tasks > Statistics > Linear Regression I selected WORK.BP (BP = filename) for my data. When I try to select my dependent variable SAS says "No columns are available."

The CVS file appears to have loaded correctly and has 2 columns so I can't figure out what the issue is.

 

Thanks for the help.

 

This is the code I used for loading the file:

 

data BP;
infile '/folders/myfolders/BP.csv' dlm =',' firstobs=2;
input BP  $Pressure$;
run;

 

And this is what the output looks like 


Accepted Solutions
Solution
‎03-07-2018 02:09 AM
Super User
Posts: 6,785

Re: SAS says data contains no columns when using linear regression

Remove the dollar signs from the INPUT statement.  They are making both of your variables character.  Since regression requires numeric variables, there are no variables that can be used for regression.  (Yes, there are cases where a character variable is used to create dummy variables, but that is not the case here.)

View solution in original post


All Replies
Solution
‎03-07-2018 02:09 AM
Super User
Posts: 6,785

Re: SAS says data contains no columns when using linear regression

Remove the dollar signs from the INPUT statement.  They are making both of your variables character.  Since regression requires numeric variables, there are no variables that can be used for regression.  (Yes, there are cases where a character variable is used to create dummy variables, but that is not the case here.)

New Contributor
Posts: 2

Re: SAS says data contains no columns when using linear regression

Posted in reply to Astounding

Thank you for the help!

Super User
Posts: 10,280

Re: SAS says data contains no columns when using linear regression

Remove the dollars from your input statement, so that the variables are created as numeric.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 111 views
  • 0 likes
  • 3 in conversation