Difference between revisions of "Beta distributions"
From Organic Design wiki
m |
m |
||
| Line 5: | Line 5: | ||
For help on functions which create/manipulate beta distributions see; | For help on functions which create/manipulate beta distributions see; | ||
<table class=document-code><tr><td> | <table class=document-code><tr><td> | ||
| − | ?beta | + | ?beta # or help(beta) |
| − | ?rbeta | + | ?rbeta # or help(rbeta) |
</table> | </table> | ||
Usage examples are provided at; | Usage examples are provided at; | ||
| Line 17: | Line 17: | ||
</table> | </table> | ||
| + | Lets generate a beta distribution using the ''rbeta'' built in R function. | ||
| + | <table class=document-code><tr><td> | ||
| + | # Alter the parameters | ||
| + | n <- 1000 # Number of observations | ||
| + | p <- 0.1 | ||
| + | q <- 0.1 | ||
| + | |||
| + | x <- rbeta(n, shape1= p, shape2=q) | ||
| + | breaks <- seq(0,1, length=21) | ||
| + | hist(x, breaks=breaks) | ||
| + | </table> | ||
==See also== | ==See also== | ||
[[BetaDistributions.R]] | [[BetaDistributions.R]] | ||
[[Category:R]] | [[Category:R]] | ||
Revision as of 03:16, 2 August 2006
Beta distributions
For details on the beta distribution see WikiPedia:Beta distribution.
R programming language
For help on functions which create/manipulate beta distributions see;
|
?beta # or help(beta) ?rbeta # or help(rbeta) |
Usage examples are provided at;
example(beta) example(rbeta) example(dbeta) example(pbeta) example(qbeta) |
Lets generate a beta distribution using the rbeta built in R function.
# Alter the parameters n <- 1000 # Number of observations p <- 0.1 q <- 0.1 x <- rbeta(n, shape1= p, shape2=q) breaks <- seq(0,1, length=21) hist(x, breaks=breaks) |



