network bubble graph

Occasional Contributor
Posts: 12

network bubble graph

Hello, i want to plot a network bubble graph where the size of the bubble is proportional to the number of connections with other bubbles, is it feasible with SAS/Graph?  Thank you

Super Contributor
Posts: 543

Re: network bubble graph

Could you provide some sample data?

Here is a link to bubble plot:

SAS/GRAPH(R) 9.2: Reference, Second Edition

Anca.

Occasional Contributor
Posts: 12

Re: network bubble graph

we have five entities A, B, C, D and E.

A is connected to B, D and E.

B is connected to A, C, D and E.

C is connected to B

D is connected to A and B.

E is connected to A and B

I want to built a chart with five bubbles where the size of each bubble is proportional to the number of connected entities, so for example the size of bubble A is times bigger than the size of C bubble.

the above is an illustated example.

Thank you

Michel

Super Contributor
Posts: 543

Re: network bubble graph

So, from my limited understanding: one could use a bubble plot to display 3 variables in a scatterplot. The z dimension is presented by the circle.

The area or radius of the circle plotted is proportional to the value of the third variable.

You only provided Entity (a,b,c,d,e) and the number each is related to the other.

I am still confused

Posts: 5,541

Re: network bubble graph

You could build from the following code:

/*
A is connected to B, D and E.
B is connected to A, C, D and E.
C is connected to B
D is connected to A and B.
E is connected to A and B
*/

%let nbEnt=5;

data entities;
length entity \$1;
do i = 1 to &nbEnt;
entity = char("ABCDEFGHIJKLMNOPQRSTUVWXYZ",i);
x = cos((i-1)*2*constant("PI")/&nbEnt);
y = sin((i-1)*2*constant("PI")/&nbEnt);
output;
end;
drop i;
run;

length from to \$1;
input from \$ to \$ @@;
datalines;
A D A D A E
B A B C B D B E
C B
D A D B
E A E B
;

proc sql;
create table bGraph as
select entity, x, y, count(to) as size
from entities inner join links on entity=from
group by entity, x, y
outer union corr
select f.x as fromx, f.y as fromy, t.x as tox, t.y as toy
from
entities as f on f.entity=l.from inner join
entities as t on t.entity=l.to;
quit;

ods graphics / height=600 width=600;
proc sgplot data=bGraph noautolegend;
vector x=tox y=toy / xorigin=fromx yorigin=fromy noarrowheads;
bubble x=x y=y size=size / datalabel=entity;
xaxis display=none;
yaxis display=none;
run;

PG

PG
Occasional Contributor
Posts: 12

Re: network bubble graph

Thank you PG, very useful.

But the problem is that i have a bigger data in an excel sheet where the first column is the name of the entity, and on the same row, the name followed by names of entities connected to it. so the number of columns in each row is not the same.

Is it feasible automatically with less specifity??

Michel