# st: Re: statistical significance of slopem and intercept

 From "victor michael zammit" To Subject st: Re: statistical significance of slopem and intercept Date Thu, 17 Jun 2004 21:03:49 +0200

```Dear Stata Users,
can anyone please  help me with the following :
I am trying to assert my understanding of statistical significance of slope
and intercept
given the following model .Is it correct to say that this data deviations
model is significant
with respect to its slope for 0<i <= 9.5  , and with respect to its
intercept for 1.6< i < 9.9
and that the optimum deviation is at about i = 4 ?

quietly {
clear
set obs 11
gen y = _n - 1
gen x = y
save slope,replace
capture set more off
local i = 0
while `i'<= 9   {
local u = 1
while `u'<= 100  {
use slope,clear
replace y = y - `i' in 1/1
replace y = y + `i' in 2/2
replace y = y - `i' in 3/3
replace y = y + `i' in 4/4
replace y = y - `i' in 5/5
replace y  = y + `i' in 6/6
replace y = y - `i' in 7/7
replace y = y + `i' in 8/8
replace y = y - `i' in 9/9
replace y = y + `i' in 10/10
replace y = y - `i' in 11/11

reg  y x
set obs 100
gen r = .
gen i = .
gen bx = .
gen tx = .
gen bcons = .
gen tcons = .
replace r = e(r2) in `u'
replace i = `i' in `u'
replace bx = _b[x]  in `u'
replace tx = _b[x] / _se[x] in `u'
replace bcons = _b[_cons] in `u'
replace tcons = _b[_cons]/ _se[_cons] in `u'
drop y x
keep in `u'/`u'
sort i
save v`u',replace
local u = `u'+ 1
local i = `i'+ .1
}
}
use v1,clear
local u = 1
while `u'<= 100  {
merge i using v`u'
drop _merge
sort i
local u = `u'+1
}
gen tdb = tx/bx
gen cdt = bcons/ tcons

gen xi = tx - bx
gen consi = tcons- bcons
gen opi = cdt - tdb
}
l i xi consi opi

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```