Statalist


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

st: Percent of time a


From   Howard Lempel <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: Percent of time a
Date   Tue, 10 Feb 2009 15:09:57 -0500

Hello all,

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.

Thanks for your consideration.
Howie

Howie Lempel
Research Assistant
The Brookings Institution | Economic Studies
 
1775 Massachusetts Ave NW | Washington DC 20036
[email protected] | p: (202) 238-3576
 


*
*   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/



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