*computation of some network variables. *please check and adjust to your own purposes. *IMPORTANT: use the help function of SPSS if you have problems with understanding some comments. *how many empty fields?. *calculation of string length. COMPUTE co1_stri_len = LENGTH(RTRIM(eam)) . COMPUTE co2_stri_len = LENGTH(RTRIM(ebm)) . COMPUTE co3_stri_len = LENGTH(RTRIM(ecm)) . COMPUTE co4_stri_len = LENGTH(RTRIM(edm)) . COMPUTE co5_stri_len = LENGTH(RTRIM(eem)) . EXECUTE . *count how often string length=0. COUNT no_advice_contact = co1_stri_len co2_stri_len co3_stri_len co4_stri_len co5_stri_len (0) . VARIABLE LABELS no_advice_contact 'number of empty name generators' . EXECUTE . COMPUTE net_size_without_ego = 5 - no_advice_contact . EXECUTE . compute net_size=net_size_without_ego+1. COMPUTE possible_ties = (net_size * (net_size - 1) )/ 2 . EXECUTE . *count number of ties in the ego network. COUNT nr_ties = en1 en2 en3 en4 en5 en6 en7 en8 en9 en10 (2 3) . VARIABLE LABELS nr_ties 'number of ties in the network' . EXECUTE . IF (possible_ties > 0) density_dich= (nr_ties + net_size_without_ego) / possible_ties. EXECUTE. *some respondents didn't fill in the inter-alter-response matrix correctly. *they have to be left out. USE ALL. COMPUTE filter_$=(density_dich <= 1). VARIABLE LABEL filter_$ 'density_dich <= 1 (FILTER)'. VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'. FORMAT filter_$ (f1.0). FILTER BY filter_$. EXECUTE. RECODE net_size (0=1) (1 thru Highest=0) (ELSE=SYSMIS) INTO miss_total_net . VARIABLE LABELS miss_total_net 'no name generator at all filled in'. EXECUTE .