desc <- function(mydata) {
require(e1071)
quantls <- quantile(x=mydata, probs=seq(from=0, to=1, by=0.25))
themean <- mean(mydata)
thesd <- sd(mydata)
kurt <- kurtosis(mydata)
skew <- skewness(mydata)
retlist <- list(Quantiles=quantls, Mean=themean,
StandDev=thesd,Skewness=skew, Kurtosis=kurt)
return(retlist)
}
# example
exampledata <- rnorm(10000)
summary(exampledata)
desc(exampledata)
"A big computer, a complex algorithm and a long time does not equal science." -- Robert Gentleman
giovedì 17 maggio 2007
Quick and dirty function for descriptive statistics
Iscriviti a:
Commenti sul post (Atom)
describe() from the psych package has similar functionality
RispondiEliminaThanks for your contribution!
RispondiElimina