BookmarkSubscribeRSS Feed
astudent
Fluorite | Level 6

I have a dataset of 4 independent categorical variables and 1 independent continous variable. I am very new to both SAS and statistics. I am trying to do a polycholic correlation using proc corr statement. the polycholic correlation table is coming out empty. I am trying to determine the effect of the independent variables on the dependent variable. I am looking for insights on how to do this. Here is my code:

PROC CORR data=Home.BaselineCH OUTPLC=home.polyCorr ;

var S1Q2 HEI2010_TOTAL_SCORE;

run;

 

output:

2 Variables:

S1Q2 HEI2010_TOTAL_SCORE

 

Polychoric Correlations

Variable

With Variable

N

Correlation

Wald Test

LR Test

Standard
Error

Chi-Square

Pr > ChiSq

Chi-Square

Pr > ChiSq

S1Q2

HEI2010_TOTAL_SCORE

174

.

.

.

.

.

.

 

4 REPLIES 4
PaigeMiller
Diamond | Level 26

Do you mean "polychoric" correlation?

 

Your description of the problem mentions "4 independent categorical variables and 1 independent continous [sic] variable" and later you talk about a dependent variable, which hasn't been mentioned. And you show us a SAS output with just two variables. Could you please clarify?

--
Paige Miller
astudent
Fluorite | Level 6
My apologies for the confusion. it is 4 independent categorical variables and 1 dependent continous variable
ballardw
Super User

Show your log. Copy the code and all the notes, warnings or messages from running the code. On the forum open a text box using the </> icon that appears above the message window and paste the text. The text box is to preserve formatting of any diagnostic messages that might appear.

 

Or show us the result of running this code:

Proc freq data=home.baselinech;
   tables s1q2*hei2010_total_score/ list missing;
run;

Or share your data.

If you don't have at least 2 different values for each variable the polychoric can't be calculated. Which would be seen in the LOG

with a message like

WARNING: The number of groups for variable <variable name> is less than 2, the affected polychoric correlations are set to missing.

 

astudent
Fluorite | Level 6

Here is my code

PROC CORR data=Home.BaselineCH OUTPLC=home.polyCorr;

with HEI2010_TOTAL_SCORE;

var S1Q2;

run;

and this is the my log

<418  PROC CORR data=Home.BaselineCH OUTPLC=home.polyCorr nomiss;

419  with HEI2010_TOTAL_SCORE;

420  var S1Q2;

421  run;

 

WARNING: The number of groups for variable HEI2010_TOTAL_SCORE is greater than 20, the number in the

         NGROUPS= option, the affected polychoric correlations are set to missing.

NOTE: The data set HOME.POLYCORR has 4 observations and 3 variables.

NOTE: PROCEDURE CORR used (Total process time):

      real time           0.08 seconds

      cpu time            0.06 seconds>

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1016 views
  • 0 likes
  • 3 in conversation