SlideShare a Scribd company logo
Research and R
EC 607, Set 01
Edward Rubin
Prologue
Prologue
2 / 38
2 / 38
Today
Welcome, check in, and admin
Research basics: Why are we here? MHE: Preface & Ch. 1
Our class: What are we doing?
R: Part of our how in this class: Basics.
Upcoming
Learn more R: First assignment!
Review metrics and building intution for causality and inference.
Build momentum.
Long run
Goal: Deepen understandings/intuitions for causality and inference.
3 / 38
Research
Why are we here?
4 / 38
Research
Why are we here?
Econ. research
4 / 38
Research
Why are we here?
Econ. research: Understand human, social, and/or economic behaviors.
4 / 38
Research
Why are we here?
Econ. research: Understand human, social, and/or economic behaviors.
PhD
4 / 38
Research
Why are we here?
Econ. research: Understand human, social, and/or economic behaviors.
PhD: Learn methods, tools, skills, and intution required for research.
4 / 38
Research
Why are we here?
Econ. research: Understand human, social, and/or economic behaviors.
PhD: Learn methods, tools, skills, and intution required for research.
(Applied) econometrics
4 / 38
Research
Why are we here?
Econ. research: Understand human, social, and/or economic behaviors.
PhD: Learn methods, tools, skills, and intution required for research.
(Applied) econometrics: Build a toolbox of empirical methods, tools,
and skills to that combine data and statistical insights to test and/or
measure theories and policies.
4 / 38
Research
Why are we here?
Econ. research: Understand human, social, and/or economic behaviors.
PhD: Learn methods, tools, skills, and intution required for research.
(Applied) econometrics: Build a toolbox of empirical methods, tools,
and skills to that combine data and statistical insights to test and/or
measure theories and policies.
You
4 / 38
Research
Why are we here?
Econ. research: Understand human, social, and/or economic behaviors.
PhD: Learn methods, tools, skills, and intution required for research.
(Applied) econometrics: Build a toolbox of empirical methods, tools,
and skills to that combine data and statistical insights to test and/or
measure theories and policies.
You: You should be thinking about this question throughout your
program/work/life.
4 / 38
Research
Why are we here?
Econ. research: Understand human, social, and/or economic behaviors.
PhD: Learn methods, tools, skills, and intution required for research.
(Applied) econometrics: Build a toolbox of empirical methods, tools,
and skills to that combine data and statistical insights to test and/or
measure theories and policies.
You: You should be thinking about this question throughout your
program/work/life. Self awareness and mental health are important.
4 / 38
Research
This class
For many of people, this course marks a big shift in how school works.
You don't have a metrics qualifying exam. 🤷
Grades are not super important.
5 / 38
Research
This class
For many of people, this course marks a big shift in how school works.
You don't have a metrics qualifying exam. 🤷
Grades are not super important.
The material and tools are pivotal for a lot of what you will do in the future.
5 / 38
Research
This class
For many of people, this course marks a big shift in how school works.
You don't have a metrics qualifying exam. 🤷
Grades are not super important.
The material and tools are pivotal for a lot of what you will do in the future.
Take responsibility for your education and career.
Commit to spending the necessary time.
Be proactive and curious.
Go down rabbit holes.
Ask questions.
Learn.
5 / 38
Research
What are we doing?
Q What is the difference between econometrics and data science?
6 / 38
Research
What are we doing?
Q What is the difference between econometrics and data science?
Qv2 Is there anything special about econometrics?
6 / 38
Research
What are we doing?
Q What is the difference between econometrics and data science?
Qv2 Is there anything special about econometrics?
A1/∞ Causality.😸
😸 Sources for this Q and A: Dan Hammer and Max Auffhammer.
6 / 38
Research
What are we doing?
Q What is the difference between econometrics and data science?
Qv2 Is there anything special about econometrics?
A1/∞ Causality.😸
Note: There are large parts of econometrics that focus on prediction rather
than causality (e.g., forecasting and prediction—see Jeremy Piger).†
😸 Sources for this Q and A: Dan Hammer and Max Auffhammer.
† Also: Machine learning (e.g., my ML and econometrics course here at UO)
6 / 38
Research
What are we doing?
Q What is the difference between econometrics and data science?
Qv2 Is there anything special about econometrics?
A1/∞ Causality.😸
Note: There are large parts of econometrics that focus on prediction rather
than causality (e.g., forecasting and prediction—see Jeremy Piger).†
Causality plays a huge role in modern applied econometrics (esp. in micro).
😸 Sources for this Q and A: Dan Hammer and Max Auffhammer.
† Also: Machine learning (e.g., my ML and econometrics course here at UO)
6 / 38
Mostly Harmless Econometrics
Angrist and Pischke, 2008
MHE Buy now. Read this book.
The standard for causal metrics.
Could use an update.
Microeconometrics:
Methods and Applications
Cameron and Trivedi, 2005
We will use more C&T than Greene.
Toward this end—causality—we will use two books (favoring MHE).
7 / 38
Econometric Analysis
Greene, 2018
Encyclopedic reference.
Econometric Analysis of Cross
Section and Panel Data
Wooldridge, 2010
This book has some great sections.
While you're at it, buy one or two more...
8 / 38
Introduction to Causal Inference
Brady Neal, 2020
Under development but great.
Targets folks from prediction.
Causal Inference: The Mixtape
Scott Cunningham, 2021
Relatively new.
Includes R, Stata, and Python code.
Two more "free" books...
9 / 38
Causal research
Motivation
First, we believe that empirical research is most valuable when it
uses data to answer specific causal questions, as if in a
randomized clinical trial. This view shapes our approach to most
research questions. In the absence of a real experiment, we look
for well-controlled comparisons and/or natural quasi-
experiments. Of course, some quasi-experimental research
designs are more convincing than others, but the econometric
methods used in these studies are almost always fairly simple.
Mostly Harmless Econometrics, p. xii (color added)
10 / 38
Causal research
Motivation
First, we believe that empirical research is most valuable when it
uses data to answer specific causal questions, as if in a
randomized clinical trial. This view shapes our approach to most
research questions. In the absence of a real experiment, we look
for well-controlled comparisons and/or natural quasi-
experiments. Of course, some quasi-experimental research
designs are more convincing than others, but the econometric
methods used in these studies are almost always fairly simple.
Mostly Harmless Econometrics, p. xii (color added)
1. This ideology inherently compares research to "gold-standard" RCTs.
10 / 38
Causal research
Motivation
First, we believe that empirical research is most valuable when it
uses data to answer specific causal questions, as if in a
randomized clinical trial. This view shapes our approach to most
research questions. In the absence of a real experiment, we look
for well-controlled comparisons and/or natural quasi-
experiments. Of course, some quasi-experimental research
designs are more convincing than others, but the econometric
methods used in these studies are almost always fairly simple.
Mostly Harmless Econometrics, p. xii (color added)
1. This ideology inherently compares research to "gold-standard" RCTs.
2. The methods are usually (relatively) straightforward (after training).
10 / 38
Causal research
Angrist and Pischke's FAQs†
1. What is the causal relationship of interest?
2. How would an ideal experiment capture this causal effect of interest?
3. What is your identification strategy?
4. What is your mode of inference?
† See MHE, chapter 1. †† Credit for these questions goes to Reed Walker.
11 / 38
Causal research
Angrist and Pischke's FAQs†
1. What is the causal relationship of interest?
2. How would an ideal experiment capture this causal effect of interest?
3. What is your identification strategy?
4. What is your mode of inference?
Note: Other questions also matter for developing quality research, e.g.,††
Why is your question important/interesting?
Why is the current literature lacking or nonexistant?
How do you propose to advance the literature?
† See MHE, chapter 1. †† Credit for these questions goes to Reed Walker.
11 / 38
Causal research
FAQ1: What is the causal relationship of interest?
Descriptive exercises can be very interesting and important, but in modern
applied econometrics, causality is king.
Why?
12 / 38
Causal research
FAQ1: What is the causal relationship of interest?
Descriptive exercises can be very interesting and important, but in modern
applied econometrics, causality is king.
Why?
Causal relationships directly test theories of how the world works.
Causal relationships provide us with counterfactuals—how the world
would have looked with different sets of policies/circumstances.
12 / 38
Causal research
FAQ1: What is the causal relationship of interest?
Descriptive exercises can be very interesting and important, but in modern
applied econometrics, causality is king.
Why?
Causal relationships directly test theories of how the world works.
Causal relationships provide us with counterfactuals—how the world
would have looked with different sets of policies/circumstances.
🚧If you can't clearly and succinctly name the causal relationship of
interest, then you may not actually have a research project.
12 / 38
Causal research
FAQ1: What is the causal relationship of interest?
Some classic examples...
Labor and Education
How does an additional year of schooling affect wages?
Political Economy and Development
How do democratic institutions affect economic development?
Environment and Urban
Do the poor receive substantive benefits from environmental clean ups?
Health, Crime, and Law
Do gun-control laws actually reduce gun violence?
13 / 38
Causal research
FAQ2: What is the ideal experiment for this setting?
Describing the ideal experiment helps us formulate
the exact causal question(s)
the dimensions we want to manipulate
the factors we need to hold constant
14 / 38
Causal research
FAQ2: What is the ideal experiment for this setting?
Describing the ideal experiment helps us formulate
the exact causal question(s)
the dimensions we want to manipulate
the factors we need to hold constant
🚧These ideal experiments are generally hypothetical, but if you can't
describe the ideal, it will probably be hard to come up with data and
plausible research designs in real life.
14 / 38
Causal research
FAQ2: What is the ideal experiment for this setting?
Describing the ideal experiment helps us formulate
the exact causal question(s)
the dimensions we want to manipulate
the factors we need to hold constant
🚧These ideal experiments are generally hypothetical, but if you can't
describe the ideal, it will probably be hard to come up with data and
plausible research designs in real life.
Angrist and Pischke call questions without ideal experiments
fundamentally unanswerable questions (FUQs).
14 / 38
Causal research
FAQ2: What is the ideal experiment for this setting?
Examples of potentially answerable questions...
The effect of education on wages: Randomize scholarships or
incentives to remain in school.
Democracy and development: Arbitrarily assign institutional types to
countries as they receive independence.
Environmental cleanups: Ask EPA to randomly clean toxic sites.
Gun laws: Randomly assign gun restrictions to jurisdictions.
15 / 38
Causal research
FAQ2: What is the ideal experiment for this setting?
Examples of potentially answerable questions...
The effect of education on wages: Randomize scholarships or
incentives to remain in school.
Democracy and development: Arbitrarily assign institutional types to
countries as they receive independence.
Environmental cleanups: Ask EPA to randomly clean toxic sites.
Gun laws: Randomly assign gun restrictions to jurisdictions.
Examples of challenging questions to answer (potentially unanswerable?)...
How does gender affect eventual career paths?
What role does race play in one's wages?
15 / 38
Causal research
FAQ2: What is the ideal experiment for this setting?
Sometimes even simple-sounding policy questions turn out to be
fundamentally unanswerable.
16 / 38
Causal research
FAQ2: What is the ideal experiment for this setting?
Sometimes even simple-sounding policy questions turn out to be
fundamentally unanswerable.
Example of a fundamentally unanswerable question:
Do children perform better by starting school at an older age?
16 / 38
Causal research
FAQ2: What is the ideal experiment for this setting?
Sometimes even simple-sounding policy questions turn out to be
fundamentally unanswerable.
Example of a fundamentally unanswerable question:
Do children perform better by starting school at an older age?
Proposed ideal experiment
1. Randomize kids to start 1st
grade at age 6 or 7.
2. Compare 2nd
grade test scores.
16 / 38
Causal research
FAQ2: What is the ideal experiment for this setting?
Sometimes even simple-sounding policy questions turn out to be
fundamentally unanswerable.
Example of a fundamentally unanswerable question:
Do children perform better by starting school at an older age?
Proposed ideal experiment
1. Randomize kids to start 1st
grade at age 6 or 7.
2. Compare 2nd
grade test scores.
Problem
16 / 38
Causal research
FAQ2: What is the ideal experiment for this setting?
Sometimes even simple-sounding policy questions turn out to be
fundamentally unanswerable.
Example of a fundamentally unanswerable question:
Do children perform better by starting school at an older age?
Proposed ideal experiment
1. Randomize kids to start 1st
grade at age 6 or 7.
2. Compare 2nd
grade test scores.
Problem Kids who started later are older in 2nd
grade. Older kids do better.
Do we want the effect of starting later or just being older?
16 / 38
Causal research
FAQ2: What is the ideal experiment for this setting?
Sometimes even simple-sounding policy questions turn out to be
fundamentally unanswerable.
Example of a fundamentally unanswerable question:
Do children perform better by starting school at an older age?
Proposed ideal experiment2.0
1. Randomize kids to start 1st
grade at age 6 or 7.
2. Control for age. Compare test scores when kids are age 8.
16 / 38
Causal research
FAQ2: What is the ideal experiment for this setting?
Sometimes even simple-sounding policy questions turn out to be
fundamentally unanswerable.
Example of a fundamentally unanswerable question:
Do children perform better by starting school at an older age?
Proposed ideal experiment2.0
1. Randomize kids to start 1st
grade at age 6 or 7.
2. Control for age. Compare test scores when kids are age 8.
Problem2.0
16 / 38
Causal research
FAQ2: What is the ideal experiment for this setting?
Sometimes even simple-sounding policy questions turn out to be
fundamentally unanswerable.
Example of a fundamentally unanswerable question:
Do children perform better by starting school at an older age?
Proposed ideal experiment2.0
1. Randomize kids to start 1st
grade at age 6 or 7.
2. Control for age. Compare test scores when kids are age 8.
Problem2.0 The two groups will have been in school for different numbers
of years (1 vs. 2). More school should mean better scores.
16 / 38
Causal research
FAQ2: What is the ideal experiment for this setting?
Sometimes even simple-sounding policy questions turn out to be
fundamentally unanswerable.
Example of a fundamentally unanswerable question:
Do children perform better by starting school at an older age?
Central problem: Mechanical links between ages and time in school.
(Start Age) = (Current Age) – (Time in School)
No experiment can separate these effects (for school-age children).
16 / 38
Causal research
FAQ3: What's your identification strategy?
This question✋ describes how you plan to recover/observe as good as
random assignment of your variable of interest (approximating your ideal
experiment) in real life.
Examples
Compulsory school-attendance laws interacted with quarter of birth
Vietnam War draft
Thresholds for the Clean Air Act violations
Notches in income-tax policies
Judge assignments
Randomly assigned characteristics on résumés
✋ You will hear this question asked a lot.
17 / 38
Causal research
FAQ3: What's your identification strategy?
A brief history
The term "identification strategy" goes back to Angrist and Krueger (1991).
However, the comparison of ideal and natural experiments goes back much
farther to Haavelmo (1944)...
18 / 38
Causal research
A design of experiments... is an essential appendix to any
quantitative theory. And we usually have some such experiment
in mind when we construct the theories, although-unfortunately-
most economists do not describe their design of experiments
explicitly. If they did, they would see that the experiments they
have in mind may be grouped into two different classes, namely,
(1) experiments that we should like to make to see if certain real
economic phenomena—when artificially isolated from "other
influences"—would verify certain hypotheses, and (2) the stream
of experiments that Nature is steadily turning out from her own
enormous laboratory, and which we merely watch as passive
observers. In both cases the aim of the theory is the same, to
become master of the happenings of real life.
Haavelmo, 1944 (color added)
19 / 38
Causal research
FAQ4: What is your mode of inference?
Historically, inference—standard errors, confidence intervals, hypothesis
tests, etc.—has received much less attention than point estimates. It's
becoming more important (more than an afterthought).
Which population does your sample represent?
How much noise (error) exists in your estimator (and estimates)?
How much variation do you actually have in your variable of interest?
20 / 38
Causal research
FAQ4: What is your mode of inference?
Historically, inference—standard errors, confidence intervals, hypothesis
tests, etc.—has received much less attention than point estimates. It's
becoming more important (more than an afterthought).
Which population does your sample represent?
How much noise (error) exists in your estimator (and estimates)?
How much variation do you actually have in your variable of interest?
Without careful inference, we don't know the difference between
21% ± 2.3%
21% ± 20.3%
20 / 38
Our class
Our class
21 / 38
21 / 38
Our class
Mini-syllabus
Class Attend/participate. Read assigned readings—especially papers.
Lab Practice applying our in-class content in R with Jaichung/me. Attend.
Problem sets 3+ problem sets mixing theory and applications in R.
Other grades Project plus take-home final.
22 / 38
R
R
23 / 38
23 / 38
R basics
What is it?
The R project website:
R is a free software environment for statistical computing and
graphics. It compiles and runs on a wide variety of UNIX
platforms, Windows and MacOS.
24 / 38
R basics
What is it?
The R project website:
R is a free software environment for statistical computing and
graphics. It compiles and runs on a wide variety of UNIX
platforms, Windows and MacOS.
What does that mean?
R was created for the statistical and graphical work required by
econometrics.
R has a vibrant, thriving online community (e.g., Stack Overflow).
Plus it's free and open source.
24 / 38
R basics
Why are we using R?
1. R is free and open source—saving both you and the university 💰💵💰.
2. Related: Outside of a small group of economists, private- and public-
sector employers favor R over Stata and most competing softwares.
3. R is very flexible and powerful—adaptable to nearly any task, e.g.,
'metrics, spatial data analysis, machine learning, web scraping, data
cleaning, website building, teaching. My website, the TWEEDS website, and
these notes all came out of R.
25 / 38
R basics
26 / 38
R basics
Why are we using R?
4. Related: R imposes no limitations on your amount of observations,
variables, memory, or processing power. (I'm looking at you, Stata.)
5. If you put in the work,🖥️ you (and your students!) will come away with a
valuable and marketable tool.
6. I 💖R
🖥️: Learning R definitely requires time and effort.
27 / 38
R basics
28 / 38
R basics
The install
Installing R is fairly straightfoward, but it occasionally involves challenges
for older computers.
Step 1: Download (r-project.org) and install R for your operating system.
Step 2: Download (rstudio.com) and install RStudio Desktop for your
operating system.
DataCamp has a nice tutorial on installing R and RStudio for Windows,
Mac, and Linux operating systems.†
† I applied for free access to DataCamp for our class. I'll let you know when I hear back.
29 / 38
R basics
Fundamentals
Let's get started. There are a few principals to keep in mind with R:
30 / 38
1. Everything is an object.
R basics
Fundamentals
Let's get started. There are a few principals to keep in mind with R:
30 / 38
1. Everything is an object. foo
R basics
Fundamentals
Let's get started. There are a few principals to keep in mind with R:
30 / 38
1. Everything is an object. foo
2. Every object has a name and value.
R basics
Fundamentals
Let's get started. There are a few principals to keep in mind with R:
30 / 38
1. Everything is an object. foo
2. Every object has a name and value. foo <- 2
R basics
Fundamentals
Let's get started. There are a few principals to keep in mind with R:
30 / 38
1. Everything is an object. foo
2. Every object has a name and value. foo = 2
R basics
Fundamentals
Let's get started. There are a few principals to keep in mind with R:
31 / 38
1. Everything is an object. foo
2. Every object has a name and value. foo = 2
3. You use functions on these objects.
R basics
Fundamentals
Let's get started. There are a few principals to keep in mind with R:
31 / 38
1. Everything is an object. foo
2. Every object has a name and value. foo = 2
3. You use functions on these objects. mean(foo)
R basics
Fundamentals
Let's get started. There are a few principals to keep in mind with R:
31 / 38
1. Everything is an object. foo
2. Every object has a name and value. foo = 2
3. You use functions on these objects. mean(foo)
4. Functions come in libraries (packages)
R basics
Fundamentals
Let's get started. There are a few principals to keep in mind with R:
31 / 38
1. Everything is an object. foo
2. Every object has a name and value. foo = 2
3. You use functions on these objects. mean(foo)
4. Functions come in libraries (packages) library(dplyr)
R basics
Fundamentals
Let's get started. There are a few principals to keep in mind with R:
31 / 38
1. Everything is an object. foo
2. Every object has a name and value. foo = 2
3. You use functions on these objects. mean(foo)
4. Functions come in libraries (packages) library(dplyr)
5. R will try to help you.
R basics
Fundamentals
Let's get started. There are a few principals to keep in mind with R:
31 / 38
1. Everything is an object. foo
2. Every object has a name and value. foo = 2
3. You use functions on these objects. mean(foo)
4. Functions come in libraries (packages) library(dplyr)
5. R will try to help you. ?dplyr
R basics
Fundamentals
Let's get started. There are a few principals to keep in mind with R:
31 / 38
1. Everything is an object. foo
2. Every object has a name and value. foo = 2
3. You use functions on these objects. mean(foo)
4. Functions come in libraries (packages) library(dplyr)
5. R will try to help you. ?dplyr
6. R has its quirks.
R basics
Fundamentals
Let's get started. There are a few principals to keep in mind with R:
31 / 38
1. Everything is an object. foo
2. Every object has a name and value. foo = 2
3. You use functions on these objects. mean(foo)
4. Functions come in libraries (packages) library(dplyr)
5. R will try to help you. ?dplyr
6. R has its quirks. NA; error; warning
R basics
Fundamentals
Let's get started. There are a few principals to keep in mind with R:
31 / 38
R basics
Fundamentals of functions
Functions operate on objects, but they need some guidance—arguments.
32 / 38
R basics
Fundamentals of functions
Functions operate on objects, but they need some guidance—arguments.
Example: ex_fun(arg1, arg2, arg3)
32 / 38
R basics
Fundamentals of functions
Functions operate on objects, but they need some guidance—arguments.
Example: ex_fun(arg1, arg2, arg3)
Our function is named ex_fun .
This function takes three arguments: arg1 , arg2 , arg3 .
You can tell R which values to assign to which arguments:
ex_fun(arg1 = 13, arg2 = 25, arg3 = 7) (probably best practice)
... or R will assign the values using the arguments' defined order:
ex_fun(13, 25, 7) (shorter/lazier but has the same result)
You must assign a name to a function's outputted object (to keep it).
32 / 38
R basics
Example function: matrix
We will need to create matrices in this class.
Enter: R's matrix() function!
33 / 38
# 3x2 matrix filled w/ zeros
matrix(
data = 0, nrow = 3, ncol = 2
)
#> [,1] [,2]
#> [1,] 0 0
#> [2,] 0 0
#> [3,] 0 0
34 / 38
# 3x2 matrix filled w/ zeros
matrix(
data = 0, nrow = 3, ncol = 2
)
#> [,1] [,2]
#> [1,] 0 0
#> [2,] 0 0
#> [3,] 0 0
# 3x2 matrix filled w/ 1 to 6
matrix(
data = 1:6, nrow = 3, ncol = 2
)
#> [,1] [,2]
#> [1,] 1 4
#> [2,] 2 5
#> [3,] 3 6
34 / 38
# 3x2 matrix filled w/ 1:6 by row
matrix(
data = 1:6, nrow = 3, ncol = 2,
byrow = T
)
#> [,1] [,2]
#> [1,] 1 2
#> [2,] 3 4
#> [3,] 5 6
35 / 38
# 3x2 matrix filled w/ 1:6 by row
matrix(
data = 1:6, nrow = 3, ncol = 2,
byrow = T
)
#> [,1] [,2]
#> [1,] 1 2
#> [2,] 3 4
#> [3,] 5 6
# 3x2 matrix filled w/ 1:3
matrix(
data = 1:3,
nrow = 3, ncol = 2
)
#> [,1] [,2]
#> [1,] 1 1
#> [2,] 2 2
#> [3,] 3 3
35 / 38
# 3x2 matrix filled w/ 1:6 by row
matrix(
data = 1:6, nrow = 3, ncol = 2,
byrow = T
)
#> [,1] [,2]
#> [1,] 1 2
#> [2,] 3 4
#> [3,] 5 6
# 3x2 matrix filled w/ 1:3
matrix(
data = 1:3,
nrow = 3, ncol = 2
)
#> [,1] [,2]
#> [1,] 1 1
#> [2,] 2 2
#> [3,] 3 3
# 3x2 matrix filled w/ 1:3
# Assigned to memory
our_matrix <- matrix(
data = 1:3,
nrow = 3, ncol = 2
)
35 / 38
R basics
Help and functions
Q How do we know which arguments a function requires/accepts?
36 / 38
R basics
Help and functions
Q How do we know which arguments a function requires/accepts?
A ?
36 / 38
R basics
Help and functions
Q How do we know which arguments a function requires/accepts?
A ? Meaning you can type ?matrix into your R console to find the help file
associated with the functions/objects named matrix .
36 / 38
R basics
Help and functions
Q How do we know which arguments a function requires/accepts?
A ? Meaning you can type ?matrix into your R console to find the help file
associated with the functions/objects named matrix .
Double bonus: Use ??matrix to perform a fuzzy search for the term matrix
in all of the help files.
36 / 38
R basics
Example function: matrix
Q How do we know which arguments a function requires/accepts?
A2 RStudio will also try to help you.
Type a name (e.g., matrix ) into the console; RStudio will show you
some info about the function.
After you type the name and parentheses (e.g., matrix() ), press tab,
and RStudio will show you a list of arguments for the function.
37 / 38
Admin
1. Schedule
2. Mini-syllabus
Research
1. Why are we here?
2. MHE's FAQs
1. Question
2. Experiment
3. Identification
4. Inference
R
1. Basics
2. Install
3. Fundamentals
Table of contents
38 / 38

More Related Content

Similar to 01-research-r.pdf

An introduction to research lesson in Grdae 10
An introduction to research lesson in Grdae 10An introduction to research lesson in Grdae 10
An introduction to research lesson in Grdae 10
DIVINADELACRUZ10
 
Research and Commercialisation Challenges
Research and Commercialisation ChallengesResearch and Commercialisation Challenges
Research and Commercialisation Challenges
Dr. Mazlan Abbas
 
Suggestions for entrepreneurship research
Suggestions for entrepreneurship researchSuggestions for entrepreneurship research
Suggestions for entrepreneurship researchBabak Zarrin Panah
 
How to write research paper
How to write research paper How to write research paper
How to write research paper
Manish Godse, Ph.D.
 
Research methodology
Research methodologyResearch methodology
Research methodology
smumbahelp
 
Case Study
Case StudyCase Study
Case Study
Vikramjit Singh
 
Lecture 1 RM (1).pptx research
Lecture 1 RM (1).pptx research Lecture 1 RM (1).pptx research
Lecture 1 RM (1).pptx research
MaddeJohn
 
Defining the Research Problem .pdf
Defining the Research Problem .pdfDefining the Research Problem .pdf
Defining the Research Problem .pdf
Siksha 'O' Anusandhan (Deemed to be University )
 
Tackling thesis.pptx
Tackling thesis.pptxTackling thesis.pptx
Tackling thesis.pptx
DaminiSingh68
 
Presentation Understanding Research MethodologyIn conducting s.docx
Presentation Understanding Research MethodologyIn conducting s.docxPresentation Understanding Research MethodologyIn conducting s.docx
Presentation Understanding Research MethodologyIn conducting s.docx
ChantellPantoja184
 
Research methodology
Research methodology Research methodology
Research methodology
Balaji P
 
How American Students Conduct their Academic Research and Writing?
How American Students Conduct their Academic Research and Writing?How American Students Conduct their Academic Research and Writing?
How American Students Conduct their Academic Research and Writing?
International Federation for information integration
 
CSCI 561Research Paper Topic Proposal and Outline Instructions.docx
CSCI 561Research Paper Topic Proposal and Outline Instructions.docxCSCI 561Research Paper Topic Proposal and Outline Instructions.docx
CSCI 561Research Paper Topic Proposal and Outline Instructions.docx
mydrynan
 
Research Methodology 2 sem.pdf
Research Methodology 2 sem.pdfResearch Methodology 2 sem.pdf
Research Methodology 2 sem.pdf
Jagadish Hudagi
 
Discussion # 1 Due Weds 081921Wk 1 Discussion 1 - Statistics [
Discussion # 1 Due Weds 081921Wk 1 Discussion 1 - Statistics [Discussion # 1 Due Weds 081921Wk 1 Discussion 1 - Statistics [
Discussion # 1 Due Weds 081921Wk 1 Discussion 1 - Statistics [
AlyciaGold776
 
Lecture 1-3 Introduction to Research Methodology.pdf
Lecture 1-3 Introduction to Research Methodology.pdfLecture 1-3 Introduction to Research Methodology.pdf
Lecture 1-3 Introduction to Research Methodology.pdf
J. A. Laghari
 
FINAL PPT BASIC-AND-APPLIED-RESEARCH.pptx
FINAL PPT  BASIC-AND-APPLIED-RESEARCH.pptxFINAL PPT  BASIC-AND-APPLIED-RESEARCH.pptx
FINAL PPT BASIC-AND-APPLIED-RESEARCH.pptx
JESSAMAESIARES
 
Top of FormPresentation Understanding Research MethodologyIn.docx
Top of FormPresentation Understanding Research MethodologyIn.docxTop of FormPresentation Understanding Research MethodologyIn.docx
Top of FormPresentation Understanding Research MethodologyIn.docx
edwardmarivel
 
Ppt research Methods and statistical consultancy
Ppt  research Methods and statistical consultancyPpt  research Methods and statistical consultancy
Ppt research Methods and statistical consultancy
TilayeMatebe
 
Study notesSome of the information below may be repetitive of wh.docx
Study notesSome of the information below may be repetitive of wh.docxStudy notesSome of the information below may be repetitive of wh.docx
Study notesSome of the information below may be repetitive of wh.docx
hanneloremccaffery
 

Similar to 01-research-r.pdf (20)

An introduction to research lesson in Grdae 10
An introduction to research lesson in Grdae 10An introduction to research lesson in Grdae 10
An introduction to research lesson in Grdae 10
 
Research and Commercialisation Challenges
Research and Commercialisation ChallengesResearch and Commercialisation Challenges
Research and Commercialisation Challenges
 
Suggestions for entrepreneurship research
Suggestions for entrepreneurship researchSuggestions for entrepreneurship research
Suggestions for entrepreneurship research
 
How to write research paper
How to write research paper How to write research paper
How to write research paper
 
Research methodology
Research methodologyResearch methodology
Research methodology
 
Case Study
Case StudyCase Study
Case Study
 
Lecture 1 RM (1).pptx research
Lecture 1 RM (1).pptx research Lecture 1 RM (1).pptx research
Lecture 1 RM (1).pptx research
 
Defining the Research Problem .pdf
Defining the Research Problem .pdfDefining the Research Problem .pdf
Defining the Research Problem .pdf
 
Tackling thesis.pptx
Tackling thesis.pptxTackling thesis.pptx
Tackling thesis.pptx
 
Presentation Understanding Research MethodologyIn conducting s.docx
Presentation Understanding Research MethodologyIn conducting s.docxPresentation Understanding Research MethodologyIn conducting s.docx
Presentation Understanding Research MethodologyIn conducting s.docx
 
Research methodology
Research methodology Research methodology
Research methodology
 
How American Students Conduct their Academic Research and Writing?
How American Students Conduct their Academic Research and Writing?How American Students Conduct their Academic Research and Writing?
How American Students Conduct their Academic Research and Writing?
 
CSCI 561Research Paper Topic Proposal and Outline Instructions.docx
CSCI 561Research Paper Topic Proposal and Outline Instructions.docxCSCI 561Research Paper Topic Proposal and Outline Instructions.docx
CSCI 561Research Paper Topic Proposal and Outline Instructions.docx
 
Research Methodology 2 sem.pdf
Research Methodology 2 sem.pdfResearch Methodology 2 sem.pdf
Research Methodology 2 sem.pdf
 
Discussion # 1 Due Weds 081921Wk 1 Discussion 1 - Statistics [
Discussion # 1 Due Weds 081921Wk 1 Discussion 1 - Statistics [Discussion # 1 Due Weds 081921Wk 1 Discussion 1 - Statistics [
Discussion # 1 Due Weds 081921Wk 1 Discussion 1 - Statistics [
 
Lecture 1-3 Introduction to Research Methodology.pdf
Lecture 1-3 Introduction to Research Methodology.pdfLecture 1-3 Introduction to Research Methodology.pdf
Lecture 1-3 Introduction to Research Methodology.pdf
 
FINAL PPT BASIC-AND-APPLIED-RESEARCH.pptx
FINAL PPT  BASIC-AND-APPLIED-RESEARCH.pptxFINAL PPT  BASIC-AND-APPLIED-RESEARCH.pptx
FINAL PPT BASIC-AND-APPLIED-RESEARCH.pptx
 
Top of FormPresentation Understanding Research MethodologyIn.docx
Top of FormPresentation Understanding Research MethodologyIn.docxTop of FormPresentation Understanding Research MethodologyIn.docx
Top of FormPresentation Understanding Research MethodologyIn.docx
 
Ppt research Methods and statistical consultancy
Ppt  research Methods and statistical consultancyPpt  research Methods and statistical consultancy
Ppt research Methods and statistical consultancy
 
Study notesSome of the information below may be repetitive of wh.docx
Study notesSome of the information below may be repetitive of wh.docxStudy notesSome of the information below may be repetitive of wh.docx
Study notesSome of the information below may be repetitive of wh.docx
 

Recently uploaded

Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
NathanBaughman3
 
Anemia_ different types_causes_ conditions
Anemia_ different types_causes_ conditionsAnemia_ different types_causes_ conditions
Anemia_ different types_causes_ conditions
muralinath2
 
Penicillin...........................pptx
Penicillin...........................pptxPenicillin...........................pptx
Penicillin...........................pptx
Cherry
 
EY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptxEY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptx
AlguinaldoKong
 
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Sérgio Sacani
 
Mammalian Pineal Body Structure and Also Functions
Mammalian Pineal Body Structure and Also FunctionsMammalian Pineal Body Structure and Also Functions
Mammalian Pineal Body Structure and Also Functions
YOGESH DOGRA
 
ESR_factors_affect-clinic significance-Pathysiology.pptx
ESR_factors_affect-clinic significance-Pathysiology.pptxESR_factors_affect-clinic significance-Pathysiology.pptx
ESR_factors_affect-clinic significance-Pathysiology.pptx
muralinath2
 
GBSN - Biochemistry (Unit 5) Chemistry of Lipids
GBSN - Biochemistry (Unit 5) Chemistry of LipidsGBSN - Biochemistry (Unit 5) Chemistry of Lipids
GBSN - Biochemistry (Unit 5) Chemistry of Lipids
Areesha Ahmad
 
RNA INTERFERENCE: UNRAVELING GENETIC SILENCING
RNA INTERFERENCE: UNRAVELING GENETIC SILENCINGRNA INTERFERENCE: UNRAVELING GENETIC SILENCING
RNA INTERFERENCE: UNRAVELING GENETIC SILENCING
AADYARAJPANDEY1
 
Lab report on liquid viscosity of glycerin
Lab report on liquid viscosity of glycerinLab report on liquid viscosity of glycerin
Lab report on liquid viscosity of glycerin
ossaicprecious19
 
NuGOweek 2024 Ghent - programme - final version
NuGOweek 2024 Ghent - programme - final versionNuGOweek 2024 Ghent - programme - final version
NuGOweek 2024 Ghent - programme - final version
pablovgd
 
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptxBody fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
muralinath2
 
Comparative structure of adrenal gland in vertebrates
Comparative structure of adrenal gland in vertebratesComparative structure of adrenal gland in vertebrates
Comparative structure of adrenal gland in vertebrates
sachin783648
 
Richard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlandsRichard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlands
Richard Gill
 
Nutraceutical market, scope and growth: Herbal drug technology
Nutraceutical market, scope and growth: Herbal drug technologyNutraceutical market, scope and growth: Herbal drug technology
Nutraceutical market, scope and growth: Herbal drug technology
Lokesh Patil
 
Structures and textures of metamorphic rocks
Structures and textures of metamorphic rocksStructures and textures of metamorphic rocks
Structures and textures of metamorphic rocks
kumarmathi863
 
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATIONPRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
ChetanK57
 
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Sérgio Sacani
 
Viksit bharat till 2047 India@2047.pptx
Viksit bharat till 2047  India@2047.pptxViksit bharat till 2047  India@2047.pptx
Viksit bharat till 2047 India@2047.pptx
rakeshsharma20142015
 
general properties of oerganologametal.ppt
general properties of oerganologametal.pptgeneral properties of oerganologametal.ppt
general properties of oerganologametal.ppt
IqrimaNabilatulhusni
 

Recently uploaded (20)

Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
 
Anemia_ different types_causes_ conditions
Anemia_ different types_causes_ conditionsAnemia_ different types_causes_ conditions
Anemia_ different types_causes_ conditions
 
Penicillin...........................pptx
Penicillin...........................pptxPenicillin...........................pptx
Penicillin...........................pptx
 
EY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptxEY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptx
 
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
 
Mammalian Pineal Body Structure and Also Functions
Mammalian Pineal Body Structure and Also FunctionsMammalian Pineal Body Structure and Also Functions
Mammalian Pineal Body Structure and Also Functions
 
ESR_factors_affect-clinic significance-Pathysiology.pptx
ESR_factors_affect-clinic significance-Pathysiology.pptxESR_factors_affect-clinic significance-Pathysiology.pptx
ESR_factors_affect-clinic significance-Pathysiology.pptx
 
GBSN - Biochemistry (Unit 5) Chemistry of Lipids
GBSN - Biochemistry (Unit 5) Chemistry of LipidsGBSN - Biochemistry (Unit 5) Chemistry of Lipids
GBSN - Biochemistry (Unit 5) Chemistry of Lipids
 
RNA INTERFERENCE: UNRAVELING GENETIC SILENCING
RNA INTERFERENCE: UNRAVELING GENETIC SILENCINGRNA INTERFERENCE: UNRAVELING GENETIC SILENCING
RNA INTERFERENCE: UNRAVELING GENETIC SILENCING
 
Lab report on liquid viscosity of glycerin
Lab report on liquid viscosity of glycerinLab report on liquid viscosity of glycerin
Lab report on liquid viscosity of glycerin
 
NuGOweek 2024 Ghent - programme - final version
NuGOweek 2024 Ghent - programme - final versionNuGOweek 2024 Ghent - programme - final version
NuGOweek 2024 Ghent - programme - final version
 
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptxBody fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
 
Comparative structure of adrenal gland in vertebrates
Comparative structure of adrenal gland in vertebratesComparative structure of adrenal gland in vertebrates
Comparative structure of adrenal gland in vertebrates
 
Richard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlandsRichard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlands
 
Nutraceutical market, scope and growth: Herbal drug technology
Nutraceutical market, scope and growth: Herbal drug technologyNutraceutical market, scope and growth: Herbal drug technology
Nutraceutical market, scope and growth: Herbal drug technology
 
Structures and textures of metamorphic rocks
Structures and textures of metamorphic rocksStructures and textures of metamorphic rocks
Structures and textures of metamorphic rocks
 
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATIONPRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
 
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
 
Viksit bharat till 2047 India@2047.pptx
Viksit bharat till 2047  India@2047.pptxViksit bharat till 2047  India@2047.pptx
Viksit bharat till 2047 India@2047.pptx
 
general properties of oerganologametal.ppt
general properties of oerganologametal.pptgeneral properties of oerganologametal.ppt
general properties of oerganologametal.ppt
 

01-research-r.pdf

  • 1. Research and R EC 607, Set 01 Edward Rubin
  • 3. Today Welcome, check in, and admin Research basics: Why are we here? MHE: Preface & Ch. 1 Our class: What are we doing? R: Part of our how in this class: Basics. Upcoming Learn more R: First assignment! Review metrics and building intution for causality and inference. Build momentum. Long run Goal: Deepen understandings/intuitions for causality and inference. 3 / 38
  • 4. Research Why are we here? 4 / 38
  • 5. Research Why are we here? Econ. research 4 / 38
  • 6. Research Why are we here? Econ. research: Understand human, social, and/or economic behaviors. 4 / 38
  • 7. Research Why are we here? Econ. research: Understand human, social, and/or economic behaviors. PhD 4 / 38
  • 8. Research Why are we here? Econ. research: Understand human, social, and/or economic behaviors. PhD: Learn methods, tools, skills, and intution required for research. 4 / 38
  • 9. Research Why are we here? Econ. research: Understand human, social, and/or economic behaviors. PhD: Learn methods, tools, skills, and intution required for research. (Applied) econometrics 4 / 38
  • 10. Research Why are we here? Econ. research: Understand human, social, and/or economic behaviors. PhD: Learn methods, tools, skills, and intution required for research. (Applied) econometrics: Build a toolbox of empirical methods, tools, and skills to that combine data and statistical insights to test and/or measure theories and policies. 4 / 38
  • 11. Research Why are we here? Econ. research: Understand human, social, and/or economic behaviors. PhD: Learn methods, tools, skills, and intution required for research. (Applied) econometrics: Build a toolbox of empirical methods, tools, and skills to that combine data and statistical insights to test and/or measure theories and policies. You 4 / 38
  • 12. Research Why are we here? Econ. research: Understand human, social, and/or economic behaviors. PhD: Learn methods, tools, skills, and intution required for research. (Applied) econometrics: Build a toolbox of empirical methods, tools, and skills to that combine data and statistical insights to test and/or measure theories and policies. You: You should be thinking about this question throughout your program/work/life. 4 / 38
  • 13. Research Why are we here? Econ. research: Understand human, social, and/or economic behaviors. PhD: Learn methods, tools, skills, and intution required for research. (Applied) econometrics: Build a toolbox of empirical methods, tools, and skills to that combine data and statistical insights to test and/or measure theories and policies. You: You should be thinking about this question throughout your program/work/life. Self awareness and mental health are important. 4 / 38
  • 14. Research This class For many of people, this course marks a big shift in how school works. You don't have a metrics qualifying exam. 🤷 Grades are not super important. 5 / 38
  • 15. Research This class For many of people, this course marks a big shift in how school works. You don't have a metrics qualifying exam. 🤷 Grades are not super important. The material and tools are pivotal for a lot of what you will do in the future. 5 / 38
  • 16. Research This class For many of people, this course marks a big shift in how school works. You don't have a metrics qualifying exam. 🤷 Grades are not super important. The material and tools are pivotal for a lot of what you will do in the future. Take responsibility for your education and career. Commit to spending the necessary time. Be proactive and curious. Go down rabbit holes. Ask questions. Learn. 5 / 38
  • 17. Research What are we doing? Q What is the difference between econometrics and data science? 6 / 38
  • 18. Research What are we doing? Q What is the difference between econometrics and data science? Qv2 Is there anything special about econometrics? 6 / 38
  • 19. Research What are we doing? Q What is the difference between econometrics and data science? Qv2 Is there anything special about econometrics? A1/∞ Causality.😸 😸 Sources for this Q and A: Dan Hammer and Max Auffhammer. 6 / 38
  • 20. Research What are we doing? Q What is the difference between econometrics and data science? Qv2 Is there anything special about econometrics? A1/∞ Causality.😸 Note: There are large parts of econometrics that focus on prediction rather than causality (e.g., forecasting and prediction—see Jeremy Piger).† 😸 Sources for this Q and A: Dan Hammer and Max Auffhammer. † Also: Machine learning (e.g., my ML and econometrics course here at UO) 6 / 38
  • 21. Research What are we doing? Q What is the difference between econometrics and data science? Qv2 Is there anything special about econometrics? A1/∞ Causality.😸 Note: There are large parts of econometrics that focus on prediction rather than causality (e.g., forecasting and prediction—see Jeremy Piger).† Causality plays a huge role in modern applied econometrics (esp. in micro). 😸 Sources for this Q and A: Dan Hammer and Max Auffhammer. † Also: Machine learning (e.g., my ML and econometrics course here at UO) 6 / 38
  • 22. Mostly Harmless Econometrics Angrist and Pischke, 2008 MHE Buy now. Read this book. The standard for causal metrics. Could use an update. Microeconometrics: Methods and Applications Cameron and Trivedi, 2005 We will use more C&T than Greene. Toward this end—causality—we will use two books (favoring MHE). 7 / 38
  • 23. Econometric Analysis Greene, 2018 Encyclopedic reference. Econometric Analysis of Cross Section and Panel Data Wooldridge, 2010 This book has some great sections. While you're at it, buy one or two more... 8 / 38
  • 24. Introduction to Causal Inference Brady Neal, 2020 Under development but great. Targets folks from prediction. Causal Inference: The Mixtape Scott Cunningham, 2021 Relatively new. Includes R, Stata, and Python code. Two more "free" books... 9 / 38
  • 25. Causal research Motivation First, we believe that empirical research is most valuable when it uses data to answer specific causal questions, as if in a randomized clinical trial. This view shapes our approach to most research questions. In the absence of a real experiment, we look for well-controlled comparisons and/or natural quasi- experiments. Of course, some quasi-experimental research designs are more convincing than others, but the econometric methods used in these studies are almost always fairly simple. Mostly Harmless Econometrics, p. xii (color added) 10 / 38
  • 26. Causal research Motivation First, we believe that empirical research is most valuable when it uses data to answer specific causal questions, as if in a randomized clinical trial. This view shapes our approach to most research questions. In the absence of a real experiment, we look for well-controlled comparisons and/or natural quasi- experiments. Of course, some quasi-experimental research designs are more convincing than others, but the econometric methods used in these studies are almost always fairly simple. Mostly Harmless Econometrics, p. xii (color added) 1. This ideology inherently compares research to "gold-standard" RCTs. 10 / 38
  • 27. Causal research Motivation First, we believe that empirical research is most valuable when it uses data to answer specific causal questions, as if in a randomized clinical trial. This view shapes our approach to most research questions. In the absence of a real experiment, we look for well-controlled comparisons and/or natural quasi- experiments. Of course, some quasi-experimental research designs are more convincing than others, but the econometric methods used in these studies are almost always fairly simple. Mostly Harmless Econometrics, p. xii (color added) 1. This ideology inherently compares research to "gold-standard" RCTs. 2. The methods are usually (relatively) straightforward (after training). 10 / 38
  • 28. Causal research Angrist and Pischke's FAQs† 1. What is the causal relationship of interest? 2. How would an ideal experiment capture this causal effect of interest? 3. What is your identification strategy? 4. What is your mode of inference? † See MHE, chapter 1. †† Credit for these questions goes to Reed Walker. 11 / 38
  • 29. Causal research Angrist and Pischke's FAQs† 1. What is the causal relationship of interest? 2. How would an ideal experiment capture this causal effect of interest? 3. What is your identification strategy? 4. What is your mode of inference? Note: Other questions also matter for developing quality research, e.g.,†† Why is your question important/interesting? Why is the current literature lacking or nonexistant? How do you propose to advance the literature? † See MHE, chapter 1. †† Credit for these questions goes to Reed Walker. 11 / 38
  • 30. Causal research FAQ1: What is the causal relationship of interest? Descriptive exercises can be very interesting and important, but in modern applied econometrics, causality is king. Why? 12 / 38
  • 31. Causal research FAQ1: What is the causal relationship of interest? Descriptive exercises can be very interesting and important, but in modern applied econometrics, causality is king. Why? Causal relationships directly test theories of how the world works. Causal relationships provide us with counterfactuals—how the world would have looked with different sets of policies/circumstances. 12 / 38
  • 32. Causal research FAQ1: What is the causal relationship of interest? Descriptive exercises can be very interesting and important, but in modern applied econometrics, causality is king. Why? Causal relationships directly test theories of how the world works. Causal relationships provide us with counterfactuals—how the world would have looked with different sets of policies/circumstances. 🚧If you can't clearly and succinctly name the causal relationship of interest, then you may not actually have a research project. 12 / 38
  • 33. Causal research FAQ1: What is the causal relationship of interest? Some classic examples... Labor and Education How does an additional year of schooling affect wages? Political Economy and Development How do democratic institutions affect economic development? Environment and Urban Do the poor receive substantive benefits from environmental clean ups? Health, Crime, and Law Do gun-control laws actually reduce gun violence? 13 / 38
  • 34. Causal research FAQ2: What is the ideal experiment for this setting? Describing the ideal experiment helps us formulate the exact causal question(s) the dimensions we want to manipulate the factors we need to hold constant 14 / 38
  • 35. Causal research FAQ2: What is the ideal experiment for this setting? Describing the ideal experiment helps us formulate the exact causal question(s) the dimensions we want to manipulate the factors we need to hold constant 🚧These ideal experiments are generally hypothetical, but if you can't describe the ideal, it will probably be hard to come up with data and plausible research designs in real life. 14 / 38
  • 36. Causal research FAQ2: What is the ideal experiment for this setting? Describing the ideal experiment helps us formulate the exact causal question(s) the dimensions we want to manipulate the factors we need to hold constant 🚧These ideal experiments are generally hypothetical, but if you can't describe the ideal, it will probably be hard to come up with data and plausible research designs in real life. Angrist and Pischke call questions without ideal experiments fundamentally unanswerable questions (FUQs). 14 / 38
  • 37. Causal research FAQ2: What is the ideal experiment for this setting? Examples of potentially answerable questions... The effect of education on wages: Randomize scholarships or incentives to remain in school. Democracy and development: Arbitrarily assign institutional types to countries as they receive independence. Environmental cleanups: Ask EPA to randomly clean toxic sites. Gun laws: Randomly assign gun restrictions to jurisdictions. 15 / 38
  • 38. Causal research FAQ2: What is the ideal experiment for this setting? Examples of potentially answerable questions... The effect of education on wages: Randomize scholarships or incentives to remain in school. Democracy and development: Arbitrarily assign institutional types to countries as they receive independence. Environmental cleanups: Ask EPA to randomly clean toxic sites. Gun laws: Randomly assign gun restrictions to jurisdictions. Examples of challenging questions to answer (potentially unanswerable?)... How does gender affect eventual career paths? What role does race play in one's wages? 15 / 38
  • 39. Causal research FAQ2: What is the ideal experiment for this setting? Sometimes even simple-sounding policy questions turn out to be fundamentally unanswerable. 16 / 38
  • 40. Causal research FAQ2: What is the ideal experiment for this setting? Sometimes even simple-sounding policy questions turn out to be fundamentally unanswerable. Example of a fundamentally unanswerable question: Do children perform better by starting school at an older age? 16 / 38
  • 41. Causal research FAQ2: What is the ideal experiment for this setting? Sometimes even simple-sounding policy questions turn out to be fundamentally unanswerable. Example of a fundamentally unanswerable question: Do children perform better by starting school at an older age? Proposed ideal experiment 1. Randomize kids to start 1st grade at age 6 or 7. 2. Compare 2nd grade test scores. 16 / 38
  • 42. Causal research FAQ2: What is the ideal experiment for this setting? Sometimes even simple-sounding policy questions turn out to be fundamentally unanswerable. Example of a fundamentally unanswerable question: Do children perform better by starting school at an older age? Proposed ideal experiment 1. Randomize kids to start 1st grade at age 6 or 7. 2. Compare 2nd grade test scores. Problem 16 / 38
  • 43. Causal research FAQ2: What is the ideal experiment for this setting? Sometimes even simple-sounding policy questions turn out to be fundamentally unanswerable. Example of a fundamentally unanswerable question: Do children perform better by starting school at an older age? Proposed ideal experiment 1. Randomize kids to start 1st grade at age 6 or 7. 2. Compare 2nd grade test scores. Problem Kids who started later are older in 2nd grade. Older kids do better. Do we want the effect of starting later or just being older? 16 / 38
  • 44. Causal research FAQ2: What is the ideal experiment for this setting? Sometimes even simple-sounding policy questions turn out to be fundamentally unanswerable. Example of a fundamentally unanswerable question: Do children perform better by starting school at an older age? Proposed ideal experiment2.0 1. Randomize kids to start 1st grade at age 6 or 7. 2. Control for age. Compare test scores when kids are age 8. 16 / 38
  • 45. Causal research FAQ2: What is the ideal experiment for this setting? Sometimes even simple-sounding policy questions turn out to be fundamentally unanswerable. Example of a fundamentally unanswerable question: Do children perform better by starting school at an older age? Proposed ideal experiment2.0 1. Randomize kids to start 1st grade at age 6 or 7. 2. Control for age. Compare test scores when kids are age 8. Problem2.0 16 / 38
  • 46. Causal research FAQ2: What is the ideal experiment for this setting? Sometimes even simple-sounding policy questions turn out to be fundamentally unanswerable. Example of a fundamentally unanswerable question: Do children perform better by starting school at an older age? Proposed ideal experiment2.0 1. Randomize kids to start 1st grade at age 6 or 7. 2. Control for age. Compare test scores when kids are age 8. Problem2.0 The two groups will have been in school for different numbers of years (1 vs. 2). More school should mean better scores. 16 / 38
  • 47. Causal research FAQ2: What is the ideal experiment for this setting? Sometimes even simple-sounding policy questions turn out to be fundamentally unanswerable. Example of a fundamentally unanswerable question: Do children perform better by starting school at an older age? Central problem: Mechanical links between ages and time in school. (Start Age) = (Current Age) – (Time in School) No experiment can separate these effects (for school-age children). 16 / 38
  • 48. Causal research FAQ3: What's your identification strategy? This question✋ describes how you plan to recover/observe as good as random assignment of your variable of interest (approximating your ideal experiment) in real life. Examples Compulsory school-attendance laws interacted with quarter of birth Vietnam War draft Thresholds for the Clean Air Act violations Notches in income-tax policies Judge assignments Randomly assigned characteristics on résumés ✋ You will hear this question asked a lot. 17 / 38
  • 49. Causal research FAQ3: What's your identification strategy? A brief history The term "identification strategy" goes back to Angrist and Krueger (1991). However, the comparison of ideal and natural experiments goes back much farther to Haavelmo (1944)... 18 / 38
  • 50. Causal research A design of experiments... is an essential appendix to any quantitative theory. And we usually have some such experiment in mind when we construct the theories, although-unfortunately- most economists do not describe their design of experiments explicitly. If they did, they would see that the experiments they have in mind may be grouped into two different classes, namely, (1) experiments that we should like to make to see if certain real economic phenomena—when artificially isolated from "other influences"—would verify certain hypotheses, and (2) the stream of experiments that Nature is steadily turning out from her own enormous laboratory, and which we merely watch as passive observers. In both cases the aim of the theory is the same, to become master of the happenings of real life. Haavelmo, 1944 (color added) 19 / 38
  • 51. Causal research FAQ4: What is your mode of inference? Historically, inference—standard errors, confidence intervals, hypothesis tests, etc.—has received much less attention than point estimates. It's becoming more important (more than an afterthought). Which population does your sample represent? How much noise (error) exists in your estimator (and estimates)? How much variation do you actually have in your variable of interest? 20 / 38
  • 52. Causal research FAQ4: What is your mode of inference? Historically, inference—standard errors, confidence intervals, hypothesis tests, etc.—has received much less attention than point estimates. It's becoming more important (more than an afterthought). Which population does your sample represent? How much noise (error) exists in your estimator (and estimates)? How much variation do you actually have in your variable of interest? Without careful inference, we don't know the difference between 21% ± 2.3% 21% ± 20.3% 20 / 38
  • 53. Our class Our class 21 / 38 21 / 38
  • 54. Our class Mini-syllabus Class Attend/participate. Read assigned readings—especially papers. Lab Practice applying our in-class content in R with Jaichung/me. Attend. Problem sets 3+ problem sets mixing theory and applications in R. Other grades Project plus take-home final. 22 / 38
  • 56. R basics What is it? The R project website: R is a free software environment for statistical computing and graphics. It compiles and runs on a wide variety of UNIX platforms, Windows and MacOS. 24 / 38
  • 57. R basics What is it? The R project website: R is a free software environment for statistical computing and graphics. It compiles and runs on a wide variety of UNIX platforms, Windows and MacOS. What does that mean? R was created for the statistical and graphical work required by econometrics. R has a vibrant, thriving online community (e.g., Stack Overflow). Plus it's free and open source. 24 / 38
  • 58. R basics Why are we using R? 1. R is free and open source—saving both you and the university 💰💵💰. 2. Related: Outside of a small group of economists, private- and public- sector employers favor R over Stata and most competing softwares. 3. R is very flexible and powerful—adaptable to nearly any task, e.g., 'metrics, spatial data analysis, machine learning, web scraping, data cleaning, website building, teaching. My website, the TWEEDS website, and these notes all came out of R. 25 / 38
  • 60. R basics Why are we using R? 4. Related: R imposes no limitations on your amount of observations, variables, memory, or processing power. (I'm looking at you, Stata.) 5. If you put in the work,🖥️ you (and your students!) will come away with a valuable and marketable tool. 6. I 💖R 🖥️: Learning R definitely requires time and effort. 27 / 38
  • 62. R basics The install Installing R is fairly straightfoward, but it occasionally involves challenges for older computers. Step 1: Download (r-project.org) and install R for your operating system. Step 2: Download (rstudio.com) and install RStudio Desktop for your operating system. DataCamp has a nice tutorial on installing R and RStudio for Windows, Mac, and Linux operating systems.† † I applied for free access to DataCamp for our class. I'll let you know when I hear back. 29 / 38
  • 63. R basics Fundamentals Let's get started. There are a few principals to keep in mind with R: 30 / 38
  • 64. 1. Everything is an object. R basics Fundamentals Let's get started. There are a few principals to keep in mind with R: 30 / 38
  • 65. 1. Everything is an object. foo R basics Fundamentals Let's get started. There are a few principals to keep in mind with R: 30 / 38
  • 66. 1. Everything is an object. foo 2. Every object has a name and value. R basics Fundamentals Let's get started. There are a few principals to keep in mind with R: 30 / 38
  • 67. 1. Everything is an object. foo 2. Every object has a name and value. foo <- 2 R basics Fundamentals Let's get started. There are a few principals to keep in mind with R: 30 / 38
  • 68. 1. Everything is an object. foo 2. Every object has a name and value. foo = 2 R basics Fundamentals Let's get started. There are a few principals to keep in mind with R: 31 / 38
  • 69. 1. Everything is an object. foo 2. Every object has a name and value. foo = 2 3. You use functions on these objects. R basics Fundamentals Let's get started. There are a few principals to keep in mind with R: 31 / 38
  • 70. 1. Everything is an object. foo 2. Every object has a name and value. foo = 2 3. You use functions on these objects. mean(foo) R basics Fundamentals Let's get started. There are a few principals to keep in mind with R: 31 / 38
  • 71. 1. Everything is an object. foo 2. Every object has a name and value. foo = 2 3. You use functions on these objects. mean(foo) 4. Functions come in libraries (packages) R basics Fundamentals Let's get started. There are a few principals to keep in mind with R: 31 / 38
  • 72. 1. Everything is an object. foo 2. Every object has a name and value. foo = 2 3. You use functions on these objects. mean(foo) 4. Functions come in libraries (packages) library(dplyr) R basics Fundamentals Let's get started. There are a few principals to keep in mind with R: 31 / 38
  • 73. 1. Everything is an object. foo 2. Every object has a name and value. foo = 2 3. You use functions on these objects. mean(foo) 4. Functions come in libraries (packages) library(dplyr) 5. R will try to help you. R basics Fundamentals Let's get started. There are a few principals to keep in mind with R: 31 / 38
  • 74. 1. Everything is an object. foo 2. Every object has a name and value. foo = 2 3. You use functions on these objects. mean(foo) 4. Functions come in libraries (packages) library(dplyr) 5. R will try to help you. ?dplyr R basics Fundamentals Let's get started. There are a few principals to keep in mind with R: 31 / 38
  • 75. 1. Everything is an object. foo 2. Every object has a name and value. foo = 2 3. You use functions on these objects. mean(foo) 4. Functions come in libraries (packages) library(dplyr) 5. R will try to help you. ?dplyr 6. R has its quirks. R basics Fundamentals Let's get started. There are a few principals to keep in mind with R: 31 / 38
  • 76. 1. Everything is an object. foo 2. Every object has a name and value. foo = 2 3. You use functions on these objects. mean(foo) 4. Functions come in libraries (packages) library(dplyr) 5. R will try to help you. ?dplyr 6. R has its quirks. NA; error; warning R basics Fundamentals Let's get started. There are a few principals to keep in mind with R: 31 / 38
  • 77. R basics Fundamentals of functions Functions operate on objects, but they need some guidance—arguments. 32 / 38
  • 78. R basics Fundamentals of functions Functions operate on objects, but they need some guidance—arguments. Example: ex_fun(arg1, arg2, arg3) 32 / 38
  • 79. R basics Fundamentals of functions Functions operate on objects, but they need some guidance—arguments. Example: ex_fun(arg1, arg2, arg3) Our function is named ex_fun . This function takes three arguments: arg1 , arg2 , arg3 . You can tell R which values to assign to which arguments: ex_fun(arg1 = 13, arg2 = 25, arg3 = 7) (probably best practice) ... or R will assign the values using the arguments' defined order: ex_fun(13, 25, 7) (shorter/lazier but has the same result) You must assign a name to a function's outputted object (to keep it). 32 / 38
  • 80. R basics Example function: matrix We will need to create matrices in this class. Enter: R's matrix() function! 33 / 38
  • 81. # 3x2 matrix filled w/ zeros matrix( data = 0, nrow = 3, ncol = 2 ) #> [,1] [,2] #> [1,] 0 0 #> [2,] 0 0 #> [3,] 0 0 34 / 38
  • 82. # 3x2 matrix filled w/ zeros matrix( data = 0, nrow = 3, ncol = 2 ) #> [,1] [,2] #> [1,] 0 0 #> [2,] 0 0 #> [3,] 0 0 # 3x2 matrix filled w/ 1 to 6 matrix( data = 1:6, nrow = 3, ncol = 2 ) #> [,1] [,2] #> [1,] 1 4 #> [2,] 2 5 #> [3,] 3 6 34 / 38
  • 83. # 3x2 matrix filled w/ 1:6 by row matrix( data = 1:6, nrow = 3, ncol = 2, byrow = T ) #> [,1] [,2] #> [1,] 1 2 #> [2,] 3 4 #> [3,] 5 6 35 / 38
  • 84. # 3x2 matrix filled w/ 1:6 by row matrix( data = 1:6, nrow = 3, ncol = 2, byrow = T ) #> [,1] [,2] #> [1,] 1 2 #> [2,] 3 4 #> [3,] 5 6 # 3x2 matrix filled w/ 1:3 matrix( data = 1:3, nrow = 3, ncol = 2 ) #> [,1] [,2] #> [1,] 1 1 #> [2,] 2 2 #> [3,] 3 3 35 / 38
  • 85. # 3x2 matrix filled w/ 1:6 by row matrix( data = 1:6, nrow = 3, ncol = 2, byrow = T ) #> [,1] [,2] #> [1,] 1 2 #> [2,] 3 4 #> [3,] 5 6 # 3x2 matrix filled w/ 1:3 matrix( data = 1:3, nrow = 3, ncol = 2 ) #> [,1] [,2] #> [1,] 1 1 #> [2,] 2 2 #> [3,] 3 3 # 3x2 matrix filled w/ 1:3 # Assigned to memory our_matrix <- matrix( data = 1:3, nrow = 3, ncol = 2 ) 35 / 38
  • 86. R basics Help and functions Q How do we know which arguments a function requires/accepts? 36 / 38
  • 87. R basics Help and functions Q How do we know which arguments a function requires/accepts? A ? 36 / 38
  • 88. R basics Help and functions Q How do we know which arguments a function requires/accepts? A ? Meaning you can type ?matrix into your R console to find the help file associated with the functions/objects named matrix . 36 / 38
  • 89. R basics Help and functions Q How do we know which arguments a function requires/accepts? A ? Meaning you can type ?matrix into your R console to find the help file associated with the functions/objects named matrix . Double bonus: Use ??matrix to perform a fuzzy search for the term matrix in all of the help files. 36 / 38
  • 90. R basics Example function: matrix Q How do we know which arguments a function requires/accepts? A2 RStudio will also try to help you. Type a name (e.g., matrix ) into the console; RStudio will show you some info about the function. After you type the name and parentheses (e.g., matrix() ), press tab, and RStudio will show you a list of arguments for the function. 37 / 38
  • 91. Admin 1. Schedule 2. Mini-syllabus Research 1. Why are we here? 2. MHE's FAQs 1. Question 2. Experiment 3. Identification 4. Inference R 1. Basics 2. Install 3. Fundamentals Table of contents 38 / 38