Mercier_Assingment7.docx - Template for Assignment 7u2014...

This preview shows page 1 - 3 out of 11 pages.

Template for Assignment 7—Predicting NSPNotes:First, please re-save this document on your computer, RENAMING the file to containyour last name. Point values of each part are shown below; 10 points will be allocated for the quality ofyour business writing (organization, clarity, grammar, etc.).Type or paste your responses into the boxes below. The boxes will expand to fit youranswers.Clasification and Prediction Models Model 1.Read the Cardiotocographic.csv data file into RStudio. Make sure to use NSP as a‘factor’ or ‘categorical’ variable for this assignment. Run set.seed(XXX) by usinglast three digits of your student ID in place of XXX followed by partitioning of thedataset into training (50%) and testing (50%). Report on how many cases of N,S, and P exist in the training and testing data. In addition, provide the code used.(10 pts).
3
3
Student NameJeffrey Mercier
Template for Assignment 7—Predicting NSPPage 2train <- Cardiotocographic[data==1,]test <- Cardiotocographic[data==2,]summary(train$NSP)summary(test$NSP)"Click here and paste in the R code used" 2.Develop a multinomial logistic regression model for predicting NSP based on thetraining dataset and report the final model, related code, prediction equations,confusion matrix for training and test datasets. What conclusions can youderive? (20 points): multinomialtrain$NSP <- relevel(train$NSP, ref = "1")mymodel <- multinom(NSP~. - LB - MLTV - Width - Max - Nzeros - Tendency - MSTV - Median, data = train)summary(mymodel)#z testz1 <- summary(mymodel)$coefficients/summary(mymodel)$standard.errorsp1 <- (1-pnorm(abs(z1), 0, 1)) * 2p1> p1(Intercept) AC FM UC DL DS DP ASTV ALTV2 0.0000000 0 9.400541e-04 0 0 0 0 8.253700e-10 7.82637e-023 0.3345782 0 3.012743e-05 0 0 0 0 9.571899e-11 1.53115e-07Min Nmax Mode Mean

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture