Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

Re: st: Multicollinearity and Time Trends

From   Maarten Buis <>
Subject   Re: st: Multicollinearity and Time Trends
Date   Wed, 11 Apr 2012 15:18:22 +0200

On Wed, Apr 11, 2012 at 2:47 PM, Justina Fischer wrote:
> So the best way of indeitfying these three different trends in the same model would be to start the time trend with a minus sign, letting it cross the zero-line.

You can see what happens to the correlation between x and x^2 when you
center at different values in the code below. It starts with an x that
has the values -10 to -1 (mean -5.5), than -9.9 to -0.9 (mean -5.4),
up to 1 to 10 (mean 5.5). Notice that in the original question the "x"
ran from 1951 to 1960. If you look at the graph below and extrapolate
to those values you can imagine why that person ran into trouble...

*------------- begin example ---------------
drop _all
set obs 10
gen double x = -11 + _n
gen double y = x^2
local mid = -5.5

tempname memhold
tempfile results
postfile `memhold' mid corr using `results'
forvalues 1=0/110 {
	qui {
		replace x = x + .1
		replace y = x^2
		corr x y
		local mid = `mid' + .1
		post `memhold' (`mid') (`r(rho)')
postclose `memhold'
use `results', clear
twoway line corr mid, yline(0) xline(0)
*-------------- end example ----------------
(For more on examples I sent to the Statalist see: )

Hope this helps,

Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index