Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Programming
- /
- SAS Procedures
- /
- proc corr p-values not showing and Pearson output missing

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 12-08-2017 02:19 PM
(3960 views)

I recently used the spearman and noprob options in a proc corr statement. Now when I use proc corr for other data without those options, SAS will not give me p-values in the results and only runs Spearman correlations instead of Pearson correlations. Is there a way to reverse these options? It appears that using them once permanently affected my SAS output.

9 REPLIES 9

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hi,

Something like this?

Without probability

proc corr data=sashelp.cars spearman noprob;

var horsepower mpg_highway;

run;

With probability

proc corr data=sashelp.cars spearman;

var horsepower mpg_highway;

run;

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

I don't think noprob is a system option. If this is a system options then it will affect subsequent analysis.

proc options;

run;

and this works for new data as well.

New data - With probability

proc corr data=sashelp.class spearman;

var height weight;

run;

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

This is a new sas session. That is why im confused and thought it might be a system option.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Without seeing your log, no one can help you.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Show the code and any messages from the log that does not create the desired output.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

**proc** **phreg** data = fram;

model timemi*hospmi(**0**) = diabetes;

output out = residuals2 ressch = sh_diabetes;

**run**;

**data** failures2;

set residuals2;

where hospmi = **1**;

**run**;

**proc** **rank** data = failures2 out = ranked2 ties = mean;

var timemi;

ranks timerank;

**run**;

**proc** **corr** data = ranked2 pearson nosimple;

with timerank;

var sh_diabetes;

**run**;

22 proc phreg data = fram;

23 model timemi*hospmi(0) = diabetes;

24 output out = residuals2 ressch = sh_diabetes;

25 run;

NOTE: Convergence criterion (GCONV=1E-8) satisfied.

NOTE: The data set WORK.RESIDUALS2 has 4240 observations and 40

variables.

NOTE: PROCEDURE PHREG used (Total process time):

real time 0.59 seconds

cpu time 0.18 seconds

26 data failures2;

27 set residuals2;

28 where hospmi = 1;

29 run;

NOTE: There were 363 observations read from the data set WORK.RESIDUALS2.

WHERE hospmi=1;

NOTE: The data set WORK.FAILURES2 has 363 observations and 40 variables.

NOTE: DATA statement used (Total process time):

real time 0.04 seconds

cpu time 0.00 seconds

30 proc rank data = failures2 out = ranked2 ties = mean;

31 var timemi;

32 ranks timerank;

33 run;

NOTE: The data set WORK.RANKED2 has 363 observations and 41 variables.

NOTE: PROCEDURE RANK used (Total process time):

real time 0.17 seconds

cpu time 0.00 seconds

34 proc corr data = ranked2 pearson nosimple;

35 with timerank;

36 var sh_diabetes;

37 run;

NOTE: PROCEDURE CORR used (Total process time):

real time 0.04 seconds

cpu time 0.01 seconds

the output gives a correlation but no p-value underneath

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

I wonder if you are using a modified template.

```
proc template;
list base.corr.StackedMatrix;
list common.StackedMatrix;
source base.corr.StackedMatrix;
source base.corr.StackedMatrix;
quit;
```

Does your log look something like this? Are the templates coming from sashelp? If not, submit those steps substituting delete for source and try again.

```
40 proc template;
41 list base.corr.StackedMatrix;
42 list common.StackedMatrix;
43 source base.corr.StackedMatrix;
define table Base.Corr.StackedMatrix;
notes "Default CORR stacked matrix";
column (RowName RowLabel) (Matrix) * (Matrix2) * (Matrix3) * (Matrix4);
translate _val_=._ into "";
define RowName;
varname = Variable;
parent = Common.Column.RowName;
end;
define RowLabel;
varname = Label;
parent = Common.Column.RowLabel;
end;
parent = common.stackedmatrix;
split_stack = OFF;
end;
NOTE: Path 'Base.Corr.StackedMatrix' is in: SASHELP.TMPLBASE (via SASHELP.TMPLMST).
44 source base.corr.StackedMatrix;
define table Base.Corr.StackedMatrix;
notes "Default CORR stacked matrix";
column (RowName RowLabel) (Matrix) * (Matrix2) * (Matrix3) * (Matrix4);
translate _val_=._ into "";
define RowName;
varname = Variable;
parent = Common.Column.RowName;
end;
define RowLabel;
varname = Label;
parent = Common.Column.RowLabel;
end;
parent = common.stackedmatrix;
split_stack = OFF;
end;
NOTE: Path 'Base.Corr.StackedMatrix' is in: SASHELP.TMPLBASE (via SASHELP.TMPLMST).
45 quit;
NOTE: PROCEDURE TEMPLATE used (Total process time):
real time 0.04 seconds
cpu time 0.03 seconds
```

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. **

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.