[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

From |
"Elkins, Zachary S" <zelkins@austin.utexas.edu> |

To |
"statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |

Subject |
RE: st: treatment of missing values in a matrix dissimilarity score |

Date |
Mon, 15 Sep 2008 17:34:13 -0500 |

Thanks to Nick, Eva, and Jay for very helpful responses to the below. Best, Zach ________________________________________ From: owner-statalist@hsphsun2.harvard.edu [owner-statalist@hsphsun2.harvard.edu] On Behalf Of Eva Poen [eva.poen@gmail.com] Sent: Monday, September 15, 2008 2:49 PM To: statalist@hsphsun2.harvard.edu Subject: Re: st: treatment of missing values in a matrix dissimilarity score Zach, Stata seems to do listwise deletion, which appears fair in this situation; it is not clear to me how comparable similarity measures would be between observations when they are calculated based on different sets of variables. You want to calculate similarities only across non-missing elements. I don't think there is an easy way to do this. One approach is to enlist the help of -mvpatterns- which you can locate using -findit-. -mvpatterns x1 x2 x3 x4- will tell you which patterns of missing values exist in your data. You can then run the -matrix dissimilarity- command separately for each pattern: matrix dissimilarity m1=x1 x3 if x2 >=. & x4 >=., match proportion for example, for all those observations that have x1 and x3 non-missing but x2 and x4 missing. Eva 2008/9/15 Elkins, Zachary S <zelkins@austin.utexas.edu>: > I'd like to calculate the matches between observations across a set of binary variables. I suspect that there are multiple ways to do this. I've specified: > > matrix dissimilarity m=x1 x2 x3 x4, match proportion > > However, some values in x1-x4 are missing. Based on the results, it appears that Stata treats missing values as if they were 1 and I don't see how to modify that. I'd like to calculate to calculate similarities across only non-missing elements (the number of which will be different for each pair, of course). > > Thanks for any help. > > Zach Elkins > > > ______________________________ > Zachary Elkins > Assistant Professor > Department of Government > University of Texas at Austin > 1 University Station A1800 > Austin, TX 78712-0119 > > p: (512) 232-7250 > f: (512) 471-1061 > > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/statalist/faq > * http://www.ats.ucla.edu/stat/stata/ > * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**References**:**st: treatment of missing values in a matrix dissimilarity score***From:*"Elkins, Zachary S" <zelkins@austin.utexas.edu>

**Re: st: treatment of missing values in a matrix dissimilarity score***From:*"Eva Poen" <eva.poen@gmail.com>

- Prev by Date:
**Re: st: Re: Comparing datasets** - Next by Date:
**st: Inverse Mills Ratio After Negative Binomial Regression Model** - Previous by thread:
**Re: st: treatment of missing values in a matrix dissimilarity score** - Next by thread:
**st: RE: treatment of missing values in a matrix dissimilarity score** - Index(es):

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