Description Usage Arguments Author(s) Examples
Simulates continuous distribution given quantiles
1 | simValues(probabilities, quantiles, n)
|
probabilities |
numeric vector giving probabilities at which quantiles are estimated in the original dataset, e.g. for quartiles would be seq(0, 1, by=0.25). |
quantiles |
|
n |
number of observations to simulate from a continuous distribution |
Levi Waldron and Ragheed Al Dulaimi
1 2 3 4 5 6 7 8 | ##Simulate an original variable from a random exponential distribution
origvar <- rexp(1000)
## Use percentiles to simulate the distribution
probs <- seq(0, 1, by=0.01)
simvar <- simValues(probabilities=probs, quantiles=quantile(origvar, probs=probs), 1000)
##Use a QQ plot to show these distributions are comparable:
qqplot(origvar, simvar);
abline(a=0, b=1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.