# Diverse Auswertungen von Beispiel 2.1: dd <- read.table("StatInf2000.txt", header=T) str(dd) # Kuchen- und Stabdiagramm der Variable "Zufallsziffer": t <- table(dd$RandomN) n <- sum(t) par(mai=c(0,0,0,0),ps=20) pie(t) par(mai=c(0.5,0.5,0.20,0),ps=20) barplot(t/n,ylim=c(0,0.5),width=0.5,xlim=c(0,10),space=1) # Analyse der Variable "Alter": X <- dd$Age # Empirische Verteilungsfunktion der Variable "Alter": par(mai=c(0.5,0.5,0.05,0.05)) plot.ecdf(X,pch="*",verticals=F,lwd="2",xlab="",ylab="", main="",usr=c(19,40,0,1),yaxp=c(0,1,4)); grid(ny=4) # Histogramme der Variable "Alter": par(mai=c(0.5,0.5,0,0)) hist(X,breaks=seq(from=19.5,to=40.5,by=1),col="grey",xlab="",ylab="", main="",freq=F,xlim=c(19.5,40)); rug(X) hist(X,breaks=seq(from=19.5,to=40.5,by=2),col="grey",xlab="",ylab="", main="",freq=F,xlim=c(19.5,40)); rug(X) hist(X,breaks=seq(from=20.5,to=40.5,by=2),col="grey",xlab="",ylab="", main="",freq=F,xlim=c(19.5,40),ylim=c(0,0.25)); rug(X) # Box-Plot und Box-Whisker-Plot der Variable "Alter": par(mai=c(0.05,0.5,0.05,0.05)) boxplot(X,ylim=c(19,40), range=Inf, boxwex=1.5) boxplot(X,ylim=c(19,40), range=1.5, boxwex=1.5)