BookmarkSubscribeRSS Feed
trash
Fluorite | Level 6

I have this data set here were the first x is sales, x2=profits, and x3=assets. Measurements are in millions of dollars.

 

Company                   X1        X2         X3

General Motors    126,974  4,224  173,297
Ford                       96,933  3,835  160,893
Exxon                    86,656  3,510    83,219
IBM                        63,438  3,758   77,734
General Electric    55,264  3,939  128,344
Mobil                     50,976  1,809    39,080
Philip Morris          39,069  2,946    38,528
Chrysler                36,156     359    51,038
Du Pont                35,209   2,480    34,715

 

I need to import the data manually and then I am asked to manually find correlation matrix using only matrix manipulation. I assume I somehow I use proc IML. If so, I'd have to create 3 matrices, correct? I don't know where to start.

 

2 REPLIES 2
Reeza
Super User
You should review how correlation is calculated in your textbook. Then start by searching using ‘SAS IML Correlation’.  The answer is fully in the documentation.  http://support.sas.com/documentation/cdl/en/imlug/66845/HTML/default/viewer.htm#imlug_genstatexpls_s... As to separating the data into 3 matrices, if you review how to calculate correlation that should answer your question. 

@trash wrote:

I have this data set here were the first x is sales, x2=profits, and x3=assets. Measurements are in millions of dollars.

 

Company                   X1        X2         X3

General Motors    126,974  4,224  173,297
Ford                       96,933  3,835  160,893
Exxon                    86,656  3,510    83,219
IBM                        63,438  3,758   77,734
General Electric    55,264  3,939  128,344
Mobil                     50,976  1,809    39,080
Philip Morris          39,069  2,946    38,528
Chrysler                36,156     359    51,038
Du Pont                35,209   2,480    34,715

 

I need to import the data manually and then I am asked to manually find correlation matrix using only matrix manipulation. I assume I somehow I use proc IML. If so, I'd have to create 3 matrices, correct? I don't know where to start.

 


Rick_SAS
SAS Super FREQ

See the article "Compute covariance and correlation matrices," which shows the four steps that you need to perform to compute a correlation matrix from a data matrix. In particular, you do not need to form three matrices. The three variables become three columns in a single data matrix.

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!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 2 replies
  • 1024 views
  • 0 likes
  • 3 in conversation