hello i need to find the mean of a sample of random numbers in an interval between -1 and 1 with a confidence interval of 95 % and then repeat the process 50 times i am using a for cycle that calculates the means for the 50 repetitions but when i apply it to the confidence interval it doesn't calculate the standard deviation i have this code
for (i in 1:50) {
n<-100
z[i] <-runif(min=-1,max=1,n)
m[i] <-mean(z[i])
s[i] <-sd(z[i])
sigma[i] <-1.96*(s[i] /sqrt(n))
ls[i] <-m[i] +sigma[i]
li[i] <-m[i] -sigma[i]
}