#Datensatz Struktur str(diamonds) summary(diamonds) #oder library(Hmisc) describe(diamonds) #HŠufigkeitstabelle fŸr eine kategoriale Variable table(diamonds$color) t1<-table(diamonds$color) dim(diamonds) (t2<-t1/dim(diamonds)[1]) #HŠufigkeitstabelle fŸr eine stetige Variable table(cut(diamonds$carat,breaks=0:6)) table(cut(diamonds$carat,breaks=25)) table(cut(diamonds$carat,breaks=seq(0,6,0.25))) #Theoretische Quantile pp<-seq(0,1,0.01) plot(qchisq(pp,7),pp,type="l") x<-seq(-5,5,0.01) plot(x,pnorm(x),type="l") #Empirische Quantile qq<-quantile(diamonds$carat,probs=pp) JavaGD() plot(qq,pp,type="l") #Vergleich mit einer Exponentialverteilung JavaGD() hist(diamonds$carat,freq=FALSE) y<-seq(0,5,0.001) lines(y,dexp(y,rate=1/mean(diamonds$carat))) #QQPlot Vergleich JavaGD() plot(qexp(ppoints(diamonds$carat),rate=1/mean(diamonds$carat)),sort(diamonds$carat),type="l") abline(a=0,b=1)