Statalist The Stata Listserver


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

st: Re: RE: Re: Generating predicted values for OLS with transformed dependent variables


From   "Rodrigo A. Alfaro" <[email protected]>
To   <[email protected]>
Subject   st: Re: RE: Re: Generating predicted values for OLS with transformed dependent variables
Date   Wed, 12 Apr 2006 12:00:04 -0400

Dear Nick:

I didn't explore glm command before, then I tried the following:

sysuse auto
g lnp=ln(price)
glm price, family(normal) link(log) nohead nolog
reg lnp, nohead

and the coefficient (let's say mu) is different. Is there somethig than
I am missing? a normalization issue?

Thanks in advance, Rodrigo.



----- Original Message ----- 
From: "Nick Cox" <[email protected]>
To: <[email protected]>
Sent: Wednesday, April 12, 2006 9:31 AM
Subject: st: RE: Re: Generating predicted values for OLS with transformed 
dependent variables


As posted earlier, -glm- offers the back-to-basics
Jacobin solution as an alternative to this use
of Jacobians.

Nick
[email protected]

Rodrigo A. Alfaro

> Let me simplify the problem. Considere u~normal(0,s_u^2) and
> g(y)=u. You
> want E(y)... right? Sometimes you can find the distribution
> of y using the
> jacobian transformation. Suppose that h() is the inverse of g() then
> y=h(u)... then you need to find the distribution of y. This
> is a change of
> variable, you have to evaluate the normal with h() and
> multiply by the
> jacobian.
>
> Confuse? take g() =ln()... then ln(y)=u which is a
> simplification of the
> regression with log in the dependent variable. Note that the
> inverse of g()
> is known then h()=exp() and finally y=exp(u). You need to know the
> distribution of y, which is lognormal!!!
> (http://www.xycoon.com/logn_relationships1.htm). Using this
> distribution we
> can get the expected value of y E(y) = exp(0+0.5*s_u^2)
> (http://www.xycoon.com/logn_expectedvalue.htm). If
> ln(y)=bx+u, you can find
> that for nonstochastic x
> E(y)=exp(bx+0.5*s_u^2)=exp(bx)*exp(0.5*s_u^2), the
> second term is the "adjustment".
>
> In your problem you have to find the distribution of y for y=u^4 and
> u~normal. I understand that you cannot use the jacobian
> transformation, but
> the proof of "the square of a standard normal is a chi-square
> 1" is a useful
> source to solve your problem.
*
*   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/



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