BookmarkSubscribeRSS Feed
HN2001
Obsidian | Level 7

Hi,

 

I am using proc corr with the polyserial option.  A coworker and myself are both creating these tables and we are using the same data just sorted differently.  When we run the following, we produce different polyserial calculations.  Can anyone tell me if the order of the variables in "with" or "var" matter how the polyserial is calculated?

 

proc sort data=in_dat; by Gender; run;

proc corr data=in_dat outpls=out_dat noprint polyserial (ordinal=with); by Gender; with x; var y; run;

3 REPLIES 3
ballardw
Super User

I have a suspicion that there may be some importance to the order, especially if you reverse the variables in the WITH/VAR pair and get different results.

 

A hint form the documentation in Proc Corr about polyserial

 

Polyserial correlation measures the correlation between two continuous variables with a bivariate normal distribution, where one variable is observed directly, and the other is unobserved. Information about the unobserved variable is obtained through an observed ordinal variable that is derived from the unobserved variable by classifying its values into a finite set of discrete, ordered values (Olsson, Drasgow, and Dorans 1982).

So the "unobserved" , which ever it might be terms of WITH and VAR would be treated a bit differently in getting the estimate.

 

 

HN2001
Obsidian | Level 7
Let me clarify what I originally asked. I know we have the with and var variables correct. What I am asking is if the sort order of the variable in with and the sort order of the variable in var matters?

We are working with the same data just sorted differently and are producing different polyserial values and can't figure out why
ballardw
Super User

Show the different sort codes used and the proc corr.

Best would be to show it from the log with notes about records used.

 

I responded about the order of the With and Var pairing because your example code does not show any sort involving either of those two variables.

 

Since the example that you show is not sorting either of the With or Var variables and is using a BY statement then if you sort the data by different variables with different BY statements then I would be extremely surprised to see the same result for almost anything. And since you only show one "example" we really need to see the other to compare.

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 3 replies
  • 933 views
  • 0 likes
  • 2 in conversation