Axel Leroix
2009-May-12 13:37 UTC
[R] R^2 extraction and autocorrelation/heterokedasticity on TSLS regression
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.squaredNULL 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]]
Seemingly Similar Threads
- limited formula length in tsls
- Urgent: How to obtain the Consistent Standard Errors after apply 2SLS through tsls() from sem or systemfit("2SLS") without this error message !!!!!!!!!!!!!
- Epple and McCallum TSLS example
- 2SLS / TSLS / SEM non-linear
- instrumental variables regression using ivreg (AER) or tsls (sem)