KNOWLEDGEBASE - ARTICLE #2195

Plotting the beta distribution in Prism

When reading about prior distributions in Bayesian statistics, you'll see references to the beta distribution with two values that determine its shape. But note that the beta distribution is quite distinct from the beta function, which also has two arguments. Prism has the beta function built-in but not the beta distribution.  

Even though it is not built-in, it is easy to enter the beta distribution as a user-defined equation in Prism. The equation below works for X values between 0 and 1, and nonnegative values for A and B. The shape of the distribution depends on the values you enter for A and B. Beta( )is the beta function built-in to Prism.

Y= (1/Beta(A,B)) * X^(A-1) * (1-X)^(B-1)

Here is a graph with some examples.

Download the Prism file. 

Another way to approach it, is to specify what the mode should be and to express the width of the distribution as the effective sample size. With a larger sample size, you know the proportion more exactly so the distribution is narrower.  Kruschke (Doing Bayesian Analysis, 2nd edition page 138) gives the equations to compute A and B (the inputs to the beta distribution) from the mode (M) and effective sample size (N):

A=M*(N-2) + 1
B-(1-M)*(N-2) + 1
Y= (1/Beta(A,B)) * X^(A-1) * (1-X)^(B-1)

Here is an example with M= 0.85 and N=25. Prism file

Explore the Knowledgebase

Analyze, graph and present your scientific work easily with GraphPad Prism. No coding required.