Data Science, Statistics, Analytics, Experiment, Causality.
count = .N), by = .(likes_movies, subscribed)] dat_agg # naive comparison of means dat[,.(mean(engagement)), by = subscribed] # inverse propensity weighting propensity_model <- glm(subscribed~likes_movies, data = dat) dat$propensity <- ifelse( dat$subscribed, fitted(propensity_model), 1 -