Description Usage Arguments Author(s) References Examples
fit.dist
fits the distributions in Chapter 4 of Lindsey (1995, 2003
2nd edn): binomial, beta-binomial, Poisson, negative binomial, geometric,
zeta, normal, log normal, inverse Gauss, logistic, Laplace, Cauchy, Student
t, exponential, Pareto, gamma, and Weibull to frequency (histogram) data,
possibly plotting the frequency polygon of fitted values with the histogram.
1 2 3 4 5 |
y |
Vector of observations. |
ni |
Corresponding vector of frequencies. |
distribution |
Character string specifying the distribution. |
breaks |
If TRUE, |
delta |
Scalar or vector giving the unit of measurement (always one for discrete data) for each response value, set to unity by default. For example, if a response is measured to two decimals, delta=0.01. |
censor |
If TRUE, the last category is right censored. |
exact |
If FALSE, uses the approximations for certain distributions in Lindsey (1995). |
plot |
If TRUE, plots the histogram of observed frequencies and the frequency polygon of fitted values. |
add |
If TRUE, adds a new frequency polygon of fitted values without replotting the histogram. |
xlab |
Plotting control options. |
ylab |
Plotting control options. |
xlim |
Plotting control options. |
main |
Plotting control options. |
... |
Plotting control options. |
J.K. Lindsey
Lindsey, J.K. (1995) Introductory Statistics: A Modelling Approach. Oxford: Oxford University Press.
1 2 3 4 5 6 7 8 9 10 11 12 13 | f <- c(215, 1485, 5331, 10649, 14959, 11929, 6678, 2092, 342)
y <- seq(0,8)
fit.dist(y, f, "binomial", plot=TRUE, xlab="Number of males",
main="Distribution of males in families of 8 children")
#
f <- c(1,1,6,3,4,3,9,6,5,16,4,11,6,11,3,4,5,6,4,4,5,1,1,4,1,2,
0,2,0,0,1)
y <- seq(1100,4100,by=100)
fit.dist(y, f, "normal", delta=100, plot=TRUE,
xlab="Monthly salary (dollars)",
main="Distribution of women mathematicians' salaries")
fit.dist(y, f, "log normal", delta=100, plot=TRUE, add=TRUE, lty=3)
fit.dist(y, f, "logistic", delta=100, exact=FALSE, plot=TRUE, add=TRUE, lty=2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.