Stata 15 help for parse_dissim


[MV] parse_dissim -- Parse similarity and dissimilarity measures


parse_dissim [measure] [, default(default_measure) ]


parse_dissim takes the similarity or dissimilarity name found in measure and checks it against the list of those provided by Stata, taking account of allowed minimal abbreviations and aliases. Aliases are resolved (for instance, Euclidean is changed into the equivalent L2). The resolved name and other information about the measure is returned in s() (see below). An error message is produced and return code 198 is returned if measure is not one of the allowed similarity and dissimilarity measures. See [MV] measure_option for a listing of allowed similarity and dissimilarity measures and their definitions.


default(default_measure) specifies the default similarity or dissimilarity measure when measure is not specified. The default for default() is L2 (alias Euclidean distance). See [MV] measure_option for a list of allowed measures.


Within a program

... parse_dissim `sim' local sim "`s(dist)'" if "`s(dtype)'" != "similarity" | "`s(binary)'" != "binary" { di as error "only binary similarity measures are allowed" exit 198 } ...

Stored results

parse_dissim stores the following in s():

Macros s(dist) (dis)similarity measure name unabbreviated and with aliases resolved s(unab) (dis)similarity measure name unabbreviated but without aliases resolved s(darg) argument (enclosed in parentheses) of (dis)similarities that take them, such as L(#) s(dtype) the word similarity or dissimilarity s(drange) range of measure (most similar to most dissimilar); a dot means infinity s(binary) the word binary if the measure is for binary observations

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index