# přednáška multikolinearita 16. prosince 2008 rm(list=ls()) Iq = read.csv2("data/Iq.csv") summary(Iq) attach(Iq) ls() summary(a <- lm(iq~divka+zn7+zn8)) source("piMulticol.R") piMulticol(a,center=TRUE,scale=TRUE) # příčinou multikilinearity je hlavně podobnost obojích známek piMulticol(a,center=TRUE,scale=FALSE) piMulticol(a,center=FALSE,scale=FALSE) piMulticol(a,center=FALSE,scale=TRUE) # regrese - 13. kapitola (Nelineární regrese) # přednáška 16. prosince 2008 rm(list=ls(all=TRUE)) # graf obr. 13.1 fceMM <- function(x,theta1=2,theta2=0.5) theta1*x/(theta2+x) # pro kreslení regresní nadplochy jako fce theta2 x1 <- 0.1; x2 <- 10 t1 <- 2; t21 <- 0.1; t22 <- 0.4; t23 <- 0.7 t2 <- seq(0.09,1,length=101) y1 <- fceMM(x1,t1,t2) y2 <- fceMM(x2,t1,t2) t1a <- 1.9 y1a <- fceMM(x1,t1a,t2) y2a <- fceMM(x2,t1a,t2) xlim <- range(c(y1,y1a)); ylim <- range(c(y2,y2a)) plot(y1,y2,type="l",main="",xlim=xlim,ylim=ylim, xlab=expression(y[1]),ylab=expression(y[2])) points(fceMM(x1,t1,t21),fceMM(x2,t1,t21),pch="+",cex=2) points(fceMM(x1,t1,t22),fceMM(x2,t1,t22),pch="+",cex=2) points(fceMM(x1,t1,t23),fceMM(x2,t1,t23),pch="+",cex=2) # jiná hodnota t1 lines(y1a,y2a,lty=2) points(fceMM(x1,t1a,t21),fceMM(x2,t1a,t21),pch="+",cex=2) points(fceMM(x1,t1a,t22),fceMM(x2,t1a,t22),pch="+",cex=2) points(fceMM(x1,t1a,t23),fceMM(x2,t1a,t23),pch="+",cex=2) legend("bottomright", legend=c(expression(theta[1]==2), expression(theta[1]=="1,9")), lty=1:2) #