Postby adarshad » Thu Oct 25, 2018 3:18 am
'create matrix to store pvalues. We'll be running 28 regressions with SIX pvalues in each row , five for five independent variables and one for intercept
matrix(6,28) pv
matrix(6,28) coefs 'create matrix to store coefficients
vector(28) r2s 'create vector to store rsquare value
vector(28) aic 'create vector to store akaike information criteria value
'create empty equation to be used inside the loop
equation eq
!rowcounter=1
'run pairwise regressions between Yi and Xi
for !i=1 to 28
'estimate equation
eq.ls y{!i} c x{!i}A(-1) x{!i}B x{!i}C x{!i}D x{!i}E
'store coefficients into matrix
colplace(pv, eq.@pval, !i)
colplace(coefs, eq.@coefs, !i)
r2s(!rowcounter) = eq.@r2
aic(!rowcounter) = eq.@aic
!rowcounter = !rowcounter+1
next