mytest=lm(y~x+x1, data=mydata) first run the regression with a name,
bptest(mytest) this code enough to apply Breusch-Pagan to the model, bptest(mytest~x+ I(X)^2, data=mydata) runs the white test for the model. TESTING FOR OMITTED VARIABLE RAMSEYS RESET TEST Resettest(mytest) this should yield if the model has any misspesification TESTIN FOR AUTOCORRELATION and TS REGRESSION library("dynlm") mytest=dynlm(y~x+L(x)+d(x), data=mydata), dwtest(mytest) Durbin-Watson test
bgtest(mytest) Breusch-Godfrey test for serial correlation of order 1
vcov(mytest) or vcovHC(mytest) this produces HAC residuals coeftest(mytest, vcov=vcovHC) this gives coeeficients of the model regarding Whites HAC residuals. Testing for stationarity in data library(tseries) Adf.test(diff(log(mydata))) augmented Dickey Fuller testwith Ho= data has unit rooot. pp.test(diff(log(mydata))) Phillips Peron test with same hypothesis kpss.test(diff(log(mydata))) kppss test with the same hypothesis