[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: difference between estimated ratios of x/y and ax/ay

From   "Michael Blasnik" <>
To   <>
Subject   st: Re: difference between estimated ratios of x/y and ax/ay
Date   Wed, 17 Oct 2007 12:44:13 -0400

It's not rounding and its not an error. The ratio estimate is the sum of the numerator divided by the sum of the denominator (appropriately weighted if weights are specified), it is not the average of the ratio. So, unless the variable trunk is a constant, it will most likely lead to a different estimate of the ratio.

Michael Blasnik

----- Original Message ----- From: "Zurab Sajaia" <>
To: "statalist" <>
Sent: Wednesday, October 17, 2007 12:17 PM
Subject: st: difference between estimated ratios of x/y and ax/ay

Dear All,

I was estimating ratio of two variables (in fact, svy : ratio, but problem is the same for both) and after noticing that both numerator and denominator contained same component I decided to check whether canceling it would affect the results. To my surprise it did. Lets consider this example:

sysuse auto, clear

. ratio weight / length
_ratio_1 | 16.06673 .2807194 15.50726 16.6262


.generate double wa = weight * trunk
.generate double la = length * trunk

.ratio wa / la
_ratio_1 | 16.48413 .2797573 15.92658 17.04169

Have anybody experienced similar case? does this thing come purely from numerical, rounding issues or there is something bigger (I can't think of any though)?

Any insight would be appreciated.
*   For searches and help try:

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