Statalist


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

AW: AW: st: logit with interaction and transformation


From   "Pabst Alexander" <Pabst@ift.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   AW: AW: st: logit with interaction and transformation
Date   Mon, 3 Aug 2009 13:52:40 +0200

Great. This is a step closer to the solution.

But I actually want the odds ratios of the (ln transformed) independent variable at different values of the (non-transformed) moderator, i.e. just the other way around.
To stay at your example, that would mean want I want the odds ratios of grade when at different values of wage. Would it then read like this below?
But this yields big ORs, so I assume there`s still a mistake in!? 

Alex

*--------------------- begin example ------------------
gen lngrade = ln(grade) 
gen wageXlngrade = wage*lngrade 

logit union lngrade wage wageXlngrade married never_married, or

sum wage if e(sample)
global m = r(mean)
global sd = r(sd)

nlcom (mean_minus_1sd:                             	///
          exp( (exp(_b[lngrade])) + 			///
			($m-$sd)*_b[wageXlngrade] ) )   	///
      (mean:                                       	///
          exp( (exp(_b[lngrade])) +				///
			($m)*_b[wageXlngrade] ) )        	///
      (mean_plus_1sd:                              	///
          exp( (exp(_b[lngrade])) + 			///
			($m+$sd)*_b[wageXlngrade] ) )
*--------------------- end example --------------------


-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Maarten buis
Gesendet: Montag, 3. August 2009 13:03
An: statalist@hsphsun2.harvard.edu
Betreff: Re: AW: st: logit with interaction and transformation


--- 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/

*
*   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