Welcome to the course webpage of ECON221!

Official course description

This course is an introductory subject in statistical data analysis. Emphasis is given to the understanding of basic statistical tools and techniques as used by practicing economists. The course will cover concepts from introductory statistics and probability theory, discrete and continuous random variables, expectations, tests of hypotheses and applications.

Course diary

2025-11-27 (online)

  1. The mathematics of the long run, Slides 72 to 89 here

  2. Returning to M&M and Chips Ahoy – how do these examples differ from the binomial case?

  3. Scribbles for V26, V27

2025-11-24 (face-to-face)

  1. The mathematics of the long run, Slides 57 to 63, 67 to 71 here
  2. Quiz 5 here, solutions here
  3. Additional exercises would be to try working on the quiz again but this time use the approximation from the central limit theorem.

2025-11-20 (pre-recorded)

  1. Working through the midterm exam in preparation for the final exam
  2. Practice Set 03

2025-11-17 (shifted online)

  1. The mathematics of the long run, Slides 41 to 61 here

2025-11-13 (online)

  1. Recap: The mathematics of the long run, Slides 18 to 40 here
  2. Exercise on modifying code to produce confidence interval for \(\pi\) in Harley’s case
  3. Scribbles for V26, V27
  4. Meme for estimand, estimator, estimate

2025-11-10

Classes suspended because of super-typhoon.

2025-11-06 (pre-recorded)

  1. The mathematics of the long run, Slides 18 to 40 here

    • How to implement binomial distribution calculations in R: dbinom(), pbinom()
    • Apply to the following use cases: dogs and human gestures, left-handed scientists
    • Relate to \(p\)-value calculations
    • How does the shape of the binomial distribution get affected by the parameters?
    • Idea behind a confidence interval
    • How to construct a confidence interval for \(\pi\) in the binomial case

2025-11-03 (face-to-face)

  1. Exercise on uncertain project choices

    • Application of random variables and the mathematical language
    • Use cases in structured decision-making in organizations: Videos on structured decision-making from the US Geological Survey (USGS)
  2. The mathematics of the long run, Slides 13 to 18 here

    • Contrast with the exercise given in class
    • How to complete a probability distribution (fill in the tables) if you do not have complete information
    • Use case: Do dogs understand human gestures?

2025-10-27 and 2025-10-30

Independent learning week - no lectures at all

2025-10-23 (pre-recorded)

  1. The mathematics of the long run, Slides 9 to 13 here

  2. Relate to Probabilistic and statistical thinking, Slides 30 to 34 here

  3. Scribbles

2025-10-20 (shifted online)

  1. The mathematics of the long run, Slides 1 to 8 here

    • R commands: ==, sum(), and more on sample()
    • Specifically, sample(1:4, 4, prob = c(0.25, 0.25, 0.25, 0.25), replace = FALSE) to implement the sick joke described in the slides. This is the same as sample(1:4).
    • Checking if baby returned to correct mother: sample(1:4) == 1:4
    • Counting how many babies returned to correct mother: sum(sample(1:4) == c(1,2,3,4)) or sum(sample(1:4) == 1:4)
    • Repeat the random assignment and the checking 100 times: replicate(100, sum(sample(1:4) == c(1,2,3,4)))
    • Look at summary information resulting from repeated hypothetical assignments of babies to mothers: table(replicate(100, sum(sample(1:4) == c(1,2,3,4)))) and mean(replicate(100, sum(sample(1:4) == c(1,2,3,4))))
    • Find the probability distribution of \(X\), where \(X\) is defined as how many babies were returned to the correct mother. Get exact answers to validate simulation results.

2025-10-16 (online)

  1. Probabilistic and statistical thinking, Slides 27 to 38 here

    • Slide 27: Exercise for practice
    • How to make decisions under uncertainty
    • Expressing uncertainty about some crucial variables in a decision
    • Looking at “hypothetical futures”
    • R commands: sample(), quantile(), seq()
  2. Practice Set 02

2025-10-13 (face-to-face)

  1. Probabilistic and statistical thinking, Slides 1 to 26 here

    • Recap of dogs and human gestures
    • Digging into more details regarding the argument used
    • Introduced hypothesis testing for a special case
    • Worked on similar exercises
  2. Dedicated webpage for you to modify code for the simulation-based \(p\)-value

  3. Quiz 04 here, solutions here

