0

In R, given a multinomial linear logit regression, I would need to obtain the conditional probability given some values of the predictors.

For example, using the function multinom from the package nnet, imagine to have computed fit <- multinom(response ~ predictor). From fit, how can I obtain the probability weights of the different response classes, given a certain value of the predictor?

I thought of using something like predict(fit,newdata,type=???), but I have no idea about how to continue.

Pippo
  • 1,543
  • 3
  • 21
  • 40

1 Answers1

0

I found a possible solution: predict(fit, newdata = predictor, "probs"). In this way, I was able to find the probability weights for all the values of the predictor: every row corresponds to a certain value.

Pippo
  • 1,543
  • 3
  • 21
  • 40