mini stata commands Flashcards

1
Q

hypothesis test for mean of variable being x

A

ttest varname == x

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

hypothesis test for difference in means

A

ttest outcome, by (binaryvarname)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

hypothesis test for linear combination

A

lincom 2var1+3var2 for example

basically just lincom and then the combination

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

hypothesis test for multiple hypotheses

A

test (varname = x) (varname = y)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

normal regression

A

reg outcome var1 var2, robust

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

how to export a regression

A

reg command
outreg2 using namedoc.doc, sdec(4) bdec(4)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

how to run a regression within a range

A

reg outcome var1 var2, robust, if inrange(varname, lowerbound, upperbound)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

how to run fixed effects regression

A

egen panel_id = group(var1 var2)
xtset panel_id timevariableid

xtreg outcome interactionvarname i.timeidvariable, fe robust

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

iv regression command

A

ivregress 2sls outcome (fake_regressor = z1 z2), robust

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

predicted values

A

predict namethevar

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

predicted residuals

A

predict residual, resid

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

how to standardise

A

gen varname_standardised = varname/r(sd)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

how to log a variable

A

gen varname_log = ln(varname)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

scatter with line through

A

twoway (lfit outcome regressor) (scatter outcome regressor)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

regression discontinuity

A

gen fake_over = fake_regressor -1
gen over_one = fake_regressor >1
gen interact_RD = over_one * fake_over

reg outcome fake_over over_one interact_rd, robust

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

diff in diff regression

A

gen interaction = i*r

reg outcome i r interaction, robust

17
Q

first differences

A

gen stuff from fe first

reg diff_outcome diff_fake_regressor, robust