SOCI 620: Quantitative methods 2

AGENDA

Counts
& rates

  1. Counts as random outcomes
  2. The log link function
  3. Hands on:
    Poisson models in R

Slides are licensed under CC BY-NC-SA 4.0

Counts as random outcomes
The Poisson distribution

Black and white illustration of a fish inside of a coffee percolator

Counts as outcomes

Kinds of counts:

Average and deviation

An event that is technically a count, but the scale of the process means we can treat it as continuous
E.g. immigration rate, unemployment rate, etc.

Normal distribution

Trials and probability of success

Outcome could have happened at most N times, our data measures how many times it did happen
E.g. “how many days per week…”, etc.

Binomial / Bernoulli distribution

Rate of occurence

An event that has no (theoretical) upper limit, but tends to happen at a relatively low rate
E.g. individual fertility, number of friends, grocery stores in a neighborhood, etc.


(See also: geometric distribution for ‘time until occurrence’ types of models)

Poisson distribution

Poisson distribution

The Poisson distribution gives the probability that an event will happen k times in a particular unit of time or space if it has an average rate of occurrence of λ in that unit of time or space.

Poisson distribution

λ=5.0

λ=20.0

λ=80.0

Poisson distribution

Poisson with a large λ is closely approximated by a normal distribution

Poisson-distributed outcome

A man in a brown overcoat and suit, black hair carefully combed back, sips coffee in a diner from a white mug (Dale Cooper from Twin Peaks)

How many cups of coffee does Special Agent Dale Cooper drink in an episode of Twin Peaks?
(Seasons 1 and 2)

The
log link

A woman in a knitted cardigan and red rimmed glasses cradles a log like a baby as she stares into theh camera (the Log Lady from Twin Peaks)

Log link function

λi

log(λi) = α + βXi + …

Log link priors

α ∼ Norm(3.0, 0.5)

Log link priors

α ∼ Norm(4.0, 0.5)

Log link priors

Log normal distributions are not intuitive.
Changing the value of σ can significantly shift the “center” of the distribution left or right.

Back to the model

Si – indicator for season 1

A man in a green sport coat wearing a tie on top of his head holds a cup of coffee at a breakfast table. He is leaning over with an extremely pained smile on his face

Mean 95% C.I.

-0.097 (-0.513, 0.291)

0.200 (-0.414, 0.809)

0.908 (0.599, 1.337)

1.221 (0.661, 2.247)

Hands on: Poisson models in R

magazine advertisement for Nintendo Entertainment System, ca 1985. Shows a mother, father, and two sons all engaged deeply with a TV while the sons play Super Mario Bros. Three of the four have feathered hairstyles.

Image credit

Figures by Peter McMahan (source code)

Black and white illustration of a fish inside of a coffee percolator

Image by 4TinyCats

A man in a brown overcoat and suit, black hair carefully combed back, sips coffee in a diner from a white mug (Dale Cooper from Twin Peaks)

Still from Twin Peaks (1990)

A woman in a knitted cardigan and red rimmed glasses cradles a log like a baby as she stares into theh camera (the Log Lady from Twin Peaks)

Promotional image for Twin Peaks (1990)

A man in a green sport coat wearing a tie on top of his head holds a cup of coffee at a breakfast table. He is leaning over with an extremely pained smile on his face

Still from Twin Peaks (2017)

magazine advertisement for Nintendo Entertainment System, ca 1985. Shows a mother, father, and two sons all engaged deeply with a TV while the sons play Super Mario Bros. Three of the four have feathered hairstyles.

Nintendo ad via Reddit