Losing other variables when declaring network data

201 views
Skip to first unread message

Hoorig Santikian

unread,
Jan 20, 2016, 6:32:51 PM1/20/16
to nwcommands
I have figured out how to declare my data a network. However, when I do this I loose other variables like tie strength and frequency of interaction. I have read that others also have a similar challenge. Is there a way to keep these variables in the network data set? If so, is there sample code that other users can forward that shows how to do this?

Hoorig Santikian

unread,
Jan 25, 2016, 5:49:34 PM1/25/16
to nwcommands
Just wanted to share sample code in case its helpful to understand my question.

Here is my code: 

use "/home/hoori/CAC NYC.dta", clear
drop if School==""


*** Set as directed network by case using all observations identifying school-based staff  
** UNHS network with all data 
keep if School=="UNHS" 
nwset ID EdgeID, edgelist directed keeporiginal name(UNHS1)
nwsummarize UNHS1, detail 
nwsave UNHS1, replace
nwplot UNHS1, label(_nodeoriginal) title("Union High School Full Network Map") 


The problem is, the data set "/home/hoori/NYC.dta" is constructed with each tie as one row as follows: 

ID Name School ActorAge ActorTenure ActorDepartment ActorFunction EdgeID EdgeName EdgeDepartment EdgeFunction Strength Frequency 

When I transform the data to network data using nwset, I lose the variables ActorAge ActorTenure ActorDepartment ActorFunction EdgeDepartment EdgeFunction Strength Frequency. Is there a way to keep those so I can then do some analysis using these variables, such as color code nodes based on their department?
Reply all
Reply to author
Forward
0 new messages