~~~~~~~~~~~~TO BE COMPLETED USING RSTUDIO~~~~~~~~~~~~~~
~~~~~~~~~~~~(Please display all RCode used)~~~~~~~~~~~~~~
Goodness of Fit
Microhabitat factors associated with forage and bed sites of barking deer in Hainan Island, China, were examined. The sample of 477 examined sites where the deer forage were categorized by habitat as follows:
Habitat | Woods | Cultivated grassplots | Deciduous forests | Other |
Deer forage sites | 15 | 16 | 50 | 386 |
In this region, woods make up 4.8% of the land, cultivated
grassplots make up 14.7%, and deciduous forests make up
39.6%.
Do these data provide convincing evidence that barking deer prefer
to forage in certain habitats over others? Answer this research
question by conducting a goodness of fit test at 0.01 significance
level. Follow the steps outlined in the assignment
instructions.
(a) Write the null and alternative hypotheses for this test.
(b) Create a vector of observed values.
(c) Create a vector of assumed probabilities and use it to obtain and display a vector of expected values.
(d) Check that the assumptions required for this test are satisfied.
(e) Obtain the value of the test statistic using the observed and expected vectors from (b) and (c).
(f) Find the P-value of the statistic using the appropriate chi-squared distribution. Plot the distribution, a
vertical line at the value of the test statistic, and show the P-value in the plot.
(g) Verify that your statistic and P-value are correct by using the chisq.test instruction (if less than 1010,
consider both as zero).
(h) Do these data provide evidence that barking deer prefer to forage in certain habitats over others?
Explain.
Get Answers For Free
Most questions answered within 1 hours.