Question

In: Statistics and Probability

~~~~~~~~~~~~TO BE COMPLETED USING RSTUDIO~~~~~~~~~~~~~~ ~~~~~~~~~~~~(PLEASE display all RCode used)~~~~~~~~~~~~~~ Goodness of Fit Microhabitat factors associated...

~~~~~~~~~~~~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.

  1. Create a vector of assumed probabilities and use it to obtain and display a vector of expected values, then check that the assumptions required for this test are satisfied.

  2. Find the P-value of the statistic using the appropriate chi-squared distribution.

  3. Plot the distribution, a vertical line at the value of the test statistic, and show the P-value in the plot.

  4. Verify that your statistic and P-value are correct by using the chisq.test instruction (if less than 10^ (-10),

    consider both as zero).

  5. (h) Do these data provide evidence that barking deer prefer to forage in certain habitats over others? Explain.

THIS MUST ALL BE COMPLETED AND DISPLAYED USING R STUDIO

Solutions

Expert Solution

observed <- c(12,22,66,392)

p <- c(.048,.147,.396,1-(.048+.147+.396))
expected <- sum(observed) * p

expected

y <- (expected -observed)^2/ expected
TS <- sum(y)
TS
p_val <- 1-pchisq(TS,3)
p_val

chisq.test(observed,p=p)

running code

observed <- c(12,22,66,392)
> 
> p <-  c(.048,.147,.396,1-(.048+.147+.396))
> expected <- sum(observed) * p
> expected
[1]  23.616  72.324 194.832 201.228
> y <- (expected -observed)^2/ expected
> y
[1]   5.713561  35.016108  85.189724 180.859304
> TS <- sum(y)
> sum(TS)
[1] 306.7787
> p_val <- 1-pchisq(TS,3)
> p_val
[1] 0
 chisq.test(observed,p=p)

        Chi-squared test for given probabilities

data:  observed
X-squared = 306.78, df = 3, p-value < 2.2e-16

c)
(Ei) = n * pi

d)

All Expected value should be greater than 5, hence the the assumptions required for this test are satisfied.

e)


X2 = 340.37

where DF is the degrees of freedom, k is the number of levels of the categorical variable, n is the number of observations in the sample, Ei is the expected frequency count for level i, Oi is the observed frequency count for level i, and X2 is the chi-square test statistic.

The P-value is the probability that a chi-square statistic having 3 degrees of freedom is more extreme than 340.37.

We use the Chi-Square Distribution Calculator to find P(X2 > 340.37) = less than 0.001.

Interpret results. Since the P-value (almost 0) is less than the significance level (0.05), we cannot accept the null hypothesis.

h) We have sufficient evidence in the favor of the claim that Barking deer prefer to forage in certain habitats over others.


Related Solutions

