讲解:MT5761、Statistical Modelling、Java,Python,C++Prolog|R

MT5761: Statistical Modelling1 Week 3 Practical• Marks allocated for each question are indicated inside square brackets.• This practical is to be submitted by Wednesday 20th November 2019 at noon1.1 Modelling count data using Generalised Linear ModelsIn this section we are going to:• Using a Poisson GLM to fit a model to the counts (per unit area)• Use model selection tools to choose covariates from those available• Interpret some parameter estimates from a fitted modelIn this practical we will continue to use the same data from previous practicals, but adopt a differentmodelling strategy. You will need to load the data as before and convert three of the variables in thedata set into factors:EIA$impactEIA$MonthOfYearEIA$Year attach(EIA)1.1.1 Initial Model FittingFit a Poisson-based GLM using a square-root link function, 7 covariates and 2 year-based interactionterms. Use the following code:fit.poisSqrtMonthOfYear + Year + x.pos + y.pos +Year:x.pos + Year:y.pos, data=EIA,family=poisson(link=sqrt))11. If the linear predictor for the fit.poisSqrt model is:ηit = β0 + β1x1it + ... + β26x26itand the coefficients are listed in the order of the output produced using the code above, which ofthe following describes the fit.poisSqrt model when the tide is ’Slack’, in Month 10 and Year10? [1](a) ηit = β0+β2x2it +β3x3it +β4x4it +β13x13it +β16x16it +β19x19it +β20x20it +β21x21it +β24x24it(b) ηit = β0 + β1x1it + β2x2it + β3x3it + β4x4it + β5x5it + β6x6it + β7x7it + β8x8it + β9x9it +β10x10it + β11x11it + β12x12it + β13x13it + β16x16it + β19x19it + β20x20it + β21x21it + β24x24it(c) ηit = β0 + β1x1it + β2x2it + β3x3it + β4x4it + β5x5it + β6x6it + β7x7it + β8x8it + β9x9it +β10x10it + β11x11it + β12x12it + β13x13it + β14x14it + β15x15it + β16x16it + β17x17it + β18x18it +β19x19it + β20x20it + β21x21it + β22x22it + β23x23it + β24x24it + β25x25it + β26x26it(d) ηit = β0+β1x1it +β2x2it +β4x4it +β13x13it +β16x16it +β19x19it +β20x20it +β21x21it +β24x24it(e) The correct answer is not provided as an option.2. Which of the following BEST describes the fit.poisSqrt model? [1](a) yit ∼ Poisson(λit = η2it)(b) yit ∼ Poisson(λit = exp(ηit)areait)(c) yit ∼ Poisson(λit = η2itarea2it)(d) yit ∼ Poisson(λit = exp(η2it))(e) yit ∼ Poisson(λit = exp(ηit))Fit a Poisson-based GLM using a log link, 7 covariates and 2 year-based interaction terms. Usethe following code:fit.poisMonthOfYear + Year + x.pos + y.pos +Year:x.pos + Year:y.pos, data=EIA, family=poisson)3. If the linear predictor for the fit.pois model is:ηit = β0 + β1x1it + ... + β26x26itand the coefficients are listed in the order of the output produced using the code above, which ofthe following describes the fit.pois model when the tide is ’Flood’, in Month 1 and Year 12?[1]2(a) ηit = β0 + β1x1it + β3x3it + β4x4it + β18x18it + β19x19it + β20x20it + β23x23it + β26x26it(b) ηit = β0 + β1x1it + β2x2it + β3x3it + β4x4it + β5x5it + β6x6it + β7x7it + β8x8it + β9x9it +β10x10it + β11x11it + β12x12it + β13x13it + β14x14it + β15x15it + β16x16it + β17x17it + β18x18it +β19x19it + β20x20it + β21x21it + β22x22it + β23x23it + β24x24it + β25x25it + β26x26it(c) The correct answer is not provided as an option.4. Which of the following BEST describes the fit.pois model? [1](a) yit ∼ Poisson(λit = η2it)(b) yit ∼ Poisson(λit = exp(ηit)areait)(c) yit ∼ Poisson(λit = η2itarea2it)(d) yit ∼ Poisson(λit = exp(η2it))(e) yit ∼ Poisson(λit = exp(ηit))Refit the Poisson model with a log link and an offset term (using area as an effort term) and checkfor collinearity using the VIF function.5. Which of the following about collinearity is FALSE? [1](a) While there are no concerns about collinearity in this case, the standard errors for the yearcoefficients are twice the size of what they would be if x.pos was not included.(b) The values in the GV IF(1/(2∗Df)) are used to quantify collinearity when there is more thanone coefficient associated with one or more of the model covariates.(c) Fitting collinear covariates together in a model can result in unstable estimates with largestandard errors.(d) Ignoring intolerable levels of collinearity in a model can result in one or more covariatesbeing excluded from the model due to large p-values.(e) One remedy for collinearity is to exclude one of the collinear covariates from the model andrefitting the new model.1.1.2 Model SelectionCompare the AIC scores for the fit.pois, fit.poisSqrt and fit.poisOff models.6. Which of the following about these AIC results is FALSE? [1]3(a) Comparing the AIC scores for the fit.pois and fit.poisOff models is not useful todetermine which model is preferable.(b) In this case, the offset must be specified using the log() function owing to the log linkfunction used.(c) We can use details about the survey design (and survey implementation) to help us decideif an offset term is required.(d) If the survey effort is uneven and we fail to include this information in the model, then wemay draw false conclusions about model covariates.(e) An equivalent alternative to including an offset term in a model is to include the effortcovariate in the model, to account for uneven survey effort.7. Carry out automated stepwise selection on the fit.poisOff governed by the AIC and BICcriteria: call these new models step.poisOff and step.poisOff BIC respectively (as beforeset direction = both). Based on these stepwise-selection results, which of the following isFALSE? [1](a) The model selection results are the same regardless of whether the AIC and BIC criteria areused.(b) The model chosen using the AIC score suggests that the relationship between the responseand the x-coordinate changes with year.(c) The model chosen using the BIC suggests the cost of including the DayOfMonth covariateoutweighs the benefits of doing so.(d) There are three coefficients allocated to the tidestate covariate because there are fourcategories for tidestate.(e) The model chosen using the AIC criteria assumes the relationship between the y-coordinateand the response is nonlinear in nature.8. Perform likelihood ratio test results using the Anova function for the step.poisOff BIC model.Based on these results, which of the following is FALSE? [1](a) The p-value associated with the interaction term, Year:x.pos is calculated by comparingthe test statistic of 73.8 with a reference χ2 distribution with df = 3.(b) Each p-value is based on comparisons between the likelihood values for a model with andwithout each covariate separately, while retaining all other covariates in the model.(c) While the (default) anova function always returns the same results as the (default) Anovafunction, we are using the latter here because it automatically returns p-values.(d) The Anova results suggests that all model terms should be retained in the model, regardlessof whether the 5% or 1% level is used to decide covariate retention.4(e) The Df column represents the number of coefficients associated with each model term.9. Carry out all-possible-subsets selection on代写MT5761、代做Statistical Modelli the step.poisOff BIC model using the dredge functionand the default ranking criteria. Based on these results, which of the following is FALSE?[1](a) The model ranked the highest in this case has a very similar AICc score to the secondranking model resulting in a very similar model weight.(b) We could use the model weights to ‘model-average’ which would result in model predictionswhich are a weighted average in line with the model weights.(c) While this function suggests no terms should be dropped from the BIC-selected model, thisfunction returns output which tells us how other candidate models compare with the highestranked model in this case.(d) For small sample sizes, the AICc might suggest a different model is preferred compared withresults obtained using the AIC.(e) This function investigates the fit of all possible models while the stepwise selection functiondoes not necessarily consider all candidate models.10. Based on the step.poisOff BIC model results, which of the following is FALSE? [1](a) There is no significant difference (at the 1% level) between average numbers (per unit area)in an EBB or FLOOD tide state.(b) There is no significant difference (at the 5% level) between average numbers (per unit area)in month 1 and months 8, 10, 11 or 12. Average numbers (per unit area) in all the othermonths are significantly different to average values in month 1.(c) While average numbers (per unit area) are significantly fewer in years 11 & 12 comparedwith year 9, there is no evidence for a different in average numbers in years 9 and 10.(d) The relationship between the x-coordinate and average numbers (per unit area) is signifi-cantly steeper in years 10 & 12 compared with the x-coordinate relationship in year 9.(e) The relationship between the y-coordinate and average numbers (per unit area) is significantlysteeper (at 5% level) in year 10 compared with the y-coordinate relationship inyear 9, but significantly shallower (at 5% level) in year 12 compared with the y-coordinaterelationship in year 9.11. Based on the step.poisOff BIC model, what is the predicted value on the scale of the response,when tidestate=EBB, observationhour=10, month=1, year=11, x.pos=-2061, y.pos=-1158 andthe area of the cell is the mean of the area of all cells in the EIA data set? Report your answerto 3 decimal places. [1]12. Based on the step.poisOff BIC model, what is the ratio of the predicted numbers in month 5compared to predicted numbers in month 1? Report your answer to 3 decimal places. [1]51.2 Modelling count data using overdispersed models1.2 Modelling count data using overdispersed modelsObjectives:In this section we are going to:• Check for overdispersion in our data (given our model)• Select the best model and make some (updated) predictions• Assess the fit of our final model1.2.1 Overdispersion13. Check for overdispersion in the step.poisOff BIC model using family=quasipoisson. Call thisnew model step.poisOffOD. Based on these results, what is the estimated dispersion parameter?Report your result to one decimal place. [1]14. Compare the p-values with the overdispersed model with the p-values obtained under a strictlyPoisson model (when the dispersion parameter=1). Which of the following is FALSE? [1](a) The strictly Poisson model and the overdispersed model return identical model coefficients,only the standard errors about these parameter estimates differ.(b) In all cases, the standard errors are larger under the overdispersed model since the dispersionparameter is estimated to be larger than 1.(c) A likelihood ratio test can be performed using the overdispersed model in the same way itis performed using the strictly Poisson model.(d) Larger standard errors result in larger p-values and thus ignoring overdispersion when it ispresent can result in model covariates being retained when there is no genuine relationshipwith the response.(e) Based on the p-values in the overdispersed model, both interaction terms would be droppedfrom the step.poisOff BIC model (at 5 % significance level).15. Based on the overdispersed results, is the following statement TRUE or FALSE? [1]While there is compelling evidence that average numbers (per unit area) change with the xcoordinateand y-coordinate, there is no evidence that either of these relationships change withyear.61.3 Model Diagnostics1.3 Model DiagnosticsIn this section we are going to:• Assess any residual patterns using the residualPlots function in the car library• Check for any correlation present in the residuals.• Assess what we have learned from this modelling process with reference to our researchquestions.Based on the analysis from the previous section update your model dropping insignificant covariatesand/or interaction terms.16. Using the residualPlots function in the car library in R, which of the following statementsabout linearity is TRUE? [1](a) The relationship of each covariate with the response is linear in a Poisson-based model.(b) The residualPlots function output tells us that we should remove tidestate from themodel.(c) The last plot is most appropriate for assessing whether the mean-variance relationship ismodelled appropriately.(d) observationhour has evidence of non-linearity on the link scale.17. Make a plot of observed vs fitted. Which of the following statements is FALSE? [1](a) Observed counts greater than 5 are severely under predicted.(b) A good fitting model should show scatter about the 45oline(c) There are negative fitted values.(d) The range of observed counts is larger than the range of predicted counts.18. Plot fitted values vs scaled residuals to assess the mean-variance relationship. Which of thefollowing statements is FALSE? [1](a) There is a known linear mean-variance relationship for a Poisson-based model.(b) There should be pattern in a plot of fitted vs scaled residuals for the mean-variance relationshipof an overdispersed Poisson-based model to hold.(c) It is difficult to tell from this plot whether the mean-variance relationship is appropriatelymodelled. Binning the data may help here.7(d) The variance of the final model increases at a rate approximately fifteen times faster thanthe mean.19. Use acf plots to determine the nature of any scaled residual correlation present. Which of thefollowing statements is FALSE? [1](a) The first data point is correlated with the 41st point(b) There is correlation through time within gridcodes(c) The acf plot indicates we should remove every 41st data point to deal with any correlationpresent.(d) If we re-order the data by gridcode, we may see a different pattern in the acf plot.20. Which of the following about summarising our model is FALSE? [1](a) The final model identified that there was a decline in animal density during the study period.(b) There was no spatially explicit decline identified(c) There was indication that some covariates are inappropriately modelled (e.g. should be triedas non-linear terms.)(d) If there is non-independence in the model residuals, the current p-values are likely to betoo small, which may lead to one or more covariates being kept in the model that should notbe.(e) We cannot use a GLS model with Poisson errors so therefore this is the best model we canachieve.8转自:http://www.3daixie.com/contents/11/3444.html

你可能感兴趣的:(讲解:MT5761、Statistical Modelling、Java,Python,C++Prolog|R)