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
Ulrich Kohler <[email protected]>
To
[email protected]
Subject
Re: st: Marginsplot on backtransformed data
Date
Thu, 19 Dec 2013 08:42:28 +0100
Here is a solution that works reasonably well (using a log transform).
. use http://www.stata-press.com/data/kk3/data1, clear
. gen logincome = log(income)
. reg lsat logincome i.sex i.mar
. margins, at(logincome=(6(.1)10))
. matrix at = r(at)
. parmest, bmat(r(b)) vmat(r(V)) fast
. svmat at
. gen x = exp(at1)
. tw || rarea min95 max95 x || line estimate x
data1.dta is the prime example data set of Kohler/Kreuter "Data Analysis
Using Stata", published by Stata Press, and -parmest- is uswer-written
by Roger Newson and available from SSC:
. ssc install parmest
Many regards
Uli
Am 19.12.2013 07:58, schrieb Daniel Herbert Opi:
Hi All,
I am using the marginsplot function to plot graphs that take into
account adjustments I have carried out following a regression
analysis. Since my regression analysis contains data that has been
normalised by square root transformation, the plots are not that
easily interpretable. Is there a way to plot the same graphs but
somehow tell Stata/marginsplot to use back-transformed results? And
does the margins function store predictions that can be accessed?
I am using Stata 13 and the following are examples of commands I am using:
regress squareroot_transformed_variable i.categorical1 i.categorical2
margins categorical1
marginsplot
Kind Regards
Herbert
*
* 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/
*
* 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/