Description Usage Arguments Value Author(s) Examples
View source: R/fit_dist_norm.R
This function fits offspring data to a special case of the normal distribution, in which zero and negative values of offspring are excluded, and tests the goodness of fit using the chi-squared test.
1 |
dist |
a numeric vector of data values for number of offspring per dam. |
estimate |
Mean and standard deviation parameters estimated from the supplied distribution. |
sd |
Standard deviation of the mean and standard deviation estimates. |
vcov |
Variance/covariance matrix of the mean and standard deviation estimates. |
loglik |
the log-likelihood of the mean and standard deviation estimates. |
n |
The number of observations. |
statistic |
The chi-squared test statistic. |
parameter |
Degrees of freedom for the chi-squared test. |
p.value |
P-value for the chi-squared test. |
data_norm |
Vector of values generated from a special case of the normal distribution. |
M. Catherine Duryea, Andrew D. Kern, Robert M. Cox, and Ryan Calsbeek
1 2 3 4 5 6 7 8 | #Fit the Mean and Standard Deviation parameters to a distribution of offspring.
#Test the goodness of fit.
data(fungus)
fungus_fit<-fit_dist_norm(fungus$Total_Offspring)
fungus_fit$fit_norm
fungus_fit$chi_norm
fungus_fit$data_norm
|
Loading required package: MASS
Warning message:
In chisq.test(dist, data_norm) : Chi-squared approximation may be incorrect
mean sd
14.333333 10.330645
( 2.982200) ( 2.108734)
Pearson's Chi-squared test
data: dist and data_norm
X-squared = 54, df = 48, p-value = 0.2559
[1] 6 31 21 15 11 7 27 15 7 8 21 13
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.