Introduction and disclaimer
The data simulated here pertains to a specific set of assumptions, and we should not try to extend the results beyond that without seriously considering and accounting for any systematic differences between that situation and any broader situation.
The data analysed here is inherently random. If the study were to be repeated then the results will differ.
While the computer software used is tried and tested, the analysis involves multiple human elements.
Kurtosis
First we define the sample kurtosis function, as well as a matrix version.
Source: Wikipedia
kurtosis1 <- function(x) {
xstand <- x - mean(x)
kurt <- (mean((xstand)^4))/((mean((xstand)^2))^2)
return(kurt)
}
kurtosis <- function(X) { apply(X,2,kurtosis1) }
Generate samples
We select the range of sample sizes and generate a matrix of samples arranged in columns, for each size.
samplesizes <- seq(minsize<-100,maxsize<-10000,stepsize<-50)
nsizes <- length(samplesizes)
nsample.persize <- 500
samples <- vector('list',nsizes)
for (i in 1:nsizes) {
samples[[i]] <- matrix(rnorm(samplesizes[i]*nsample.