1/56
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
Main types of data
Primary, secondary
Secondary data
information collected by someone other than the user, sometimes for another purpose
Primary data
information collected by the user for a specific purpose
Correlation
two variables move together
Causation
movement of one variable forces movement of another
Reasons why there can be correlation without causation
Third variable problem, directionality (reverse causation), coincidence
Third variable problem
omitted variable bias, outside variable forcing movement of both
Chicken and egg (reverse causality)
Which causes which
How to prove causation
randomized controlled trials (where all variables except one are constant, hard to do in economics in the real world), temporal sequence (prove one happened before the other)
GDP
gross domestic product, market value of all final goods and services per year, q x p
PPP
purchasing power parody, eg Big Mac index, currency translation more accurate than exchange rate
real vs. nominal GDP
real GDP uses an index year/holds inflation stable, nominal is in current year
continuous variables
variables (like income) that can be any value
discrete variables
1/0, eg yes/no
ȳ
mean of data set
comparison of means
ȳ-ȳᶜ
population variance equation
𝜎²=1/n Σ(yᵢ-ȳ)²
sample variance
s²=1/n-1 Σ(yᵢ-ȳ)²
standard deviation equation
√var Y
standard deviation intervals
if normal, 34.1 is 1SD 13.6 is 2SD 2.3 is 3SD
z-score, units
(yᵢ-ȳ)/SD, unitless
shaky
lots of spread
good estimator is
unbiased, efficient
unbiasedness
ȳ is centred on μ, E(ȳ)=μ
population mean
μ, E(y)=μ
ū
average deviation
efficiency
ȳ is close to μ
what is 𝜎² the population variance of
population variance of yᵢ
population variance of ȳ (variance of means)
𝜎ȳ², E((y-μ)²)
covariance
2E(x-μx)(y-μy)
covariance is negative, positive, 0 if …
positive if upward correlation, negative if downward, 0 if cloud no correlation independent
𝜎2x+y
𝜎x2+𝜎y2
what to always do before starting a do file
clear
rename a variable
ren varog varnew
label a variable
label variable var1 “"
get rid of rows of data
drop in #/#
revalue variable
replace var=”” if var==””
convert variable from strings to numbers
destring var, replace
red data
strings
black data
numeric
find median
centile var, centile (50)
sort variable into above and below median
gen var2=# if var1>= `r(c_1)’&var1!=.
replace var2=# if var1<=`r(c_1)’
missing value
black .
Tell me the quantities of each value and percents
tab var
Tell me the mean, min/max, SD, # of observations, variance, median, quarters, skew
sum var, detail
save something
save “\” , replace
format for data, graph, table
.dta, gph, .rtf
make a graph
collapse (mean) mean_var1=var1, by var2
graph twoway (bar mean_var1 var2, barw(#)), xlabel(# ““ etc) xtitle(““) ylabel (# ““ etc) ytitle(““) title (““)
graph save
make a table
eststo var1:estpost summarize var2 if var1==#
esttab var1 var2 using “\.dta”, plain cells(“mean(label(Mean) fmt (0))” “sd(label(SD) fmt(0))” “count(label(N) fmt(0))”) mtitles(“ “ “ “) noobs replace label title()
import first row as variables
import ““, firstrow
how to import sas
import sas using ““
browse a variable
browse var
number of observations
count var
general stats about data (string/numbers, missing)
codebook var
look at distribution
hist var
sort variable from smallest to largest
sort var
bias directionality
can be product positive if all possible third variables end up positive or vice versa, or product neutral, it is positive and overstates bias if a third variable causes both things to happen more, negative understates bias and causes one, but reduces the other