讲解:Statistics、data、R、RC/C++|Python

Spatial Statistics Project1 Project overviewIn this project you will estimate the effects of air pollution and socio-economic variables on therisk of admission to hospital caused by respiratory disease. The data for the project cover the 7year period spanning 2003 to 2009 and describe annual hospital admissions across 624 electoralwards of Greater London. Each person will be individually assigned both a year and a dataset to work with. The data are contained in the file london_x.RData where x correspondsto your allocated data set, and once loaded, the data are in the form of an sp object calledlondon_x with geographical attributes included. Further information about the contents of thedata can be found in Section 4.2 Project tasks1. (a) Create a subset of your assigned data for the year you have been assigned.(b) Calculate the standardised incidence ratio (SIR) for respiratory disease and add thisas a new column to your data subset.(c) Use a spatial plot to explore SIR.(d) Use scatterplots to explore the association between SIR and PM25, JSA and Price.(10 marks)2. (a) Use BUGS and appropriate prior distributions to fit a Poisson regression model forrespiratory disease, making use of the columns Observed, Expected, PM25, JSA andPrice.(b) Use the Gelman-Rubin diagnostic (Rhat) and Geweke diagnostic plots to assesswhether convergence has been reached.(c) Calculate the Pearson residuals and use these to check the model assumptions.(10 marks)3. (a) Extend the model developed in 2. by including spatial random effects φ with aConditional-autoregressive prior distribution.(b) Use the Gelman-Rubin diagnostic (Rhat) and Geweke diagnostic plots to assesswhether convergence has been reached.(c) Calculate the Pearson residuals and use these to check the model assumptions.(10 marks)4. Construct a table with columns for DIC, Moran’s I statistic, variance of the Pearsonresiduals and the estimated effect of PM25 (and 95% credible interval) to critically comparethe models in 2. and 3. Using estimates from the better model, interpret the effect ofPM25 on the rate of respiratory hospital admission in Greater London.(10 marks)13 Report structure, content and submissionThe report itself does not need to follow any particular structure, however, you should ensurethat any analysis you carry out is clearly interpreted, using full sentences. You should writeas though your audience were your statistics classmates who are unfamiliar with the data.• The report should have a cover page with your name and student ID clearly marked• The report should be between 4 and 6 A4 pages in length including graphics and tablesbut excluding cover page and any references• Graphs should be suitably labelled, sensibly scaled and cropped• Numerical R outputs used to answer questions should be neatly presented in tables or inthe text• Your R code and BUGS code output should be included in an appendix• Please submit your report by midday on Wednesday 8th April via the uploadlink on Myplace.4 Some helpful R commandsYou will need to load the following packageslibrary(spdep)library(sp)library(R2WinBUGS)library(CARBayes)To load the data and produce a plot of PM25 (for example), useload(london.RData)spplot(london, PM25)To produce the adjacency matrix required for use in the moran.test functionWnb You will need the adjacency matrix attributes Adj, Num.Adj and SumNumNeigh for use inOpenBUGS to fit the conditional autoregressive model:W inds # the following 3 objects are needed to fit a conditional-autoregressive modelAdj Num.Adj SumNumNeigh 25 Data description - london.RDataColumn name DescriptionObserved Annual hospital admissions due to respiratory diseaseExpected Expected annual hospital admissions due to respiratory disease based onnational average rateJSA Proportion of electoral ward in receipt of jobseeker’s allowance, anunemployment benefitPrice Annual average sale price of homes (logged GBP)PM25 Annual average concentration of fine particulate matter PM2.5 (µgl−1)year Year of observation: 2003 to 2009 inclusive3转自:http://www.6daixie.com/contents/18/5058.html

你可能感兴趣的:(讲解:Statistics、data、R、RC/C++|Python)