BookmarkSubscribeRSS Feed
TomiKong
Fluorite | Level 6

Hi all,

http://www.unc.edu/~arellis/socnet/bcent.sas

I found this macro from the internet. I'm sure its functionality is what I want, but I know know how to use it.If I have one matrix data like this:

data have;

input a b c d e $;

datalines;

1 1 0 0 0

1 0 1 0 0

0 1 1 0 1

0 0 0 0 0

0 0 1 0 0

;

run;

How to use this macto?

Thanks.

Tom

3 REPLIES 3
Rick_SAS
SAS Super FREQ

proc iml;

%inc "bcent.sas";

use have;

read all var _NUM_ into m;

close have;

directed=1;

normalize=1;

bc=bcent(m,directed,normalize);

print bc;

TomiKong
Fluorite | Level 6

Hi Rick,

It works. Thanks.

By the way, Can I save bc in one column in one dataset? Thank.

Tom

Rick_SAS
SAS Super FREQ

create outdata var {bc}; append; close outdata;

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
  • 3 replies
  • 880 views
  • 0 likes
  • 2 in conversation