[R-SIG-Finance] TSLS: R^2 extraction and autocorrelation and heterokedasticity tests
spencerg
spencer.graves at prodsyse.com
Fri May 15 01:19:45 CEST 2009
What code did you use to produce "output"?
Have you tried "str(output)" and "names(output)"?
If this is not enough to help you answer your question, you might try
rephrasing your question using commented, minimal, self-contained,
reproducible code, as suggested in the posting guide
"http://www.R-project.org/posting-guide.html".
Spencer Graves
josé maria Rodriguez wrote:
> Hi,
>
> I'm actually I’m performing a TSLS linear multiple regression on annually
> data which go from 1971 to 1997. After performing the TSLS regression, I
> tried to extract the R squared value using “output$r.squared” function and
> to perform autocorrelation (Durbin Watson and Breush Godfrey) and
> heterokedasticity tests (Breush-pagan and Goldfeld Quandt) but I have
> errors messages. More specifically, this is function that I write to R and
> below its response :
> for R^2 :
>
>> output$r.squared
>>
> NULL
> for heterokedasticity tests :
>
>> bptest(reg1)
>>
> Error in terms.default(formula) : no terms component
> and for autocorrelation test, when I try :
> durbin.watson(reg1$residuals, max.lag=10)
> [1] 1.509 2.520 2.247 2.001 1.743 1.092 1.392 1.439 1.468 1.035
> this give me only the durbin watson value and not the probabilities
> (p-value)
> When performing these tests on lm object I have no problem. So my question
> is how to extract R^2 from a tsls regression (object) and how to perform
> autocorrelation and heterokedasticity tests on tsls regression. I looked at
> the sem package but I found no answer to my questions. So please is there
> any person who can help me.
>
> Think you in advance
>
> [[alternative HTML version deleted]]
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
More information about the R-SIG-Finance
mailing list