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

st: Re: percent of time a

From   Kit Baum <>
Subject   st: Re: percent of time a
Date   Wed, 11 Feb 2009 07:05:44 -0500

Easy: for a continuous variable the probability that X_i = x is zero.

Kit Baum, Boston College Economics and DIW Berlin
An Introduction to Modern Econometrics Using Stata:

On Feb 11, 2009, at 02:33 , Howie wrote:

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:

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