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

Hi all,

I have a data whose number of variables is over 1,000.

Since the number of variables is too large to process the analysis that I am going to use,

me and my collage decided to reduce the number of variables using correlations.

We already created the correlations between the variables and extract some parts of the data (which have 0.8 or greater correlation)

and created a table which only have the pairs of the variables.

The data that I currently have looks like..

x   y

2   1

3   1

5   1

6   2

1   2

7   2

5   2

3   2

1   3

2   3

8   3

......

But it is hard to see which variables are paired up with this data( due to the large number of observation)

I want to create a table which looks like

group   pair1   pair2   pair3 pair4  ....

1           2         3        5     .   

2           6         7       5       3

3           8        .      .          .

.....

which shows us which variables are paired up more clearly.

But I do not have any idea how to start it.

Can anyone give me some advice?

Thank you for your help in advance.

There are over 700,000 observations in this data

1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

This should do it :

proc sort data=pairs; by x y; run;

data pairList;
length group 8;
array pair{100};
do i=1 by 1 until(last.x);
     set pairs; by x;
     group=x;
     pair{i} = y;
     end;
drop i x y;
run;

PG

PG

View solution in original post

2 REPLIES 2
PGStats
Opal | Level 21

This should do it :

proc sort data=pairs; by x y; run;

data pairList;
length group 8;
array pair{100};
do i=1 by 1 until(last.x);
     set pairs; by x;
     group=x;
     pair{i} = y;
     end;
drop i x y;
run;

PG

PG
jhhuh
Calcite | Level 5

Thank you so much!

I works really well!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to choose a machine learning algorithm

Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 914 views
  • 0 likes
  • 2 in conversation