PMB – once again

#### wczytac dane, zastosowac funkcje read.table oraz pozniej attach ####

#model z PC1

model1 = lm(TEMP~PC1)

summary(model1)
plot(TEMP, model1$fitted.values, ylab = „TEMP (model)”)
abline(0,1, col = 2, lwd = 2)

qqplot(TEMP, model1$fitted.values)
abline(0,1, col = 2, lwd = 2)

plot(1951:2012, TEMP, type = „l”, xlab = „ROK”)
lines(1951:2012, model1$fitted.values, col = 2, lwd = 2)

#8
#teraz model ze wszystkimmi wybranymi PCs
model2 = lm(TEMP~PC1+PC2+PC3+PC4+PC5+PC6)
summary(model2)
model3 = lm(TEMP~PC1+PC3+PC5+PC6)
summary(model3)

plot(1951:2012, TEMP, type = „l”, xlab = „ROK”)
lines(1951:2012, model1$fitted.values, col = 4, lwd = 2)
lines(1951:2012, model2$fitted.values, col = 2, lwd = 2)
lines(1951:2012, model3$fitted.values, col = 3, lwd = 2)

qqplot(TEMP, model3$fitted.values)
abline(0,1, col = 2, lwd = 2)

AIC(model1, model2, model3)

#9
# pokazanie wyników modeli na diagramie Taylora
#niezbędna jest paczka plotrix

taylor.diagram(TEMP, model1$fitted.values, add = FALSE, col = 2, sd.arcs = TRUE, ref.sd = TRUE)
taylor.diagram(TEMP, model2$fitted.values, add = TRUE, col = 3, sd.arcs = TRUE, ref.sd = TRUE)
taylor.diagram(TEMP, model3$fitted.values, add = TRUE, col = 4, sd.arcs = TRUE, ref.sd = TRUE)
detach(data)

This entry was posted in Informacje dla Studentów. Bookmark the permalink.