GLMER

generalized mixed effects regression
# Load lmerTest library(lmerTest) # Fit the model and look at its summary model_out <- glmer(cbind(Purchases, Pass) ~ friend + ranking + (1 | city), family = "binomial", data = all_data) summary(model_out)
Fit a glmer() with all_data data.frame. Use cbind(Purchases, Pass) being predicted by friend and ranking (friend goes first). Use city as your your random-effect and family = "binomial".
If the parameter estimate for friend is significantly less than zero, then a friend's recommendation decreases the chance somebody makes a purchase. If the parameter estimate for friend is not significantly different than zero, then a friend's recommendation has no effect on somebody making a purchase.
 

Odds-ratio

  • interpretation
    • If an odds-ratio is 1.0, then both events have an equal chance of occurring.
    • If an odds-ratio is less than 1, then a friend's recommendation would decrease the chance of a purchase occurring.
    • If an odds-ratio is greater than 1, then a friend's recommendation would increase the chance of a purchase occurring.
 
 
  • Counts data
    • Chi-squared test can be used to compare binned counts
    • poisson glm is also an alternative