[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
"Nick Cox" <n.j.cox@durham.ac.uk> |

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

Subject |
st: RE: Creating a Non-Self Mean & Proportions |

Date |
Mon, 29 Jun 2009 21:30:24 +0100 |

A meta-question here is why no one has replied to this since it was posted. An answer to that is that trying to work out what is wanted requires too much effort. Why not give an example of your data? Why make everyone try to imagine what you have? Anyway, my guesses are: 1. You have a long data structure with personal id (say -id-) and stratum id (say -stratum-). (One stratum, several strata.) 2. You have a variable (say -score-) with values 0,1,2. (What that variable represents, how many negative attitudes the others in the stratum have, it seems, is not important here.) 3. You want to summarize the fractions of 0, 1, 2 in each stratum. If these guesses are all correct, then one answer is bysort stratum score : gen freq = _N by stratum: gen total = freq / _N You may also want to -collapse- the data. If these guesses are wrong, you may need to try again with more information. Nick n.j.cox@durham.ac.uk Emmanuel Koku I have created a summed scale of 2 dichotomous items coded originally 0 1. The new variable now has values ranging from 0 to 2. Since I am using a survey that I want to create summary measures like non-self mean or non-self proportions that represent other members of the respondents strata but excluding the respondent. Eg. I would want to know the proportion of the respondents strata who hold no negative attitudes - ie 0 in the summed scale; the proportion who hold only one of the negative attitudes, ie, 1 in the summed scale as well as those members of the strata who hold both negative values or 2 in the summed scale. Through help received here and from a statafaq article, i have been able to create similar summary measures for dichotomous items, but i'm stumped with this 3-category variable, and would appreciate any assistance. * * 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/

**Follow-Ups**:**Re: st: RE: Creating a Non-Self Mean & Proportions***From:*Emmanuel Koku <emmanuelkoku@gmail.com>

**References**:**st: Creating a Non-Self Mean & Proportions***From:*Emmanuel Koku <emmanuelkoku@gmail.com>

- Prev by Date:
**st: RE: RE: generate an error message if the wrong number of args is given following the args command** - Next by Date:
**RE: st: RE: Stata 11 Announcement** - Previous by thread:
**st: Creating a Non-Self Mean & Proportions** - Next by thread:
**Re: st: RE: Creating a Non-Self Mean & Proportions** - Index(es):

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