Please just provide the R code. I just do not know how to do it by R. The accomp
ID: 3296119 • Letter: P
Question
Please just provide the R code. I just do not know how to do it by R.
The accompanying data resulted from an experiment in which seeds of five different types were planted and the number that germinated # within 5 weeks of planting was observed for each seed type ("Nondestructive Optical Methods of Food Quality Evaluation. Food # Science and Nutr., 1984: 232 279 Carry out a chi-squared test at level 01 to see whether the proportion of seeds that germinate the # specified period varies according to type of seed. Specifically, # a) Does the statement of the problem require a test of homogeneity of 2 populations with respect to 5 categories, or vice versa? # b) Compute the X^2, the df, and the p-value corresponding to your answer in part a. # c) State your conclusion "in English, " at significance level 0.05. # d) Diagnose the magnitude of the various terms in X_obs^2.Explanation / Answer
Statment of the problem doesnot require test of homogeniety of 2 populations with respect to 5 categories.
> type=c(1,2,3,4,5)
> G=c(31,57,87,52,10)
> NG=c(7,33,60,44,19)
> T=G+NG
> T
[1] 38 90 147 96 29
> p=G/T
> p
[1] 0.8157895 0.6333333 0.5918367 0.5416667 0.3448276
> N=sum(T)
> N
[1] 400
> E=N*p
> O=G
> O
[1] 31 57 87 52 10
> Chisq=(((O[1]-E[1])^2)/E[1])+(((O[2]-E[2])^2)/E[2])+(((O[3]-E[3])^2)/E[3])+(((O[4]-E[4])^2)/E[4])+(((O[5]-E[5])^2)/E[5])
> Chisq
[1] 757.929
> df=5-1
> pval=pchisq(Chisq,df,lower.tail=FALSE)
> pval
[1] 9.943699e-163
pval < alpha =0.01
Reject the null hypothesis.