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: combined linear and quadratic trend in marginsplot


From   Maarten Buis <[email protected]>
To   [email protected]
Subject   Re: st: combined linear and quadratic trend in marginsplot
Date   Mon, 3 Oct 2011 12:39:23 +0200

On Fri, Sep 30, 2011 at 3:06 PM, Lloyd Dumont wrote:
> I am running a logit that includes a linear trend (starts at 0 and goes up to 5), a quadratic trend (starts at 0 and goes up to 25, obviously),
<snip>
> Say the logit looks like…
>
> - logit DEPVAR LINTREND QUADTREND {and a bunch of other indep vars}
>
> Then,
> -margins, at(LINTREND=(0(1)5))
> -marginsplot, xlabel(0(1)5)
>
> This, of course, generates a straight line.  But, what I really want is the curvilinear function that is captured by the linear and the quadratic term together.

You would need to tell Stata that this is a quadratic effect. You can
do so by not creating the squared term yourself but add it using the
factor variable notation. Say the variable is called x, than you would
add: -c.x##c.x- to your -logit- model.

Hope this helps,
Maarten


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


http://www.maartenbuis.nl
--------------------------

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index