Statistical programming, matrix languages, and more

Anyone know how to use this macro?

Reply
Contributor
Posts: 36

Anyone know how to use this macro?

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

SAS Super FREQ
Posts: 3,408

Re: Anyone know how to use this macro?

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;

Contributor
Posts: 36

Re: Anyone know how to use this macro?

Hi Rick,

It works. Thanks.

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

Tom

SAS Super FREQ
Posts: 3,408

Re: Anyone know how to use this macro?

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

Ask a Question
Discussion stats
  • 3 replies
  • 327 views
  • 0 likes
  • 2 in conversation