Categories
Uncategorized

blog post 13

In this assignment we have to originally devide the dataset to train R to making a better logistic regression model from our data. I used the code below to do this.

This code made our 2 datasets which we will be using. After this I built my logistic regression model with 2 factors.

This model is built based off our training data that we divided in R beforehand. All of my predictors are significant, so I will use them in my model equation. The model equation is

log(p/(1-p))= -3.26 + 1.074* revol_until + (-0.000034)* total_pymnt.

(P is the probability of bankruptcy)

After this now we put in code to make predictions for my test set using the model equation I made. The code is shown below.

After I have created a prediction equation, I will round the probabilities into positive or negative cases for bankruptcy.

Now since all these variables are 1’s and 0’s, I will create these matracies, but this is where I ran into problems. I could not find solutions to the problems online or on Yellowdig, THE END.

Here are the errors I ran into.

My length could never reach the same size as well, they were off by 80 and I couldn’t find a solution to the problem. I even tried to run the d=na.omit(d) code and it gave me this problem shown below, and also it made the length of trnactual 0.

Thank you for reading.

Leave a comment

Design a site like this with WordPress.com
Get started