Bookmark and Share

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]

Re: st: Marginsplot on backtransformed data


From   Scott Merryman <[email protected]>
To   [email protected]
Subject   Re: st: Marginsplot on backtransformed data
Date   Thu, 19 Dec 2013 09:50:22 -0600

One could also use the -expression()- option in -margins-

 margins race, expression(predict(xb)^2)
 marginsplot, name(regress2,replace)

Scott


On Thu, Dec 19, 2013 at 9:30 AM, Richard Williams
<[email protected]> wrote:
> Patrick Royston's -marginscontplot- (available from SSC) can be used when
> you've done a log or other transformation of an independent variable. See
> the help file example entitled "Example using a log-transformed covariate".
>
> For a dependent variable, I think you can use the glm command, at least some
> of the time. You should get a 2nd opinion on this, e.g. Austin Nichols is
> much better with these sorts of things than I am. When the dependent
> variable has been transformed I believe it is often better to use glm
> anyway. In the following you don't get exactly the same results from regress
> and glm but I don't think you are supposed to (and the results are similar).
>
> webuse nhanes2f, clear
> gen sqweight = weight ^.5
> reg sqweight i.race
> margins race
> marginsplot, name(regress)
> glm weight i.race, link(power .5)
> margins race
> marginsplot, name(glm)
>
*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index