betafunctions (version 1.2.2)

Beta.2p.fit: Method of Moment Estimates of Shape-Parameters of the Two-Parameter (Standard) Beta Distribution.

Description

An implementation of the method of moments estimation of two-parameter beta distribution parameters. Given a vector of values, calculates the shape parameters required to produce a two-parameter beta distribution with the same mean and variance (i.e., the first two moments) as the observed-score distribution.

Usage

Beta.2p.fit(scores)

Arguments

scores

A vector of values to which the two-parameter beta distribution is to be fitted. The values ought to fall within the [0, 1] interval.

Value

A list of parameter-values required to produce a Standard two-parameter beta distribution with the same first two moments as the observed distribution.

Examples

Run this code
# NOT RUN {
# Generate some fictional data. Say, 100 individuals take a test with a
# maximum score of 100 and a minimum score of 0.
set.seed(1234)
testdata <- rbinom(100, 100, rBeta.4P(100, .25, .75, 5, 3)) / 100
hist(testdata, xlim = c(0, 1), freq = FALSE)

# To fit and retrieve the parameters for a two-parameter beta distribution
# to the observed-score distribution using Beta.2p.fit():
(params.2p <- Beta.2p.fit(testdata))
curve(dbeta(x, params.2p$alpha, params.2p$beta), add = TRUE)
# }

Run the code above in your browser using DataLab