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

From |
Howard Lempel <HLempel@brookings.edu> |

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

Subject |
st: RE: RE: Percent of time a |

Date |
Tue, 10 Feb 2009 15:45:57 -0500 |

Nick, My language was imprecise. I do not have a time series, but rather want to know in what proportion of weighted observations my condition holds. That being said, -_gwtmean- does do what I want, albeit by creating an extra variable, which is easy enough to drop. Thanks! Howie -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Nick Cox Sent: Tuesday, February 10, 2009 3:24 PM To: statalist@hsphsun2.harvard.edu Subject: st: RE: Percent of time a 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/ * * 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: Percent of time a***From:*Howard Lempel <HLempel@brookings.edu>

**st: RE: Percent of time a***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

- Prev by Date:
**st: Re: Re: How does -kwallis2- compute adjusted p-values for significance?** - Next by Date:
**st: RE: Creating a variable (cumulative revenue by title)** - Previous by thread:
**st: RE: Percent of time a** - Index(es):

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