2025-10-09 (online)

  1. Recap of Monte Carlo simulations

  2. Probabilistic and statistical thinking, Slides 1 to 15 here

    • Distinction between empirical and theoretical quantities
    • Scientific investigations

2025-10-06 (face-to-face)

  1. Recap and then continue with Monte Carlo simulations in R, specifically about how the sample mean behaves under different datasets collected under the same conditions (or if you wish, tossed a fair coin \(n\) times for nsim times)
  2. Motivated the need for this kind of thought experiment – tossing a fair coin and net weight of Chips Ahoy for V26 and net weight for M&Ms for V27
  3. Quiz, solutions here

2025-10-02 (online)

  1. Describing distributions, slides 36 to 37, 42 to 44
  2. Finished first set of slides, skip slides 45 to 48
  3. Introduced IPUMS ACS data
  4. Motivating the next major topic of the course: material here, finished until section of “Learn bits of R”
  5. Practice Set 01

2025-09-29 (face-to-face)

  1. Recap of pre-recording
  2. Worked on alternative forms of the regression line
  3. Discussed a bit on why it is called “regression”
  4. Exercise

2025-09-25 (pre-recorded)

  1. Describing distributions, slides 35, 42 to 44

    • Interactive R script
    • Wrap up almost all the mathematics for regression
    • Connections to numerical summaries
    • The meaning of correlation
  2. Scribbles

2025-09-22 (shifted online)

  1. Describing distributions, updated slides 31 to 34 and 38 to 41

    • R commands: tapply(), as.factor()
    • Regression lines when there is only an intercept, when there is a variable taking multiple possible values like NetSalesMil, when there is a dummy variable
    • Provide suggestive examples to show that regressions are about averages or comparisons of averages
    • Importance of the “hat” notation and what information it conveys
    • Optimization problem underlying regression
  2. Scribbles for V26, for V27

  3. Note for slide 40: It is possible to use lm(TotalCompMil ~ as.factor(Industry=="Energy"), data=eCsub) so that we can shorten the command. But do you think it will work for the commands in slide 39?

2025-09-18 (pre-recorded)

  1. Describing distributions, slides 19 to 30

    • R commands: plot(), lm(), log10(), log(), subset()`
    • Other numerical summaries
    • How to find median, IQR, percentiles, mean, and SD if you only have a histogram
    • Linear and nonlinear transformations – Impact on visualizations and numerical summaries, what information can transformations convey
    • Scatterplots and regressions
    • Meaning of regression intercept and regression slope
  2. Scribbles

2025-09-15 (face-to-face)

  1. Describing distributions, slides 11 to 19

    • R commands: mean(), sd(), apply(), abs()
    • Geometric interpretation of the objective function which the mean minimizes
    • Digging into the meaning of standard deviation
    • \(z\)-scores and why they are useful
    • Empirical rule
  2. Short quiz, solutions

2025-09-11 (online)

  1. Describing distributions, slides 9 to 10

    • R commands for extracting rows and columns of a dataset
    • Meaning of NA and using na.rm = TRUE
    • Getting used to summation notation
    • Mean as a solution to an optimization problem
  2. Scribbles for V26, V27

2025-09-08 (face to face)

  1. Describing distributions, slides 6 to 8

    • Jumping into R: <-, c(), read.csv(), names(), merge(), head(), hist(), boxplot()
    • R features: help and autocomplete (tab key), user input and default settings for commands
    • Histograms two ways – frequency/counts on vertical axis or density on vertical axis
    • Value of histograms drawn on a density scale
    • Attention to units
    • How to get percentile information from a histogram
    • What information does a boxplot (or box and whiskers plot) have, treatment of whiskers vary across textbooks and software (refer to section on Whiskers in this wiki entry and this article from the American Society for Quality to get a sense that treatment of boxplots can vary)
  2. Advice for R: Experiment with the commands, ask for help e.g. ?read.csv()

  3. Cannot install RStudio in your computer?

    • Make sure you have installed R first – Windows users, Mac users
    • Installing base is enough now. Mac users should know their version/flavor of Mac.
    • If all else fails, either (1) bring your computer before class starts (or class ends) and let me have a look or (2) use Google Colab.
  4. Short quiz, solutions here

  5. Dear Data

2025-09-04 (online)

  1. Describing distributions, slides 1 to 6

  2. Executive compensation datasets: Dataset 1, Dataset 2

  3. Descriptive statistics involving a sensitive topic

2025-09-01 (shifted online)

  1. Getting to know your background
  2. Statistics around us
  3. A bit on the syllabus