Statalist


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

Re: st: Variance of Nonlinear combination of estimators and variables


From   Austin Nichols <[email protected]>
To   [email protected]
Subject   Re: st: Variance of Nonlinear combination of estimators and variables
Date   Sun, 27 Sep 2009 15:28:43 -0400

Or maybe you want:

sysuse nlsw88, clear
g lnw=ln(wage)
reg lnw c.ttl_exp##c.ttl_exp
margins, dydx(ttl_exp)

averaging across the sample.  Or did you mean you want to treat X as estimated?

On Sun, Sep 27, 2009 at 11:48 AM, Maarten buis <[email protected]> wrote:
> --- Vatsalya Srivastava wrote:
>> I have a regression equation
>> y = bo + b1.x1 + b2.x2 + b3.x2^2 [simple OLS regression]
>>
>> I need to estimate the standard error of [b2 + b3.x2].
>>
>> The closest I have come is the nlcom command, which I suppose
>> estimates the variance of non linear combinations of estimators only.
>
> What you want is not a single value with a single standard error, but
> multiple values, one for each value of x2, with multiple standard errors.
> The relevant command in that case is -predictnl-, see -help predictnl-
> and the example below:
>
> *------------ begin example ------------------
> sysuse nlsw88, clear
> gen ttl_exp2 = ttl_exp^2
> gen ln_wage = ln(wage)
>
> reg ln_wage union grade ttl_exp ttl_exp2
>
> predictnl effect =                       ///
>   _b[ttl_exp] + 2*_b[ttl_exp2]*ttl_exp, ///
>   ci(lb ub)
>
> sort ttl_exp
> twoway rarea lb ub ttl_exp ||            ///
>       line effect ttl_exp,              ///
>       clstyle(solid) legend(off)        ///
>       ytitle(effect of ttl_exp)         ///
>       yline(0)
> *----------- end example -------------------
> (For more on examples I sent to the Statalist see:
> http://www.maartenbuis.nl/example_faq )
>
> Hope this helps,
> Maarten

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