stata – be the master

17
Stata – be the master Stat a

Upload: shauna

Post on 23-Feb-2016

56 views

Category:

Documents


0 download

DESCRIPTION

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 - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Stata  – be the master

Stata – be the master

Stata

Page 2: Stata  – be the master

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

Page 3: Stata  – be the master

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

Page 4: Stata  – be the master

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)

Page 5: Stata  – be the master

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”)

Page 6: Stata  – be the master

Interpreting interactions:when you have interactions,

“there are no main effects any more”

Page 7: Stata  – be the master

Potential transformations - fracpoly

… and there are several options, for instance to decide on the space of searched transformations

Page 8: Stata  – be the master

fracplot shows the estimated shape

Page 9: Stata  – be the master

Finding outliers - diag2.ado

(but only possible after regress, and you have to keep thinking yourself!)

Page 10: Stata  – be the master

The better way to find outliers in logit: ldfbeta(“findit ldfbeta”)

Page 11: Stata  – be the master

Note:Actually notcompletely Correct.

Better (but moretedious), is to standardize theX-variables first.

Page 12: Stata  – be the master

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”:

Page 13: Stata  – be the master

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

Page 14: Stata  – be the master

Handy bits of coding

global VARS var1 var2 var3 …reg y $VARS

forvalues i = 1/10 {gen var`i’ = (varindata == `i’)

}

Page 15: Stata  – be the master

Granddad talking:

More buttons getrid of determination …

zebra

Page 16: Stata  – be the master

squeeze, but be honest

Page 17: Stata  – be the master

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