Page 1 of 1

How to save coefficients in a ls regression?

Posted: Tue Sep 08, 2015 1:53 am
by sakerstallda
Hello!
I am running a for-loop that performs a ls regression with two series (for every date). I would like to save the coefficients for the two variables for every regression in a matrix, but do not know how to do that. Are you able to help me? The matrix will have as many rows as the vector dt and 2 columns (one for each variable).

for !date = 1 to @rows(dt)
vspread = @rowextract (spread, !date)
vloptidstat = @rowextract (loptid_sak, !date)
mtos(vspread, vspreadser)
mtos(vloptidstat, vloptidstatser)
equation eq1.ls vspreadser c vloptidstatser
next

Best regards

Re: How to save coefficients in a ls regression?

Posted: Tue Sep 08, 2015 5:06 am
by CharlieEVIEWS