Hi, so on to my explanation. I'm trying to use proc corr (on any other correlation procedure) that I can correlated subcolumns within columns. This is a 2 PART question.
Part 1 :The data I have is as below and I'm trying to transpose it so it looks like WANT..
HAVE:
Metric1 Metric2 Metric3
COL1 SCol1 Group1
COL1 SCol2 Group1
COL1 SCol3 Group1
COL1 SCol4 Group1
COL2 SCol5 Group1
COL2 SCol6 Group1
COL2 SCol7 Group1
COL2 SCol8 Group1
COL1 SCol1 Group2
COL1 SCol2 Group2
COL1 SCol3 Group2
COL1 SCol4 Group2
COL2 SCol5 Group2
COL2 SCol6 Group2
COL2 SCol7 Group2
COL2 SCol8 Group2
WANT:
COL1 COL2
SCol1 SCol2 SCol3 Scol4 SCol5 SCol6 SCol7 SCol8
Group1 Metric1
Group1 Metric2
Group1 Metric3
Group2 Metric1
Group2 Metric2
Group2 Metric3
Part 2 of this problem is that I would like to correlate the SCol's within each COL only. So for example only the SCol1-SCol4 would correlate, and same for SCol5-SCol8, as per their respective COL's. thanks
I don't understand what you are trying to do. Please some example data showing that the data initially looks like, how you want it to look, and what exactly has to be correlated with what.
Ok, I'll try to simplify it a little:
HAVE:
UN_rt / Price
TO SC Model1 6.7 34.56
TO SC Model2 6.4 56.77
TO NY Model1 6.4 56.77
TO NY Model2 6.4 51.47
TO ET Model1 6.2 12.54
TO ET Model2 6.8 10.54
OTT KN Model1 7.3 37.45
OTT KN Model2 7.3 39.14
OTT VN Model1 7.4 55.76
OTT VN Model2 7.6 58.76
OTT PK Model1 7.1 11.65
OTT PK Model2 7.2 15.67
WANT:
TO OTT
SC NY ET KN VN PK
Model1 UN_rt 6.7 6.4 6.2 7.3 7.4 7.1
Model2 UN_rt 6.4 6.4 6.8 7.3 7.6 7.2
Model1 Price 34.56 56.77 12.54 37.45 55.76 11.65
Model2 Price 56.77 51.47 10.54 39.14 58.76 15.67
Part 2, I want to correlate the subgroups (SC, NY and ET) within TO if there are any corrlations. And same within the OTT group.
As an example, something like :
Group1 (SC+NY)
Group2 (ET)
Group3 (KN+PK)
Group4 (VN)
That looks like a transpose rather than correlation? Or is there something that needs to be calculated somwhere that I'm missing.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.