datal <- read.tablepDANEl.txt", header = TRUE) hist(datal$X) plot(datal$Xf datal$Y)
X<-datal$X Y<-datal$Y lm(Y - X)
Im.linear <- lm(Y - X)
Im.linear summa ry (Im. linea r) plot(datal$X, datal$Y) abline(Im .linear) residuals(Im.linea r)
Im.linear.resids <- residuals(Im.linear) hist(lm.linear.resids) fitted(lm.linear) plot(X,Y)
lines(X,fitted(Im.linear)) plot(X,Y)
lines(X,fitted(Im.linear))
segments(X,fitted(Im.linear), X,Y)
plot(fitted(Im.linear), res id (Im .linear))
qqno rm(resid(Im.linea r))
pred.framę <- data.framę(X=4:100)
pp <- predict(Im.linear, int=''p"f newdata=pred.framę) pc <- predict (Im .linear, int=’'c", newdata=pred.f ramę) plot(X,Y,ylim=range(Y, pp, na.rm=T)) pred.X <- pred.frame$X
matlines(pred.X, pc, lty=c(1,2,2), col="red") matlines(pred.X, pp, lty=c(1,3,3), col="blue") predict (Im.linear,int="c") p redict(Im.linea r,int="p") cor(X,Y, use="complete.obs") cor(datal,use="complete.obs") cor.test(X,Y)
cor.test(X,Y,method="spearman")cor.test(X,Y,method="kendall") data() # lista wszystkich dostępnych zbiorów danych try(data(package = "ISv/*") )# lista zbior&w danych w pakiecie ISwR data(cystfibr) # zagaduj zbi&r danych par(mex=0.5)
pairs(cystfibr, gap=0, cex.labels=0.9) attach(cystfibr)
lm(pemax-age+sex+height+weight+bmp+fevl+rv+frc+tlc)
summary(lm(pemax~age+sex+height+weight+bmp+fevl+rv+frc+tlc))
summa ry(lm(pemax~age+sex+height+weight+bmp+fevl+rv+f rc+tlc))
summa ry(Im(pemax-age+sex+height+we ight+bmp+fev1+ rv+f rc))
summa ry(Im(pemax~age+sex+height+weight+bmp+fev1+ rv))
summary(lm(pemax~age+sex+height+weight+bmp+fevl))
summary(Im(pemax-age+sex+height+weight+bmp))
summary(lm(pemax~sex+height+weight+bmp))
summary(lm(pemax~sex+weight+bmp))
summary(lm(pemax~weight+bmp))
summary(Im(pemax-weight))
summary(lm(pemax-weight))
summa ry(lm(pemax~age+height+weight))
summary(Im(pemax-age+height))
summary(lm(pemax-age))
summary(Im(pemax-height))