igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[igraph] Fwd: triad.census(): negative 003 counts


From: Gábor Csárdi
Subject: [igraph] Fwd: triad.census(): negative 003 counts
Date: Wed, 28 May 2014 23:10:31 +0200

For the archives.


---------- Forwarded message ----------
From: Gábor Csárdi <address@hidden>
Date: Wed, May 28, 2014 at 11:09 PM
Subject: Re: [igraph] triad.census(): negative 003 counts
To: "Wagner, Stefan" <address@hidden>


Hi Stefan,

this is simply an integer overflow. The number of 003 triads is bigger than what we can represent in an integer on the computer (using the default 'int' data type).

You can simply calculate the result as the difference of all triads and the rest of the triad census counts.

Of course this is still a bug in igraph, we'll fix it or at least give a warning:
https://github.com/igraph/igraph/issues/625

Best,
Gabor


On Wed, May 28, 2014 at 10:07 PM, Wagner, Stefan <address@hidden> wrote:

Dear Gabor,

thank you very much for your fast reply to my post on the igraph newslist.

 

Attached to this email you find one STATA file that contains the basic information I am using to draw a graph. Relevant are the contained names in the list CTNG_hrm_level1 and CITED_hrm_level1 which are the nodes. Edges exist if refs_XY_AB is greater than 0.

 

I have about 900 files similar to this one. I get negative 003-counts for many of them. In case I made a basic coding mistake my apologies in advance. I am a long-time STATA user and this is my first time using R…

 

Setup: I am running R3.0.2 and control it via RStudio under windows 7. I can replicate the findings on Windows 7 32 bit as well as Windows 64 bit.

 

The code I am running is also attached. The attached code cycles through all my 900 files. For the attached file you can use this:

 

infile = paste("list_","1","_","1982",".dta", sep = "")

 

# read file into dataframe

data <- read.dta(infile)

 

# keep only edges based on XY refs

data_frame <- subset(data, refs_XY_AB > 0 )

 

# prepare edge attributes

edge_attributes = c("CTNG_hrm_level1", "CITED_hrm_level1", "refs_XY_AB")

 

network_data = data_frame[edge_attributes]

 

# creating the graph

network_graph <- graph.data.frame(network_data, dir=TRUE)

 

tc <- triad.census(network_graph)

 

tc

 

Thanks for your help. If you need more information please let me know.

 

Best,

 

Stefan

 

 

Stefan Wagner

TUSIAD/TCCI Chair in European Economic Integration

Associate Professor

ESMT European School of Management and Technology

Schlossplatz 1

10178 Berlin

Germany

Phone: +49 30 21231- 1537

Email: address@hidden

====================================================
cid:image001.png@01CF58C9.175C9D10cid:image002.png@01CF58C9.175C9D10 cid:image003.png@01CF58C9.175C9D10 cid:image004.png@01CF58C9.175C9D10 cid:image005.png@01CF58C9.175C9D10 cid:image006.png@01CF58C9.175C9D10 cid:image007.png@01CF58C9.175C9D10 cid:image008.png@01CF58C9.175C9D10 cid:image009.png@01CF58C9.175C9D10 cid:image010.png@01CF58C9.175C9D10 cid:image011.png@01CF58C9.175C9D10

 

ESMT. The business school founded by business.
====================================================

ESMT European School of Management and Technology GmbH: Vorsitzender des Aufsichtsrats (Chairman of the Supervisory Board): Prof. Dr. Clemens Börsig

Geschäftsführung (Managing Directors): Prof. Jörg Rocholl, PhD (President), Georg Garlichs (CFO)

Sitz der Gesellschaft (Registered Office): Berlin

Registergericht (Register Court): Berlin Charlottenburg, HRB 87005

 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]