I want to generate a dataset from the Exponential distribution, where 90%
of the observations are above a threshold value 0.15
. How to find the corresponding scale parameter for the Exponential distribution? How can I do this in R
? I wrote the following code in R
. In this case I found the scale parameter, b = 1.3
manually. But I want to repeat this process for 1000
times.
set.seed(12)
n = 50
threshold = 0.15
b = 1.3
Y <- rexp(n, b)
delta<-ifelse(threshold<=Y, 1, 0)
prop<-sum(delta==0)/n
prop