Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

Re: st: Marginsplot on backtransformed data

From   Richard Williams <>
Subject   Re: st: Marginsplot on backtransformed data
Date   Thu, 19 Dec 2013 11:13:58 -0500

At 10:50 AM 12/19/2013, Scott Merryman wrote:
One could also use the -expression()- option in -margins-

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

Good point. I've used the expression option to do thing like multiply numbers by 100 so you get 37.3 instead of .373.

That still leaves open the question of whether you should use regress (computing the square root of the dv yourself) or use glm (using the power link.) In my example it doesn't make too much difference. In general is it better to use glm or are there pros and cons of each approach?


On Thu, Dec 19, 2013 at 9:30 AM, Richard Williams
<> 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:

Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME:   (574)289-5227
EMAIL:  Richard.A.Williams.5@ND.Edu

*   For searches and help try:

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