Answered step by step
Verified Expert Solution
Question
1 Approved Answer
fik-/ ' i x fik '- nk- V XV - 'fi'*'- X'xfr'g/l > < X'Xxsx N ;5 ' x, X 'kx-i yfi; x' The
fik-/ ' i x" fik '- nk- V XV -" 'fi'*'- X'xfr'g/l >< X'Xxsx N ;5 ' x, " X 'kx-i yfi; x' The data can be entered into R as: - ' "fix 5 Li X . (Fk 7,' y1eld=c(123,128,166,151,156,150,178,125,112,174,187,117,100,116,153,155, - ' "mk 168,109,195,158,135,175,140,167,130,132,145,183,176,120,159,142,120,187, Xxb 131 , 167, 155, 184, 126, 168, 156, 186 , 185 , 175 , 180, 138 ,206 , 173 , 147 , 178, 188 , 154, '2 146,176,165,191,193,190,188,169) crop=as.factor(rep(c("W","C","S","R"),15)) fertilizer=as.factor(c(rep("X",20),rep("FS",20),rep("SS",20))) A text file containing these commands is at http://bsmith.mathstat.dal.ca/stat3340/assignments/ass316R.txt lf you put this address into a browser, you should be able to cut and paste into R. (a) Make separate boxplots of yield versus crop, and yield versus fertilizer. For example, "boxplot(yielchrop) ". Comment on the relationships between yield and crop, and yield and fertilizer. ab (b) Define indicator variables for the crop types W, C, and S, and for fertilizer types X and FS. For example, lW=ifelse(crop=="W",1,0) (c) Write down a linear model using the indicator variables for crop and fertilizer which allows for an interaction between crop and fertilizer. (Hint: your model should have two main effect " , terms for fertilizer, three main effect terms for crop type, and 6 interaction terms.) 'Y (d) Fit the multiple regression model using the lm command, and show the anova output. (e) Assess whether some fertilizers work better with certain crops. That is assess the null hypotheSIs that there is afointeraction between fertilizer and crop. i. State the hypotheses. ii. Write down the reduced model under the null hypothesis. iii. Fit the reduced model using the lm command, and show the anova output. iv. Calculate the F test statistic using the error sums of squares from the two anova outputs v. Calculate the P value (3) using the F table on the class w ' . ebsnte, and b ' usmg the F table, bound the p-value as accurately as possible. ( ) usmg Rn When vi. Give a conclusion in the context of the
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started