

' linear model
equation lin_model.ls y c @trend ar(1) ar(2)

'calculate ssr from linear model using .fit
lin_model.fit yhat_lin 
series res_linsq = (y - yhat_lin)^2
scalar ssr_lin = @sum(res_linsq) 
	' however, this excludes the first two values, and therefore yields a different result (228.54) from the ssr reported in eviews estimation output (238.02)

'log model
equation log_model.ls log(y) c @trend ar(1) ar(2)

'calculate ssr from log model using .fit
log_model.fit yhat_log
series yhat_log_level = exp(yhat_log)
series res_logsq = (y - yhat_log_level)^2
scalar ssr_log = @sum(res_logsq) 