~~~~~~~~~~~~TO BE COMPLETED USING RSTUDIO~~~~~~~~~~~~~~ ~~~~~~~~~~~~(PLEASE display all RCode used)~~~~~~~~~~~~~~ Goodness of Fit Microhabitat factors associated...
~~~~~~~~~~~~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...
~~~~~~~~~~~~TO BE COMPLETED USING RSTUDIO~~~~~~~~~~~~~~ ~~~~~~~~~~~~(Please display all RCode used)~~~~~~~~~~~~~~ Regression Is there a relationship between...
~~~~~~~~~~~~TO BE COMPLETED USING RSTUDIO~~~~~~~~~~~~~~ ~~~~~~~~~~~~(Please display all RCode used)~~~~~~~~~~~~~~ Regression Is there a relationship between the number of stories a building has and its height? Some statisticians compiled data on a set of n = 60 buildings reported in the World Almanac. You will use the data set to decide whether height (in feet) can be predicted from the number of stories. data from buildings.txt. (Note that this is a text file, so use the appropriate instruction. If you...
~~~~~~~~~~~~TO BE COMPLETED USING RSTUDIO~~~~~~~~~~~~~~ ~~~~~~~~~~~~(Please display all RCode used)~~~~~~~~~~~~~~ Regression Is there a relationship between...
~~~~~~~~~~~~TO BE COMPLETED USING RSTUDIO~~~~~~~~~~~~~~ ~~~~~~~~~~~~(Please display all RCode used)~~~~~~~~~~~~~~ Regression Is there a relationship between the number of stories a building has and its height? Some statisticians compiled data on a set of n = 60 buildings reported in the World Almanac. You will use the data set to decide whether height (in feet) can be predicted from the number of stories. data from buildings.txt. (Note that this is a text file, so use the appropriate instruction. If you...
~~~~~~~~~~~~TO BE COMPLETED USING RSTUDIO~~~~~~~~~~~~~~ ~~~~~~~~~~~~(Please display all RCode used)~~~~~~~~~~~~~~ Independence Are all employees equally prone...
~~~~~~~~~~~~TO BE COMPLETED USING RSTUDIO~~~~~~~~~~~~~~ ~~~~~~~~~~~~(Please display all RCode used)~~~~~~~~~~~~~~ Independence Are all employees equally prone to having accidents? To investigate this hypothesis, a researcher looked at a light manufacturing plant and classified the accidents by type and by age of the employee. The observed results of the study are found below: Age Under 25 25 or over Total Sprain 1111 6161 7272 Burn 1818 1414 3232 Cut 1010 1212 2222 Total 3939 8787 126126 Determine whether age is independent...
Test the following hypotheses by using the χ2 goodness of fit test.
You may need to use the appropriate technology to answer this question. Test the following hypotheses by using the χ2 goodness of fit test. H0: pA = 0.40, pB = 0.40, and pC = 0.20 Ha: The population proportions are not pA = 0.40, pB = 0.40, and pC = 0.20. A sample of size 200 yielded 60 in category A, 120 in category B, and 20 in category C. Use α = 0.01 and test to see whether the...
Explain in detail a “Goodness-of-Fit” test and when and why this test would be used versus...
Explain in detail a “Goodness-of-Fit” test and when and why this test would be used versus any other analysis test.
A Chi-square test for goodness of fit is used to evaluate preferences for 8 different designs...
A Chi-square test for goodness of fit is used to evaluate preferences for 8 different designs of a new automobile. With a sample of n = 500 the researcher obtained a Chi-square statistic of Chi2 = 15.81. What is the correct statistical decision for this outcome (assume p <.05)? A. Reject the null hypothesis and conclude that there is no significant difference in preferences. B. Reject the null hypothesis and conclude that there is a significant difference in preferences. C....
Test the following hypotheses by using the χ2 goodness of fit test. H0: pA = 0.40,...
Test the following hypotheses by using the χ2 goodness of fit test. H0: pA = 0.40, pB = 0.40, and pC = 0.20 Ha: The population proportions are not pA = 0.40, pB = 0.40, and pC = 0.20. A sample of size 200 yielded 60 in category A, 20 in category B, and 120 in category C. Use α = 0.01 and test to see whether the proportions are as stated in H0. (a) Use the p-value approach. Find...
Using the following data (already sorted), use a goodness of fit test to test whether it...
Using the following data (already sorted), use a goodness of fit test to test whether it comes from an exponential distribution. The exponential distribution has one parameter, its mean, μ (which is also its standard deviation). The exponential distribution is a continuous distribution that takes on only positive values in the interval (0,∞). Probabilities for the exponential distribution can be found based on the following probability expression: . Use 10 equally likely cells for your goodness of fit test. Data...
Test the following hypotheses by using the χ 2 goodness of fit test. H 0: p...
Test the following hypotheses by using the χ 2 goodness of fit test. H 0: p A = 0.2, p B = 0.4, and p C = 0.4 Ha: The population proportions are not p A = 0.2 , p B = 0.4 , and p C = 0.4 A sample of size 200 yielded 60 in category A, 120 in category B, and 20 in category C. Use  = .01 and test to see whether the proportions are as stated...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT