1 / 17

Stata – be the master

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

shauna
Download Presentation

Stata – be the master

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Stata – be the master Stata

  2. “After I have run my standard commands, what can I do to make my model better (and understand better what is going on)?”

  3. 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

  4. 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)

  5. interact.ado • A command to generate interaction effects • Centralizes automatically for interval variables (and that’s important) interact var1 var2, gen(var1_X_var2) Installation: + Download diagfiles.zip online + Put files in some folder + Add that folder to adopath (adopath + “/folderpath”) (+ Add this adopath statement to “profile.do”)

  6. Interpreting interactions:when you have interactions,“there are no main effects any more”

  7. Potential transformations - fracpoly … and there are several options, for instance to decide on the space of searched transformations

  8. fracplot shows the estimated shape

  9. Finding outliers - diag2.ado (but only possible after regress, and you have to keep thinking yourself!)

  10. The better way to find outliers in logit: ldfbeta(“finditldfbeta”)

  11. Note: Actually not completely Correct. Better (but more tedious), is to standardize the X-variables first.

  12. 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”: 

  13. Sequences of models(easiest when you do not have that many variables)

  14. Handy bits of coding global VARS var1 var2 var3 … reg y $VARS forvaluesi = 1/10 { gen var`i’ = (varindata == `i’) }

  15. Granddad talking: More buttons get rid of determination … zebra

  16. squeeze, but be honest

  17. 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

More Related