[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: Percent of time a |

Date |
Tue, 10 Feb 2009 20:23:42 -0000 |

I interpret this as meaning that you have time series data with regularly spaced observations. If that's not true, what follows will need modification. You need a weighted mean of an expression that would produce an indicator variable. David Kantor's _gwtmean function for -egen- from SSC will do that, but I don't know a command that will do this without generating a new variable, but it's programmable. Nick n.j.cox@durham.ac.uk Howard Lempel Is there a command that will give me the proportion of the time a variable is equal to a certain value? The command must accept weights. I'm looking for something like -tabcond-, from SSC, but that returns proportions as well as counts. One option would be to -generate- a dummy equal to 1 when my variable is equal to my value and zero otherwise and then to use -svy: mean-, but I would prefer something that can be done in one line (and without generating a new variable). My variable is continuous, so I don't want to -svy: tab- the whole thing. * * 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**:**st: RE: RE: Percent of time a***From:*Howard Lempel <HLempel@brookings.edu>

**References**:**st: Percent of time a***From:*Howard Lempel <HLempel@brookings.edu>

- Prev by Date:
**st: RE: Questions about -triplot-** - Next by Date:
**st: Re: Re: How does -kwallis2- compute adjusted p-values for significance?** - Previous by thread:
**st: Percent of time a** - Next by thread:
**st: RE: RE: Percent of time a** - Index(es):

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