Good afternoon, I have a problem with the output I get when performing a logistic regression with NNET package. I want to predict Category with HS_TR (Return Period) and SLR (Sea Level Rise).
The multinomial model, called fit, has been calculated with the information from the x.sub subset. There are 4 different categories possible 1,2,3 or 4.
x.sub:
POINTID HS_TR SLR Category
4 10 0.0 3
4 10 0.6 4
4 50 0.0 3
4 50 0.6 4
4 100 0.0 4
4 100 0.6 4
When I run the model> fit <- multinom(Category ~ HS_TR + SLR, x.sub, maxit=3000) I get the results :
Coefficients:
(Intercept) HS_TR SLR
-30.5791517 0.4130478 62.0976951
Residual Deviance: 0.0001820405
AIC: 6.000182
Now that I have the multinomial, I want to know the predicted category for a specific scenario (d3) of SLR and HS_TR. I define d3 and apply the prediction and I get reasonable result:
d3<-data.frame("HS_TR"=c(10),"SLR"=c(0))
prediction <-(predict(fit,d3))
I get
> prediction
[[1]]
[1] 3
Level: 3
However, when I calculate the probability of getting the prediction prediction <-(predict(fit,d3, type="probs")), I get the following:
> prediction
[[1]]
1
0
Which makes no sense since it says that there is probability 0. Since the model I run gives a prediction of the CATEGORY, I don't understand why then, the probability is 0. Does someone know why I get it?
If someone knows how I could work on the problem so that I can solve it. Thank you in advance.