Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(plyr)
- library(stats)
- library(ggplot2)
- library(moments)
- library(psych)
- library(car)
- library(fitdistrplus)
- data("Prestige")
- stat<-as.data.frame(matrix(c(
- mean(Prestige$prestige),
- length(Prestige$prestige),
- min(Prestige$prestige),
- max(Prestige$prestige) ,
- range=max(Prestige$prestige)-min(Prestige$prestige) ,
- sd(Prestige$prestige) ,
- median(Prestige$prestige),
- quantile(Prestige$prestige, probs=0.25),
- quantile(Prestige$prestige, probs=0.75),
- skewness(Prestige$prestige),
- kurtosis(Prestige$prestige),
- IQR(Prestige$prestige),
- mean(Prestige$prestige, trim=0.05),
- mean(Prestige$prestige, trim=0.1),
- winsor.mean(Prestige$prestige, trim=0.05),
- winsor.mean(Prestige$prestige, trim=0.1)
- ), nrow=1)
- )
- colnames(stat)<-c("mean", "length", "min", "max", "range", "sd", "median", "q25", "q75", "skewness", "kurtosis", "IQR",
- "mean 0.05", "mean 0.1", "wins 0.05", "wins 0.1")
- #dopasowanie rozkladu
- qplot(Prestige$prestige, geom="histogram", xlab = "prestige")
- plot(density(Prestige$prestige), main ="Gęstość zmiennej prestige")
- stat2<-fitdist(Prestige$prestige, "norm")
- plot(fitdist(Prestige$prestige, "norm", "mle"))
- plot(fitdist(Prestige$prestige, "norm","mge"))
- cor(Prestige$prestige, Prestige$education)
- cor(Prestige$prestige, Prestige$income)
- ks.test(Prestige$prestige, "pnorm", mean=46.83333, sd=17.11994)
- limits<-c(0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100)
- table<-classIntervals(Prestige$prestige,n=9, style="fixed", fixedBreaks=limits, intervalClosure = 'right')
- plot(table, pal=rainbow(length(limits) - 1), main='Prestige', xlab='Współczynnik prestiżu', ylab='procent zawodów')
- jenks.tests(table)
- #-----------regresja----------------------------------------------------------------------
- scatterplot(x=Prestige$income, y=Prestige$prestige, main="Income ~ Education")
- scatter.smooth(x=Prestige$income, y=Prestige$education, main="Income ~ Education")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement