HousePrices <- read.table("F:/tz/CVSRoot/tz/projects/housing/own_work/for_stats_program.dat",header=TRUE) attach(HousePrices) # do log version formula.1 <- LN.RPH ~ 1 + LN.HH + LN.RGDP + RINT + RENT.DRG + TAX RegModel.1 <- lm(formula.1, data=HousePrices) summary(RegModel.1) bgtest(formula.1,data = HousePrices) dwtest(formula.1,data = HousePrices) Box.test(resid(RegModel.1)) # add in lag formula.3 <- LN.RPH ~ 1 + LN.RPH.1 + LN.HH + LN.RGDP + RINT + RENT.DRG + TAX RegModel.3 <- lm(formula.3, data=HousePrices) summary(RegModel.3) bgtest(formula.3,data = HousePrices) dwtest(formula.3,data = HousePrices) Box.test(resid(RegModel.3)) # add in lag #formula.5 <- LN.RPH ~ 1 + LN.RPH.1 + LN.HH + LN.RGDP + RINT #RegModel.5 <- lm(formula.5, data=HousePrices) #summary(RegModel.5) #bgtest(formula.5,data = HousePrices) #dwtest(formula.5,data = HousePrices) #Box.test(resid(RegModel.5)) formula.7 <- D.LN.RPH ~ 1 + LN.RPH.1 + LN.HH + LN.RGDP + RINT + RENT.DRG + TAX RegModel.7 <- lm(formula.7, data=HousePrices) summary(RegModel.7) bgtest(formula.7,data = HousePrices) dwtest(formula.7,data = HousePrices) Box.test(resid(RegModel.7))