{smcl} {* 15Apr2004}{...} {hline} help for {hi:Scompute} {hline} {title:Calculates similarity scores between States using {it:S}} {p 8 15}{cmd:scompute} {it:actor_A actor_B}, {cmd:id}(varname) {cmd:svar}(varname(s)) [{cmd:weightvar}(varname(s)) {cmd:newfile}(filename){p_end} {p 15 23} {cmd: dropmiss}(string) {cmd:uwb} {cmd: combine}]{p_end} {title:Description} {p 0 4 4}{cmd:scompute} computes the similarity scores ({it:S}) between two actors at time {it:t} using {it:S} as described in Signorino & Ritter (1999). {title:Special Note} {p} The data must be in directed dyad format, with the inclusion of {it:i vs i} dyad in order to use the program. Thus, there has to be entries {it: i vs i}, {it: i vs j} and {it: j vs i}. {title:Options} {p} {cmd:id} is the period variable to be used to calculate {it:S} values. Typically, this will be a year variable. Of course any other user specified indicator variable is acceptable. {p_end} {p}{cmd:svar} is the variable(s) for which similarity scores are to be computed. For example, alliance and/or IGO.{p_end} {p}{cmd:weightvar} is any variable the user wishes to use to weight the similarity scores. If not specified, uniform weights are used. Note that if more than one svar is specified along with this option, then the number of weight variables specified must equal number of svars specified. In the case of more than one svar variable, this option allows the user to specify user specified weights as well as the default uniform weights. The convention for uniform weights is to specify na or nb. The different specifications depend on how the user wants the uniform weights to be generated in the presence of missing observations, see section {it:Dealing with Missing Values} below. {p_end} {p} {cmd:newfile} saves the computed scores to a file specified by user. If this option is not specified, program saves results in a file called S_{it:svar(s)}_computed.{p_end} {p} {cmd: dropmiss} specifies if the user wants the program to calculate {it:S} for missing observations. See section {it:Dealing with Missing Values} below for how to specify this option. {p_end} {p} {cmd: uwb} this option can only be specified if user is using uniform weights (i.e., program generated weights). See section {it:Dealing with Missing Values} below for what this option does.{p_end} {p} {cmd: combine} this option can only be specified if more than one svar is being calculated. If this option is specified, all calculated {it:S} scores are combined into an overall {it:S} score. {title: Dealing with Missing Values} {p} The program has several options for dealing with missing values in the svar(s) specified.{p_end} {p}First, it is assumed that the user specified weights have no missing values. If the user specified weights have missing values the program uses listwise deletion (the default in Stata) to make the calculations.{p_end} {p} Second, if there are missing values for certain observations of the svar(s) specified, the user has several options to choose from: one set of options deals with how to generate the uniform weight in the presence of missing observations, the other set of options deals with which observations to generate {it:S} scores for in the presence of missing observations. {p_end} {p 4 4 4} {bf:Options relating to the generation of uniform weights:} One group of options users have, in the presence of missing observations, is how uniform weights should be generated. The default action in the program is to generate uniform weights based on the number of observations that are not missing. So, for any foreign policy portfolio between two states containing five observations, if one observation is missing, the uniform weights are generated based on the four non-missing observations, i.e., each weight will equal .25. If the user does not want this, the user can specify the uwb. This options forces the program to generate uniform weights based on the total number of observations in the foreign policy portfolio between two states, irrespective of the number of missing observations. So using the example above, the uniform weights generated would be equal to .2. Note, if more than one svar is specified and no user weights are specified, than the {cmd: uwb} can be used. Otherwise, if more than one svar is specified along with some user specified weights, the {cmd: uwb} cannot be used. Instead, the {cmd: weightvar} option must be specified and for uniform weights the user has to specify {it:na}, for the default option, discussed above, or {it:nb} for the option equivalent to the {cmd: uwb} option.{p_end} {p 4 4 4} {bf: Options relating to the calculation of S scores in the presence of missing observations:} A second group of options users have, in the presence of missing observations, is whether calculations of {it:S} for missing observations should actually be generated. The default is to use the equivalent of listwise deletion in the calculation of missing observations. That is, the non-missing observations are used to calculate the {it:S} score. However, if for theoretical reasons a user does not want to do this (see Sweeney and Keshk 2004), he can specify the {cmd: dropmiss} option with either {it:dyadic} or {it:yes}. Dyadic does not allow {it:S} scores to be calculated for dyads that have missing values. For example, if we have five states and a dyad has a missing observation on the foreign policy preference measure, no {it:S} value is calculated for that dyad. The other option ({it:yes})on the other hand is what we call the Hiroshima option. If the user specifies this option, no {it:S} score is calculated for any dyadic pairs that have missing observations. Thus, if one of the states has a missing observation on one of the variables every possible dyad in which this states appears does not have an {it:S} score calculated. Needless to say this option is devastating and it is possible that no {it:S} scores at all will be calculated. {title:Examples} {p 8 12}{inp:. scompute ccode1 ccode2, id(year) svar(alliance)}{p_end} {p 8 12}{inp:. scompute state_a state_b, id(year) svar(alliance igo) weight(cow_cap)}{p_end} {p 8 12}{inp:. scompute cnta cntb, id(year) svar(alliance igo) weight(cow_cap na) newfile(myscompute)}{p_end} {p 8 12}{inp:. scompute actor_a actor_b, id(year) svar(alliance igo mids pta) weight(cow_cap na nb cow_cap) newfile(myscompute) combine}{p_end} {p 8 12}{inp:. scompute ccode1 ccode2, id(year) svar(alliance) dropmiss(dyadic)}{p_end} {title:References} Signorino, Curtis S., and Jeffrey M. Ritter. 1999. Tau-b or not tau-b: Measuring the similarity of foreign policy positions. {it: International Studies Quarterly} 43:115-44. Sweeney, Kevin and Omar M.G. Keshk. The Similarity of States: A Multidimensional Indicator of Dyadic Interest Similarity. Paper Presented at the Midwest Political Science Assocation, April 15-18, 2004. {title:Authors} Omar M.G. Keshk and Kevin Sweeney The Ohio State University keshk.1@osu.edu Sweeney.101@osu.edu June 2003