How I can draw a calibration plot for logistic regression in Stata? Indeed, we must be plot the observed vs. predicted odds. But, how can we calculate the observed odds in logistic model with binary outcome?
In relation your original question - it is possible if you have multiple observations for the same values of the predictor variable. A simple example Y is 1 = Vote left; Y= 0 is vote right; X1 =0 is Male ; X1 =1 = Female.
The raw binary data is
Y X
1 1
1 0
1 0
0 1
1 1
etc
this can be tuned into tabulation
Male Female Total
Vote Right 20 30 50
Vote Left 30 70 100
You can fit a binomial logit model to the Tabulation and get exactly the same results as a Bernoulli logit to the individual data. However in the case of the tabulation you can get observed odds by calculating ratios. A lot of software does this conversion unseen as you get the same results but with much fewer 'observations'.
Dear Doctor,I have been facing the same problem. With stata there's actually no command to obtain a calibration plot. Anyway, after fitting your MVA you can use the lowess function, after obtaining the linear prediction: