In: Statistics and Probability
alpha value is 0.05 if it is not specified in the problem.
**Everything should be in r code base.
4. Back to the iris dataset one last time! We wish to estimate the probability of a flower’s species based on the available measurements.
a. Build a Multinomial model to predict Species based on Sepal.Length. Use it to estimate the probability of each species for a flower with a sepal 6.3 cm long.
b. Build a Multinomial model to predict Species based on Petal.Length. Use it to estimate the probability of each species for a flower with a petal 5.1 cm long.
c. Compare both the residual deviances and the AICs for the two previous models. Which appears to be the “better” model based on these metrics?
d. Build a Multinomial model to predict Species based on all four of the measurements (no interactions). Use the model to estimate the probability of each species for a flower with a Sepal.Length of 6.3 cm, a Sepal.Width of 2.8 cm, a Petal.Length of 5.1 cm, and a Petal.Width of 1.5 cm.
e. The flower described in part d is actually in the dataset. What species was it?
Answer a.
Answer b.
Part c.
1. Deviance is a measure of goodness of fit of a model. Higher numbers always indicates bad fit. Model 1 has Residual Deviance of 182.0679 whereas Model 2 has residual deviance of 33.48589 which indicates Model 2 is better.
2. The model which has a less Akaike-Information-Criterion-(AIC) value is better than the other higher value. The Akaike information criterion (AIC) is an estimator of the relative quality of statistical models for a given set of data. Model 1 has AIC of 190.0679 while Model 2 has AIC of 41.48589 . Thus, Model 2 is Better based on AIC.
Part d.
Part e.
It is actually Virginica but has a greater probability of being Versicolor in part d.