Instructions (same as for STAC32): Make an R Notebook and in it answer the question below. When youare done, hand in on Quercus theoutputfrom Previewing (or Knitting) your Notebook. Donothand in theNotebook itself. You want to show that you can (i) write code that will answer the questions, (ii) run thatcode and get some sensible output, (iii) write some words that show you know what is going on and thatreflect your conclusions about the data. Your goal is to convince the grader that youunderstandwhat youare doing: not only doing the right thing, but making it clear that you knowwhyit’s the right thing.Donotexpect to get help on this assignment. The purpose of the assignments is for you to see how muchyouhave understood. You will find that you also learn something from grappling with the assignments. Thetime to get help is after you watch the lectures and work through the problems from PASIAS, via tutorialand the discussion board, that isbeforeyou start work on the assignment. The only reason to contact theinstructor while working on the assignments is to report something missing like a data file that cannot beread.You have 6 hours to complete this assignment after you start it.1. In 1985, a survey was carried out in El Salvador. 3185 married women were asked about their current useof contraception, classified as “sterilization”, “other” or “none”. Each woman’s age was also recorded.This was originally done as an age group, but for you the age given is the middle of the age group, whichwe will treat as quantitative. (We are thus assuming that all the women in the 25-29 age group wereactually exactly 27.5 years old, which of course they are not.)The data are inhttp://ritsokiguess.site/STAD29/el_salvador.csv. There are three columns, age, con-traception method and the number of surveyed women of that age (group) who used that contraceptionmethod.(a) Read in and display the data. Is there one woman or more than one woman per row of the dataset?(b) What kind of response variable do we have? What makes this a multinomial model? Explain briefly.(c) Fit a suitable multinomial model, predicting contraception from ageandage-squared, and displaythe output.(d) Demonstrate that the model with age-squared in it fits significantly better than one with just age.(e) For ages between 17.5 and 47.5 (inclusive) in steps of 5, obtain predicted probabilities that a womanof that age will use each of the contraceptives, and display each of the predictions appropriately.(f) Make a dataframe that shows theobserved proportionof women of each age that use each type ofcontraception. (This has nothing to do with any fitted model, so start with the original data.)(g) Make a suitable graph that contains both the observed proportions and the predicted probabilities,one that you can use to see how well the model fits the data. Pay some attention to the way thepredicted probabilities are laid out.(h) Comment briefly on how well the data fits the model, and the effect of including the age-squaredterm in the regression.2. The data inhttp://ritsokiguess.site/STAD29/six-mp.csvare survival times (in weeks) of cancer patientsgiven an experimental drug 6-MP or a control. (Each patient was randomly allocated to one of thetreatments.) Our aim is to see whether 6-MP is effective at prolonging life. Thestatuscolumn indicateswhether a patient was dead or still alive at last observation.(a) Read in and display (some of) the data.(b) In the context of this dataset, explain briefly what a “censored observation” is, and give an exampleof one.(c) Create and display a suitable response variable, calledy, for a Cox model for these data. How doyou know which observations are censored?(d) Fit a Cox proportional hazards model and display the output.(e) Do the two treatments differ significantly? If so, which one is better? Explain briefly.(f) Plot the estimated survival curves for each treatment.(g) Which treatment is better? Explain briefly. (This should be consistent with what you discoveredbefore about the better treatment, so the credit here is for your explanatio