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: interprating orthogonal polynomial regression


From   [email protected]
To   [email protected]
Subject   Re: st: interprating orthogonal polynomial regression
Date   Mon, 26 Jul 2010 12:54:38 -0400 (EDT)

I used the syntax that Maarten provided to translate the coefficients of
the orthogonal polynomials into the original metric of time. The results
are below. Then i guess the equation of the cubic mode is represented in
the row of deg3, that y=.67-1.46t+.42t²-.03t³. Then what is the formula to
get the two reflection points of the curve(the sample mean trajectory
showed that there are two reflection points, and it changes directions
twice)? Thanks a lot.


             |      deg1       deg2       deg3      _cons
-------------+--------------------------------------------
        deg1 | -.1405198          0          0   .5339751
        deg2 |  .5560661  -.0491674          0  -.6281949
        deg3 | -1.458612   .4243002  -.0270891   .6659666
       _cons |         0          0          0  -.5578475





> *--------------- begin example ----------------
> sysuse auto, clear
> orthpoly weight, deg(3) generate(pw*)
> logit foreign mpg pw1-pw3 rep78
> orthpoly weight, deg(3) poly(P)
> matrix b = e(b)
> // extract the polynomials and the constant
> matrix b = b[1, "foreign:pw1".."foreign:pw3"], b[1,"foreign:_cons"]
> matrix b = b*P
> matlist b
>
> // check
> gen w1 = weight
> gen w2 = weight^2
> gen w3 = weight^3
>
> logit foreign mpg w1-w3 rep78
> *---------------- end example -----------------------
>

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