I have to generate one random sample with n= 20, from beta distribution(alpha=5,beta=1) and calculate MLE for alpha. I did this using the function rbeta and ebeta:
alfa = 5
beta=1
n = 20
sample<- rbeta(n,alfa,beta)
mle_alfa <- ebeta(proba, method = "mle")$parameters[1]
But the I have to Repeat point it 1000 times(i.e.generate1000 samples)and draw histograms,box-plots and q-qplots for
I tried repeating it wihout for loop like this, but I dont know if it's correct and how to use it to draw the plots. Can you please help me? Thank you!
sample2<- sapply(1:1000, function(x) rbeta(n,alfa,beta))
sample2<- as.numeric(sample2)