# Daten einlesen library(foreign) Datenmatrix <- read.spss("./daten/Poggendorf_Daten.sav", use.value.labels=TRUE, max.value.labels=Inf, to.data.frame=TRUE) attach(Datenmatrix) # Durchführung der Regressionsanalyse PoggendorfAusmass=y Pog.lm = lm(PoggendorfAusmass ~ alter + Alter2) summary(Pog.lm) # Streudiagramm par(mar=c(5.1,5.1,3.1,2.1)) plot(alter, y, xlim=c(4.5,19.5), xaxp=c(5,19,7), cex.axis=1, cex.lab=1.25, ylab="Ausmaß der Poggendorf-Täuschung", las=1) x = seq(4.5, 19.5, length=1000) y2 = 2.8138 - 0.2505*x + 0.00844*x*x y1 = 1.82555 - 0.05138*x lines(x, y1, lwd=4) lines(x, y2, lwd=4) #Zur Ausgabe in eine PDF-Datei stellen Sie bitte sicher, dass Sie Schreizugriff auf den Ausgabepfad haben! #dev.print(pdf, file="c:/Poggendorf.pdf", width=5, height=5, pointsize=10) ### Ausgabe der Grafik direkt nach PDF