Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: RE: Calculate confidence intervals for log-log models
From
"Seed, Paul" <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: RE: Calculate confidence intervals for log-log models
Date
Wed, 6 Mar 2013 10:26:14 +0000
The same result can be got in a simpler way.
Consider a well-known example:
*********** Start of Stata code ***********
clear
sysuse auto
gen ln_price = ln(price)
gen ln_mpg = ln(mpg)
regress ln_mpg ln_price
* effect of a 10% increase in price on mpg.
lincom `=ln(1.1)'*ln_price , eform
* The mpg falls on average by 3.4% to 96.6% of the original value.
* Alternative method
nlcom 1.1^_b[ln_price]
* The same confidence interval; but the test (t in particular)
* no longer agrees with that given by the regression.
*********** End of Stata code ***********
*******************************************************************
Date: Tue, 5 Mar 2013 20:58:57 +0000
From: Jason Ferris <[email protected]>
Subject: st: RE: Calculate confidence intervals for log-log models
Hi Nick and Rich,
Nick - I was going to run a series of 'changes' in the original variable (as you suggested) by dividing the original variable by a series of constants (representing the percentage value changes) that I want. I thought I could get this directly by using lincom - but didn't appreciate it was only about 'linear combinations'.
Rich - thank you for suggestion - this gives me exactly what I am looking for.
- ------------------------------------------------------------------------------
lny | Coef. Std. Err. t P>|t| [95% Conf. Interval]
- -------------+----------------------------------------------------------------
lnx | 2.105722 .0817271 25.77 0.000 1.942802 2.268642
_cons | -3.032146 .4274653 -7.09 0.000 -3.884282 -2.180009
- ------------------------------------------------------------------------------
. nlcom 1.1^_b[lnx]
_nl_1: 1.1^_b[lnx]
- ------------------------------------------------------------------------------
lny | Coef. Std. Err. t P>|t| [95% Conf. Interval]
- -------------+----------------------------------------------------------------
_nl_1 | 1.222254 .0095207 128.38 0.000 1.203275 1.241233
- ------------------------------------------------------------------------------
Cheers,
Jason
***************************************************
Paul T Seed, Senior Lecturer in Medical Statistics,
Division of Women's Health, King's College London
Women's Health Academic Centre, King's Health Partners
(+44) (0) 20 7188 3642.
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/