I'm new to using R. I'm attempting to create a microsimulation of individuals health through time. To do this, I have two survey datasets with the same variables. First, a large base file, second a smaller but more detailed health transition dataset. The outcome variable is self-reported health with three states (1 - good, 2 - fair, 3 - poor), the predictors - Age (continuous), health at time t-1, marital status, highest educational qualification, housing tenure and socio-economic social group.
I have conducted a multinomial logistic regression (test) on the second dataset and now wish to use the predict function to apply this to the larger, fist base dataset. In an ideal world, this will be in the form of predicted category probabilities, that I can then generate random numbers (0,1), and assign new health states.
Currently the best I can come up with is:
test <- multinom(health5 ~ ContAge1 + health4 + marstat1 + highqual1 + tenure1 + socstat1, data = EW5FDR)
newpred <- predict(test, newdata = base, type = "c")
This appears to give me predicted outcome category for the new dataset, my question is: how would I change this to give me predicted category probabilities?
And indeed, is this the correct function to be using in the first place?
type="probs"
. $\endgroup$