I have created an iid random sample of size n=20 from a standard normal distribution in R. I have a monte-carlo simulation with m=10^5 scenarios. I am trying to find the probability that the excess kurtosis of the sample lies between -1.5 and 1.5. So far, I have this code:
set.seed(1234)
n<-10
m<-10^5
sample.normal<- rep(0,m)
for(i in (1:m)){
x<-rnorm(n,0,1)
sample.normal[i]<-kurtosis(x,na.rm=FALSE)-3
}
#finding p(-1.5<y2<1.5)
y<-sample.normal
Z<-ecdf(y)
Z(1.5)-Z(-1.5)
However, now I want to change the sample size to a range of values between n=10 and n=200 to show how as the sample size increases, more values lie between -1.5 and 1.5. So I want to calculate the Z(1.5)-Z(-1.5) at 10,20,30,40....200 (bearing in mind m=10^5) (I am ultimately showing that with a larger sample size, excess kurtosis tends to that of a standard normal which is zero) How do I do this using a loop or a different method? Any suggestions would be appreciated.