R STUDIO STATISTICS ----------------------------------------------------------------------------------------------------

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

R STUDIO STATISTICS ----------------------------------------------------------------------------------------------------

Post by answerhappygod »

R STUDIO
STATISTICS
R Studio Statistics 1
R Studio Statistics 1 (64.98 KiB) Viewed 75 times
R Studio Statistics 2
R Studio Statistics 2 (106.99 KiB) Viewed 75 times
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
THIS IS HOW TO GET THE DATASET:
R Studio Statistics 3
R Studio Statistics 3 (40.63 KiB) Viewed 75 times
QUESTION 3 [40] A study was conducted on children who had corrective spinal surgery. We are interested in factors that might result in kyphosis (a kind of deformation) after surgery. The data is available in a data frame kyphosis in rpart R package and can be loaded by library(rpart) data (kyphosis) The variables it contains are presented in the following table: Table 2: Variables and their description in kyphosis dataset. Variable Description Kyphosis a factor with levels absent present indicating if a kyphosis (a type of deformation) was present after the operation. Age in months Number the number of vertebrae involved Start the number of the first (topmost) vertebra operated on. You can also consult the help page on the data for further details. Answer the following questions.
(a) Make plots of the response as it relates to each of the three predictors. You may find a jittered scatterplot more effective than the interleaved histogram for a dataset of this size. Comment on how the predictors appear to be related to the response. (5) (b) Fit a GLM with the kyphosis indicator as the response and the other three variables as pre- dictors. Plot the deviance residuals against the fitted values. What can be concluded from this plot? (10) (c) Produce a binned residual plot as described in the additional notes of Learning Unit 3. You will need to select an appropriate amount of binning. Comment on the plot. (5) (d) Plot the residuals against the Start predictor, using binning as appropriate. Comment on the plot. (5) (e) Produce a normal QQ plot for the residuals. Interpret the plot. (3) (1) Make a plot of the leverages. Interpret the plot. (4) (g) Check the goodness of fit for this model. Create a plot of the observed probabilities against the predicted probabilities and comment on the result. Compute the Hosmer-Lemeshow statistic and associated p-value. What do you conclude? (8) (h) Use the model to classify the subjects into predicted outcomes using a 0.5 cutoff. Produce cross-tabulation of these predicted outcomes with the actual outcomes. When kyphosis is actually present, what is the probability that this model would predict a present outcome? What is the name for this characteristic of the test? (5)
EN 00 ол нь 10 00 OU AWNH Ол еш но HHHHUNT > library (rpart) > data("kyphosis") > kyphosis Kyphosis Age Number start 1 absent 71 3 5 2 absent 158 3 14 3 present 128 4 5 4 absent 2 5 1 5 absent 1 4 15 6 absent 1 2 16 7 absent 61 2 17 8 absent 37 3 16 9 absent 113 16 10 present 6 12 11 present 82 5 14 12 absent 148 3 16 13 absent 18 5 2 14 absent 1 4 12 15 absent 168 3 18 16 absent 1 3 16 17 absent 78 6 15 18 absent 175 5 13 19 absent 80 5 16 20 absent 27 4 9 21 absent 22 2 16 22 present 105 6 5 23 present 96 3 12 24 absent 131 2 3 25 present 15 7 2 26 absent 9 5 13 27 absent 8 3 6 28 absent 100 3 14 29 absent 4 3 16 30 absent 151 2 31 absent 31 3 16 32 absent 125 2 11 33 absent 130 5 13 nhront 59 HHHHHHH mmt in NNMNO mnm mouiNomNmmmNMN HHHH ON NA ONM WOOOOWN WNO OWO ONNO ANO 1 16 ليبيا بيا له WNO HHHHH PA 112 16
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply