Stata be the master Stata After I have
Stata – be the master Stata
“After I have run my standard commands, what can I do to make my model better (and understand better what is going on)? ”
Using dummies with interval variables can help improve fit - Create two extra dummies: one for here and one for here - Or (typically when you have a lot of data points): create dummies per group
Variables need not be normally distributed … but it is often nice if they are (and gladder price will give you a graphical representation as well)
interact. ado • A command to generate interaction effects • Centralizes automatically for interval variables (and that’s important) interact var 1 var 2, gen(var 1_X_var 2) Installation: + Download diagfiles. zip online + Put files in some folder + Add that folder to adopath (adopath + “/folderpath”) (+ Add this adopath statement to “profile. do”)
Interpreting interactions: when you have interactions, “there are no main effects any more”
Potential transformations - fracpoly … and there are several options, for instance to decide on the space of searched transformations
fracplot shows the estimated shape
Finding outliers - diag 2. ado (but only possible after regress, and you have to keep thinking yourself!)
The better way to find outliers in logit: ldfbeta (“findit ldfbeta”)
Note: Actually not completely Correct. Better (but more tedious), is to standardize the X-variables first.
Other possibilities … • Try to find a subset of your data for which your model works better / differently (typically easier when you know something about the topic substantially) • Consider sequences of models, instead of focusing on “the best model”:
Sequences of models (easiest when you do not have that many variables)
Handy bits of coding global VARS var 1 var 2 var 3 … reg y $VARS forvalues i = 1/10 { gen var`i’ = (varindata == `i’) }
Granddad talking: More buttons get rid of determination … zebra
squeeze, but be honest
To Do • Back to your logistic regression assignment. • Compare what others have done with the dataset that you had. • Improve, squeeze, and deliver one assignment (make that a do-file) per data set
- Slides: 17