Programming the statistical procedures from SAS

Problem with SAS software depot

Accepted Solution Solved
Reply
Contributor
Posts: 22
Accepted Solution

Problem with SAS software depot

1.jpg2.png


Accepted Solutions
Solution
‎05-08-2018 10:29 AM
Super User
Posts: 13,563

Re: Problem with SAS software depot

[ Edited ]
Posted in reply to michshoot

Proc Reg requires all variables on the MODEL statement to be numeric. You show variable REPARTO on the model statement and it is obviously not numeric.

The viewtable image of Ora_Analizi and  ID_paziente appearing left justified likely means that they are character variables. ID numbers are very poor candidate variables in Proc Reg models even if numeric as likely the only thing I would expect is newer ID values are larger than older for any given source sequence.

 

I am going to guess that you are running code against a data set generated using PROC IMPORT.

Proc Import has to guess what type a variable is. Just because you think it should be a number does not mean that the guessing rules involved will match. Things like blank rows or how the data was entered in the file can affect how import treats the values.

 

Run Proc contents on the input data set and examine the variable types for all of the variables you are having issues with. I suspect they will appear as CHAR. At which point you will have to back to the source of the data and regenerate it so that the variable types are as expected.

 

Often when we see this the data started in a spreadsheet and insufficient attention was paid when the data was brought into SAS that variable types were correct.

View solution in original post


All Replies
Valued Guide
Posts: 534

Re: Problem with SAS software depot

Posted in reply to michshoot

Oh, where to start! This is just not the way to ask for help. Could you make an effort and describe what you have, what you're expecting and put that in the form of a question? And make it text instead of image so others can copy/paste and add suggestions?

 

And how does your picture relate to issues with a software depot as the title suggests?

 

Cheers,

- Jan.

Contributor
Posts: 22

problem sas import !!

Posted in reply to michshoot

hello everyone in the topic below I put images, my problem that does not read the variables variables as numerical variables are those in red in the log.
thank you

Super User
Posts: 10,269

Re: problem sas import !!

Posted in reply to michshoot

CODE, LOG AND DATA IN TEXT FORM!

 

PLEASE.

 

See my footnotes for help how to post these.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Solution
‎05-08-2018 10:29 AM
Super User
Posts: 13,563

Re: Problem with SAS software depot

[ Edited ]
Posted in reply to michshoot

Proc Reg requires all variables on the MODEL statement to be numeric. You show variable REPARTO on the model statement and it is obviously not numeric.

The viewtable image of Ora_Analizi and  ID_paziente appearing left justified likely means that they are character variables. ID numbers are very poor candidate variables in Proc Reg models even if numeric as likely the only thing I would expect is newer ID values are larger than older for any given source sequence.

 

I am going to guess that you are running code against a data set generated using PROC IMPORT.

Proc Import has to guess what type a variable is. Just because you think it should be a number does not mean that the guessing rules involved will match. Things like blank rows or how the data was entered in the file can affect how import treats the values.

 

Run Proc contents on the input data set and examine the variable types for all of the variables you are having issues with. I suspect they will appear as CHAR. At which point you will have to back to the source of the data and regenerate it so that the variable types are as expected.

 

Often when we see this the data started in a spreadsheet and insufficient attention was paid when the data was brought into SAS that variable types were correct.

☑ This topic is solved.

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

Discussion stats
  • 4 replies
  • 119 views
  • 0 likes
  • 4 in conversation