Statalist


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

Re: AW: st: logit with interaction and transformation


From   Maarten buis <maartenbuis@yahoo.co.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: AW: st: logit with interaction and transformation
Date   Mon, 3 Aug 2009 11:03:16 +0000 (GMT)

--- On Mon, 3/8/09, Pabst Alexander wrote:
> But just for the case: would it be correct to calculate
> either
> Y= X1 + (ln)X2 + X1*(ln)X2
> sum X1
> global m  = r(mean)
> global sd = r(sd)
> 
>     (1) nlcom exp(x2) + ($m+$sd)*X2*X1
> or    (2) nlcom exp(x2) +
> exp(($m+$sd)*X2*X1)
> 
> Or would I have to manage this somehow in terms of marginal
> effects, e.g.
> mfx, eydx at(X1=$m)?
 
None of these would be correct. Apparently (in terms of the 
example below) you want the odds ratios of south when at 
different values of grade. Below I picked the numbers 
mean grade - 1 sd, mean grade, and mean + 1 sd. Notice that 
I used the mean and standard deviation of grade and only 
later transformed it into ln(grade), as this way your 
interpretation will accept the unit of measurement of grade 
rather than ln(grade).

*--------------------- begin example ------------------
sysuse nlsw88, clear
gen lngrade = ln(grade)
gen southXlngrade = south*lngrade
logit union lngrade south southXlngrade ///
            married never_married, or

sum grade if e(sample)
local m = r(mean)
local sd = r(sd)

nlcom (mean_minus_1sd:                             ///
          exp( _b[south] +                         ///
              ln(`m'-`sd')*_b[southXlngrade] ) )   ///
      (mean:                                       ///
          exp( _b[south] +                         ///
              ln(`m')*_b[southXlngrade] ) )        ///
      (mean_plus_1sd:                              ///
          exp( _b[south] +                         ///
              ln(`m'+`sd')*_b[southXlngrade] ) ) 

*--------------------- end example --------------------

Hope this helps,
Maarten

-----------------------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://home.fsw.vu.nl/m.buis/
-----------------------------------------





      

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index