Programming the statistical procedures from SAS

Set non-significant correlation to zero when output to dataset?

Reply
N/A
Posts: 1

Set non-significant correlation to zero when output to dataset?

Hi guys,

Use proc corr we can produce correlation matrix, but some pairwise correlations are not significant. Is there any way to set non-significant correlations to 0 in the matrix?

Thanks,
Super User
Posts: 9,769

Re: Set non-significant correlation to zero when output to dataset?

Hi.
Maybe you need 'ods output' to write the result into a dataset.then use data step to set zero.


[pre]
ods trace on;
ods output pearsoncorr=corr;
proc corr data=sashelp.class;
var weight height;
run;
ods output close;
ods trace off;
[/pre]



Ksharp
Frequent Contributor
Posts: 140

Re: Set non-significant correlation to zero when output to dataset?

> Hi guys,
>
> Use proc corr we can produce correlation matrix, but
> some pairwise correlations are not significant. Is
> there any way to set non-significant correlations to
> 0 in the matrix?
>
> Thanks,

Why would you wish to do this? Perhaps there is a good reason, but I cannot think of one. If a correlation is not significant, it does NOT mean it is 0. Creating a matrix where nonsignificant correlations are reported as 0 is .... well, it's distorting your data. It seems to be to be equivalent to any other method of changing results. Not good.

Peter
Ask a Question
Discussion stats
  • 2 replies
  • 132 views
  • 0 likes
  • 3 in conversation