attach("/u/maechler/S/goodies.Data/") gewichte_read.table("/u/sfs/ueb/datasets/body.brain.dat",header=T) attach(gewichte) {ps.do(file="body.brain.ps") par(mfrow=c(2,1), mar=par("mar")-c(1,-6,+3,-6)) #plot(Body.Weight[-c(6,14)],Brain.Weight[-c(6,14)],pch="o") plot(Body.Weight,jitter(Brain.Weight,2),pch=5,xlab="Körpergewicht",ylab="Hirnmasse") title(sub="Körpergewicht") #plot(Body.Weight,Brain.Weight) plot(log(Body.Weight),log(Brain.Weight),pch=5,xlab="log(Körpergewicht)",ylab="log(Hirnmasse)") title(sub="log(Körpergewicht)") ps.end()} mean(log(Body.Weight)) 3.028283 mean(log(Brain.Weight)) 4.428471 sum((log(Body.Weight)-mean(log(Body.Weight)))^2)/24 10.50226 sum((log(Brain.Weight)-mean(log(Brain.Weight)))^2)/24 6.448081 sum((log(Body.Weight)-mean(log(Body.Weight)))*(log(Brain.Weight)-mean(log(Brain.Weight))))/24 7.900441 reg.gewicht_lm(log(Brain.Weight)~log(Body.Weight)) summary(reg.gewicht) Coefficients: Value Std. Error t value Pr(>|t|) Signif (Intercept) 2.15041 0.20060 10.72 0 *** log(Body.Weight) 0.75226 0.04572 16.45 0 *** Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 {ps.do(file="body.brain.reg.ps") par(mar=par("mar")-c(1,-4,+3,-4)) plot(log(Body.Weight),log(Brain.Weight),pch=5,xlab="log(Körpergewicht)",ylab="log(Hirnmasse)") abline(reg.gewicht$coefficients[1],reg.gewicht$coefficients[2]) ps.end()}