Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

CAMERON, C. e TRIVEDI, P.K. Microeconometrics Using Stata. Cambridge: CUP, 2010

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

CAMERON, C. e TRIVEDI, P.K. Microeconometrics Using Stata.

Cambridge: CUP, 2010.

dica: base de dados e ir observando comandos.

Manuais impressos (GS - getting startted) e online


Stata Journal (SJ) e Stata Technical Bulletin (STB)

Capítulo 1. StataBasics
operações: barra de comandos (+ rápido) ou menu interativo.

exemplos: describe e codebook

 update query
 help (help regress); sempre voltar ao help
 search(search regress, nocons)
 summarize (t*)
 regress
 by variable: command(sort, sum, reg)
 quietly command (exemplo sum)
 operator: aritméticos/relacionais/lógicos
o + (addition)
o – (subtraction)
o * (multiplication)
o / (division)
o ^ (raisedto a Power)
o > (greaterthan)
o < (lessthan)
o >= (greaterthan or equal)
o <= (lessthan or equal)
o == (equal)
o != (note qual)
o Logical operators: & (and), | (or), ! (not), ~(not)
 Do-files and log files: .do (program), .dta (database), .log (output), .txt (output)
o To create a log file in text form named example.txt, the usual command
is: log using example.txt, text replace
o In do-files:
 For single-line comments, begin the line with an asterisk (*)
 For a comment on the same line as a Stata command, use two
slashes (//) after the Stata command.
 For multiple-line comments, place the commented text between
slash-star (/*) and star-slash (*/).
 query/set
 scalar a=2
 display (2*2, 2/0)
 matrix (matrix define D = (1, 5 \ 6, 8); matrix list D; matrix invD = inv(D); matrix
list invD)
 r-class commands (analyze data but nor estimate parameters)
o return list (eg. sum before)
 e-class commands (estimation commands after a regression command)
o ereturn list (eg. reg before)
Capítulo 2. Data management and graphics
 clear
 use (read a stata dataset .dta)
 edit (enter data from the keyboard or the data editor
 insheet (read comma-separated or tab-separated text data created by a
spreadsheet)
 infile (read unformatted or fixed-format text data)
 infix (read formatted data)
 tabulate / table
 if
 replace
 generate(eg. gen attendancehigh=0, replace attendancehigh=1 if
attendance>=50000; tabulate rodada, generate(rodada); gen goals2=goals^2,
lgoals=log(goals)
 egen (combined with by)
 recode
 bysortvariable: command ….
 Indicator variables:
o quietly tabulate variable, generate(name_dummy)
 save (save only a stata data file)
 outsheet (save the dataset as comma-separated values spreadsheet):
o outsheetvariables using filename.csv, comma replace
 outfile (save a space-delimited formatted text file):
o outfilevariables using filename.asc, replace
 keep
 drop
 twoway scatter
 graph combine (scatter y attendance, salvar, scatter y rodada, salvar, gr
combine)
 histogram
 kdensity
 graph matrix (graph matrix y rodada goals)

Capítulo 3. Linear RegressionBasics


 Análise de regressão básica para análise de dados cross-section para variáveis
dependentes contínuas, para uma simples equação e regressores exógenos.
 Quebra de pressupostos vistos no capítulo: erros de especificação sobre a
média condicional, heterocedasticidade.
 Base de dados: futebol brasileiro EALR (2018).
- corr
- pwcorr y rodada goals, star(.1)
- reg y goals rodada (if), vce(robust)
- interpretação betas ?
- teste t e F global
- test var1 = var2 (wald de igualdade de coeficientes)
- test var1 var2
- corrouvif (mult)
- R2
- hettest / imtest, white / whitetst (instalar)

- reg y rodada goals


- predict yhaty
- sum y yhaty

- reg y rodada goals


- predict r, resid
- kdensity r, normal

- swilk r
- sfrancia r
- sktest r

kdensity (Kernel)
qreg (quantile)

You might also like