BookmarkSubscribeRSS Feed
Bogdan
Calcite | Level 5

Would you recommend naming the matrix through use/read/close same name as the dataset or different name?

(and conversely from IML matrix to a table)

Using the same name might lead to confusion; also, is there any possible such interference? 

On the other hand, using different names at same point looks like clutter.

1 REPLY 1
Rick_SAS
SAS Super FREQ

There is no conflict, so you can do whichever you prefer.

For me, it varies. If there is a correlation matrix in a data set named CORR, I might read it into a matrix of the same name.

If the data set is named MyCorrelationMatrix, I'll probably just read it into S.

Most real data sets have both character and numeric variables, so you can't read all variables into a single matrix. For example: the sashelp.class data set contains a SEX and a NAME variable (both character), so if I want to read the numeric variables I might just say:

use sashelp.class;

read all var _num_ into X;

close sashelp.class;

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
  • 1 reply
  • 794 views
  • 3 likes
  • 2 in conversation