I have made a lot of logistic regression with one binary independent variable on a lot of different binary dependent variables. The models includes both categorical and continous control variables. The interpretation of the coefficients are not intuitive, so I want to show the predicted probabilities of the dependented variables when my independent variable is 0 and 1, repsectively, with the control variables set to mode or mean (for categorical and continous control variables, respectively).
In the auto data, this is what I try to do:
Can anyone help with specifying the ", at"-option correctly? What I am trying to do is calcalute the predicted probabilities for 'foreign' for cheap and expensive cars when rep is at its mode and length is at its mean. Since in my real data, I have many models and varibles, manually inserting the values of the modes and means would be very time consuming.
In the auto data, this is what I try to do:
Code:
sysuse auto, clear recode price (0/5000 = 1 "Cheap") (5001/999999 = 0 "Expensive"), gen(cheap) logit foreign i.cheap i.rep length margins cheap, at(rep=mode length=mean)
Comment