View source: R/betafunctions.R
Beta.4p.fit | R Documentation |
An implementation of the method of moments estimation of four-parameter Beta distribution parameters presented by Hanson (1991). Given a vector of values, calculates the shape- and location parameters required to produce a four-parameter Beta distribution with the same mean, variance, skewness and kurtosis (i.e., the first four moments) as the observed-score distribution.
Beta.4p.fit(
scores,
mean = NULL,
variance = NULL,
skewness = NULL,
kurtosis = NULL
)
scores |
A vector of values to which the four-parameter Beta distribution is to be fitted. |
mean |
If scores are not supplied: specification of the mean for the target four-parameter Beta distribution. |
variance |
If scores are not supplied: specification of the variance for the target four-parameter Beta distribution. |
skewness |
If scores are not supplied: specification of the skewness for the target four-parameter Beta distribution. |
kurtosis |
If scores are not supplied: specification of the kurtosis for the target four-parameter Beta distribution. |
A list of parameter-values required to produce a four-parameter Beta distribution with the same first four moments as the observed distribution.
Hanson, Bradley A. (1991). Method of Moments Estimates for the Four-Parameter Beta Compound Binomial Model and the Calculation of Classification Consistency Indexes.American College Testing Research Report Series.
Lord, Frederic M. (1965). A Strong True-Score Theory, With Applications. Psychometrika, 30(3).
# 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, 0.25, 0.75, 5, 3))
hist(testdata, xlim = c(0, 100), freq = FALSE)
# To fit and retrieve the parameters for a four-parameter Beta distribution
# to the observed-score distribution using Beta.4p.fit():
(params.4p <- Beta.4p.fit(testdata))
curve(dBeta.4P(x, params.4p$l, params.4p$u, params.4p$alpha, params.4p$beta), add = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.