Basic commands Flashcards

1
Q

wildcards

A
    • random string

? - one character

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

create a new variable

A

generate [new variable name] = function

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

DELETE A VARIABLE

A

drop [variable name]

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

CREATE A NORMALLY DISTRIBUTED VARIABLE

A

generate [new variable name] = rnormal()

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

SHOW DATA

A

list [variable name]

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

CONVERT STRING VARIABLE TO NUMERIC VARIABLE

A

destring [string variable name], replace|generate

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

DECLARE DATA SET TO BE TIME SERIES

A

tsset [date variable]

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

USE A SUBET OF THE DATA

A

regress … if [variable] [condition]

. indicates a missing observation and has a large value; hence, “if [variable] < .” omits missing variables
& indicates “and”
== indicates “equality”
| indicates “or”

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

OLS REGRESSION

A

regress [dependent variable] [regressor 1] [regressor 2] … [regressor N]

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

OLS REGRESSION WITH HETEROSKEDASTICITY CORRECTION

A

regress [dependent variable] [regressor 1] [regressor 2] … [regressor N], vce(hc3)

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

PANEL REGRESSION (GLS when using random effects)

A

xtreg [dependent variable] [regressor 1] [regressor 2] … [regressor N], [option]

For [option], use RE for random effects, BE for time-specific fixed effects, and FE for cross-sectional fixed effects.

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

Prediction

based on last run OLS

A

predict [new variable name]

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

Forecast Standard Error

based on last run OLS

A

predict [new variable name], stdb

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

Residuals

based on last run OLS

A

predict [new variable name], residuals

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

Estimated covariance matrix:

based on last run OLS

A

estat vce

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

Residual plus fixed effects (total residual)

based on last run Panel Data regression

A

predict [new variable name], ue

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q
Fixed effects (individual specific residual component)
(based on last run Panel Data regression)
A

predict [new variable name], u

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

Non-specific residual:

based on last run Panel Data regression

A

predict [new variable name], e

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

TEST FOR NORMALITY

A

sktest [variable name]

Note: The null hypothesis is normality.

20
Q

PORTMANTEAU (Q) TEST FOR SERIAL CORRELATION

A

wntestq [variable name], lags(#)

21
Q

CORRELOGRAM

A

corrgram [variable name]

22
Q

BREUSCH-PAGAN TEST FOR HETEROSKEDASTICITY

A

hettest

run this after running a regression

23
Q

TESTS FOR ENDOGENEITY

A
estat endogenous
(run this after running a regression)
24
Q

Transformation:

First difference in the variable

A

D.[variable name]

25
Q

Transformation:

Variable lagged on period

A

L.[variable name]

26
Q

GRAPHING

A

twoway (scatter [y1 variable] [y2 variable] … [x variable])

plot [y variable] [x variable]

27
Q

Write all subsequent commands and output to a file

A

log using [filename]

28
Q

Write all subsequent commands and output to a text file

A

log using [filename], text

29
Q

Suspend logging

A

log off

30
Q

Resume loggin

A

log on

31
Q

Stop logging and closes the log file

A

log close

32
Q

RESTRICT OPERATION TO A SUBSET OF THE DATA

A

[command] in [starting observation]/[ending observation]

33
Q

GENERATE CORRELATION MATRIX

A

correlate [variable name, variable name, …]

34
Q

Gives number of observations, mean, standard deviation, minimum value, and maximum value of all variables in a list

A

summary [variable name, variable name, …]

35
Q

Give summary measures for all variables

A

summary

36
Q

Gives a large number of summary measures, including median, skewness, and kurtosis

A

summary [variable name], detail

37
Q

Gives the result of arithmetic operations on two or more variables, i.e. +, -, /, *, ^. Also used for logarithmic (log(argument)) and exponential (exp(argument)) operations.

A

display [arithmetic operation]

38
Q

Gives Pr(Z < z) for a standard normal variable Z.

A

display normal(z)

39
Q

Gives the value z for which Pr(Z < z) equals p, Z~N(0,1)

A

display invnormal(p)

40
Q

Gives Pr(T > t) for a t-distributed variable T with n degrees of freedom

A

display ttail(n,t)

41
Q

Gives the value t for which Pr(T>t) equals p, for a t-distributed variable T with n degrees of freedom

A

display invttail(n,p)

42
Q

Gives Pr(F>f) , for an F-distributed variable F with n1 and n2 degrees of freedom

A

display Ftail(n1,n2,f)

43
Q

Gives the value f for which Pr(F > f) equals p, for an F-distributed variable F with n1 and n2 degrees of freedom

A

display invFtail(n1,n2,p)

44
Q

Searches help and online databases for information on the command or statement

A

FINDIT [command]

45
Q

Provides help on a specific command

A

HELP [command]

46
Q

Searches help text for the specified terms

A

SEARCH [terms]