st: Variance of a ratio

 From Leonelo Bautista To statalist@hsphsun2.harvard.edu Subject st: Variance of a ratio Date Fri, 17 Sep 2004 14:32:05 -0500

```I have a variable R that represents the risk of disease in each subject. I
regress this variable against predictors of risk:

regress R sex age obese diabetic

In this model obese and diabetic are dichotomous variables. I want to
calculate the proportion of R that is attributable to obesity (P), after
adjustment by sex, age and diabetes. Therefore, I estimated the predicted R
in the whole population and in those without obesity using adjust:

However, I need to calculate the variance of P. Since P is a ratio, there
seems to be no analytical way to estimate it. Therefore, I made 10000
simulations of P and got the variance from the simulated values, as follows:

gen P = (Ipop-Inull)/Ipop
sum P
gen Pmean=r(mean)   (Mean of P)
gen Pvar=r(Var)	(Var of P)

Is this a reasonable approach?

Thanks!

Leonelo E. Bautista

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```