BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Rcore
Calcite | Level 5

This message occurs when I use an output data set (SpearmanCorr) in proc corr.

I would like to remove these notes;

15354:NOTE: Invalid numeric data, '<.0001' , at line 101090 column 212.

15355:NOTE: Invalid numeric data, '_' , at line 101090 column 11.

My code looks like this;

ods output SpearmanCorr=mycorrpvalue;

proc corr spearman data=mydata ;

var myvariable;

run;

data new;

set mycorrpvalue;

if myvariable='<.0001' then myvariable=0.0001;

if myvariable='_' then myvariable=.;

if 0<myvariable<0.001 then newvar=0.001;

else newvar=.;

run;

This is because the data set mycorrpvalue contains numbers and characters, '<.0001' and '_'.

How can I totally replace these characters with number?

Sincerely,

Nish

1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
Opal | Level 21

The data does not actually contain characters.  In ODS output data sets, p-values typically are numeric, but have a format applied.  (Running a PROC CONTENTS on MYCORPVALUE will reveal that.)  You can remove the format with:

data new;

set mycorpvalue;

format myvariable;

run;

Good luck.

View solution in original post

5 REPLIES 5
Astounding
Opal | Level 21

The data does not actually contain characters.  In ODS output data sets, p-values typically are numeric, but have a format applied.  (Running a PROC CONTENTS on MYCORPVALUE will reveal that.)  You can remove the format with:

data new;

set mycorpvalue;

format myvariable;

run;

Good luck.

Rcore
Calcite | Level 5

It worked!  Thank you very much!

Ksharp
Super User

There are must be some missing value or very small value .

Try round() function to reform your data.

Rcore
Calcite | Level 5

Yes, the myvariable had a format.

  #Variable     TypeLenFormat

1myvariable  Num   8PVALUE8.4

I could remove it using;

data new;

set mycorpvalue;

format myvariable;

run;

Thank you for your answer!

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 883 views
  • 3 likes
  • 4 in conversation