knitr::opts_chunk$set(echo = FALSE, dev.args = list(bg = 'transparent'))
knitr::include_graphics("figures/delegation_incentives_1.png") knitr::include_graphics("figures/delegation_incentives_2.png") knitr::include_graphics("figures/delegation_incentives_3.png") knitr::include_graphics("figures/delegation_incentives_4.png") knitr::include_graphics("figures/delegation_incentives_5.png")
knitr::include_graphics("figures/loc1.png") knitr::include_graphics("figures/loc2.png")
knitr::include_graphics("figures/balletal.png")
knitr::include_graphics("figures/watercorp1.png") knitr::include_graphics("figures/watercorp2.png")
knitr::include_graphics("http://imgs.xkcd.com/comics/self_description.png")
The contents of any one panel are dependent on the contents of every panel including itself. The graph of panel dependencies is complete and bidirectional, and each node has a loop. The mouseover text has two hundred and forty-two characters
$$ y_i = \beta_0 + (\beta_1 + \gamma_1 z_i + \epsilon_{1i}) x_{1i} + (\beta_2 + \gamma_2 z_i + \epsilon_{2i}) x_{2i} + \beta_{12} x_{1i} x_{2i} \ - .5 \delta_1 x_{1i} - .5 \delta_2 x_{2i} + \nu_i $$ $$ \epsilon_{1}, \epsilon_{2}, \nu \sim i.i.d $$
$$ \delta_1 x_{1i} = \beta_1 + \gamma_1 z_i + \beta_{12} x_{2i} + \epsilon_{1i} $$ $$ \delta_2 x_{2i} = \beta_2 + \gamma_2 z_i + \beta_{12} x_{1i} + \epsilon_{2i} $$
$$ y_i = \beta_0 + (\beta_1 + \gamma_1 z_i + \epsilon_{1i}) x_{1i} + (\beta_2 + \gamma_2 z_i + \epsilon_{2i}) x_{2i} + \beta_{12} x_{1i} x_{2i} \ - .5 \delta_1 x_{1i} - .5 \delta_2 x_{2i} + \nu_i $$ $$ \epsilon_{1}, \epsilon_{2}, \nu \sim i.i.d $$
$$ y_i = \alpha_0^p + \alpha_1^p x_{1i} + \alpha_2^p x_{2i} + \alpha_{12}^p x_{1i} x_{2i} + \nu_i^p $$ $$ \nu^p \sim i.i.d $$
$$ \delta_1 x_{1i} = \beta_1 + \gamma_1 z_i + \beta_{12} x_{2i} + \epsilon_{1i} $$ $$ \delta_2 x_{2i} = \beta_2 + \gamma_2 z_i + \beta_{12} x_{1i} + \epsilon_{2i} $$
$$ x_{1i} = \alpha_1^d + \alpha_{12}^d x_{2i} + \gamma^d_1 z_i + \epsilon^d_{1i} $$
$$ x_{1i} = \alpha_1^d + \gamma^d_1 z_i + \epsilon^d_{1i} \ \&\ x_{2i} = \alpha_2^d + \gamma^d_2 z_i + \epsilon^d_{2i} $$
$$ \alpha_{12}^d = \frac{\beta_{12}}{\delta_1} \frac{\delta_2 \sigma_1^2 + \delta_1 \sigma_2^2} {\delta_2^2 \sigma_1^2 + \beta_{12}^2 \sigma_2^2} $$
$$ \delta_1 \delta_2 > \beta_{12}^2 $$
$$ \delta_i = 1 \implies \beta_{ij} < .55 $$
Erkens and Van der Stede Bedford, Malmi, and Sandelin, 2016
$$\beta_{12} = .5, \delta_1 = \delta_2 = 1$$
require(simcompl) require(dplyr) sample2 <- tbl_df(create_sample(obs = 1e3, rate = 1/2, b2 = c(.5, 0, 0))) %>% mutate(opt_param = 2) sample4 <- tbl_df(create_sample(obs = 1e3, rate = 1/4, b2 = c(.5, 0, 0))) %>% mutate(opt_param = 4) sample8 <- tbl_df(create_sample(obs = 1e3, rate = 1/8, b2 = c(.5, 0, 0))) %>% mutate(opt_param = 8) sample16 <- tbl_df(create_sample(obs = 1e3, rate = 1/16, b2 = c(.5, 0, 0))) %>% mutate(opt_param = 16) saveRDS(bind_rows(sample2, sample4, sample8, sample16), file = "~/Dropbox/R/simcompl/application/simulated_data/basic_sampels.Rds")
require(dplyr, quietly = TRUE, warn.conflicts = FALSE) require(ggplot2, quietly = TRUE) require(ggthemes, quietly = TRUE) plot <- (readRDS("~/Dropbox/R/simcompl/application/simulated_data/basic_sampels.Rds") %>% ggplot(aes(y = x1, x = x2)) + geom_point(alpha = .2) + theme_tufte(base_size = 18) + facet_wrap(~ opt_param) ) print(plot)
$\beta_{12} = .5, \delta_1 = \delta_2 = 1$
nsim <- 200 b2_in <- list(c(0, 0, 0), c(.5, 0, 0)) rate_in <- list(1/2, 1/4, 1/8, 1/16) sims <- run_sim(family_method = "basic", rate = rate_in, b2 = b2_in, nsim = nsim) saveRDS(sims, "~/Dropbox/R/simcompl/application/simulated_data/basic_sim.Rds")
plot <- (readRDS("~/Dropbox/R/simcompl/application/simulated_data/basic_sim.RDS") %>% tbl_df %>% mutate(method = ifelse(method == "matching", "demand", "production"), optim = 1/survival_rate, b2 = ifelse(b2 == "0, 0, 0", "no effect", "effect")) %>% ggplot(aes(y = stat, x = b2)) + geom_tufteboxplot() + theme_tufte(base_size = 18) + facet_grid(method ~ optim) + geom_hline(yintercept = 2, linetype = 3, alpha = .25) + geom_hline(yintercept = 0, linetype = 4, alpha = .25) + geom_hline(yintercept = -2, linetype = 3, alpha = .25) + xlab("") ) print(plot)
nsim <- 200 b2_in <- list(c(.25, 0, 0), c(.75, 0, 0)) rate_in <- list(1/2, 1/4, 1/8, 1/16) sims <- run_sim(family_method = "interaction_traditional", rate = rate_in, b2 = b2_in, nsim = nsim) saveRDS(sims, "~/Dropbox/R/simcompl/application/simulated_data/extrab12_sim.Rds")
sims <- (readRDS("~/Dropbox/R/simcompl/application/simulated_data/basic_sim.RDS") %>% filter(method == "interaction_traditional") %>% tbl_df() %>% bind_rows(readRDS( "~/Dropbox/R/simcompl/application/simulated_data/extrab12_sim.RDS")) %>% mutate(optim = 1/survival_rate, b2 = ifelse(b2 == "0, 0, 0", 0, ifelse(b2 == "0.25, 0, 0", .25, ifelse(b2 == "0.5, 0, 0", .5, .75)))) ) plot <- (ggplot(sims, aes(y = stat, x = as.factor(b2))) + geom_tufteboxplot() + theme_tufte(base_size = 18) + facet_grid(~ optim) + geom_hline(yintercept = 2, linetype = 3, alpha = .25) + geom_hline(yintercept = 0, linetype = 4, alpha = .25) + geom_hline(yintercept = -2, linetype = 3, alpha = .25) + xlab("") ) print(plot)
$$\beta_{12} = .5, \delta_1 = \delta_2 = 1, \gamma_1 = \gamma_2 = .5, \sigma^{\epsilon}_1 = \sigma^{\epsilon}_2 = .5$$
nsim <- 200 b2_in <- list(c(0, 0, 0), c(.5, 0, 0)) rate_in <- list(1/2, 1/4, 1/8, 1/16) sd_eps_in <- c(.5, .5, 0) g1_in = c(.5, .5, 0) sims <- run_sim(family_method = "basic", rate = rate_in, b2 = b2_in, nsim = nsim, sd_eps = sd_eps_in, g1 = g1_in) saveRDS(sims, "~/Dropbox/R/simcompl/application/simulated_data/posg1_sim.Rds")
plot <- (readRDS("~/Dropbox/R/simcompl/application/simulated_data/posg1_sim.RDS") %>% tbl_df %>% mutate(method = ifelse(method == "matching", "demand", "production"), optim = 1/survival_rate, b2 = ifelse(b2 == "0, 0, 0", "no effect", "effect")) %>% ggplot(aes(y = stat, x = b2)) + geom_tufteboxplot() + theme_tufte(base_size = 18) + facet_grid(method ~ optim) + geom_hline(yintercept = 2, linetype = 3, alpha = .25) + geom_hline(yintercept = 0, linetype = 4, alpha = .25) + geom_hline(yintercept = -2, linetype = 3, alpha = .25) + xlab("") ) print(plot)
$$\beta_{12} = .5, \delta_1 = \delta_2 = 1, \gamma_1 = .5, \gamma_2 = -.5, \sigma^{\epsilon}_1 = \sigma^{\epsilon}_2 = .5$$
nsim <- 200 b2_in <- list(c(0, 0, 0), c(.5, 0, 0)) rate_in <- list(1/2, 1/4, 1/8, 1/16) sd_eps_in <- c(.5, .5, 0) g1_in = c(.5, -.5, 0) sims <- run_sim(family_method = "basic", rate = rate_in, b2 = b2_in, nsim = nsim, sd_eps = sd_eps_in, g1 = g1_in) saveRDS(sims, "~/Dropbox/R/simcompl/application/simulated_data/negg1_sim.Rds")
plot <- (readRDS("~/Dropbox/R/simcompl/application/simulated_data/negg1_sim.RDS") %>% tbl_df %>% mutate(method = ifelse(method == "matching", "demand", "production"), optim = 1/survival_rate, b2 = ifelse(b2 == "0, 0, 0", "no effect", "effect")) %>% ggplot(aes(y = stat, x = b2)) + geom_tufteboxplot() + theme_tufte(base_size = 18) + facet_grid(method ~ optim) + geom_hline(yintercept = 2, linetype = 3, alpha = .25) + geom_hline(yintercept = 0, linetype = 4, alpha = .25) + geom_hline(yintercept = -2, linetype = 3, alpha = .25) + xlab("") ) print(plot)
nsim <- 200 b2_in <- list(c(0, 0, 0), c(.5, 0, 0)) rate_in <- list(1/2, 1/4, 1/8, 1/16) method_in = list("interaction_traditional", "interaction_augmented", "interaction_moderation", "interaction_moderationaugmented") sims <- run_sim(family_method = method_in, rate = rate_in, b2 = b2_in, nsim = nsim) saveRDS(sims, "~/Dropbox/R/simcompl/application/simulated_data/alterint_sim.Rds")
plot <- (readRDS("~/Dropbox/R/simcompl/application/simulated_data/alterint_sim.RDS") %>% tbl_df %>% mutate(moderation = ifelse(grepl("moderation", method), "moderation", "no moderation"), decreasing = ifelse(grepl("augmented", method), "decreasing", "no decreasing"), optim = 1/survival_rate, b2 = ifelse(b2 == "0, 0, 0", "no effect", "effect")) %>% ggplot(aes(y = stat, x = b2)) + geom_tufteboxplot() + theme_tufte(base_size = 18) + facet_grid(decreasing + moderation ~ optim) + geom_hline(yintercept = 2, linetype = 3, alpha = .25) + geom_hline(yintercept = 0, linetype = 4, alpha = .25) + geom_hline(yintercept = -2, linetype = 3, alpha = .25) + xlab("") ) print(plot)
$\gamma_1 = .5, \gamma_2 = .5$
nsim <- 200 b2_in <- list(c(0, 0, 0), c(.5, 0, 0)) rate_in <- list(1/2, 1/4, 1/8, 1/16) sd_eps_in <- c(.5, .5, 0) g1_in = c(.5, .5, 0) method_in = list("interaction_traditional", "interaction_augmented", "interaction_moderation", "interaction_moderationaugmented") sims <- run_sim(family_method = method_in, rate = rate_in, b2 = b2_in, nsim = nsim, sd_eps = sd_eps_in, g1 = g1_in) saveRDS(sims, "~/Dropbox/R/simcompl/application/simulated_data/alterintpos_sim.Rds")
plot <- (readRDS("~/Dropbox/R/simcompl/application/simulated_data/alterintpos_sim.RDS") %>% tbl_df %>% mutate(moderation = ifelse(grepl("moderation", method), "moderation", "no moderation"), decreasing = ifelse(grepl("augmented", method), "decreasing", "no decreasing"), optim = 1/survival_rate, b2 = ifelse(b2 == "0, 0, 0", "no effect", "effect")) %>% ggplot(aes(y = stat, x = b2)) + geom_tufteboxplot() + theme_tufte(base_size = 18) + facet_grid(decreasing + moderation ~ optim) + geom_hline(yintercept = 2, linetype = 3, alpha = .25) + geom_hline(yintercept = 0, linetype = 4, alpha = .25) + geom_hline(yintercept = -2, linetype = 3, alpha = .25) + xlab("") ) print(plot)
dat <- (readRDS("~/Dropbox/R/simcompl/application/simulated_data/basic_sim.RDS") %>% filter(method == "matching") %>% mutate(type = "absent") %>% bind_rows( readRDS("~/Dropbox/R/simcompl/application/simulated_data/posg1_sim.RDS") %>% filter(method == "matching") %>% mutate(type = "positive") ) %>% bind_rows( readRDS("~/Dropbox/R/simcompl/application/simulated_data/negg1_sim.RDS") %>% filter(method == "matching") %>% mutate(type = "negative") ) %>% tbl_df() %>% mutate(optim = 1/survival_rate, b2 = ifelse(b2 == "0, 0, 0", "no effect", "effect")) ) plot <- ( ggplot(dat, aes(y = coefficient, x = b2)) + geom_tufteboxplot() + theme_tufte(base_size = 18) + facet_grid(type ~ optim) + geom_hline(yintercept = 0, linetype = 3, alpha = .25) + geom_hline(yintercept = .5, linetype = 3, alpha = .25) + xlab("") ) print(plot)
$$ \delta_1 x_{1i} = \beta_1 + \gamma_1 z_i + \beta_{12} x_{2i} + \epsilon_{1i} \ \delta_2 x_{2i} = \beta_2 + \gamma_2 z_i + \beta_{12} x_{1i} + \epsilon_{2i} $$
$$ y_i = \alpha_1^m abs(\epsilon_{1i}) + \alpha_2^m abs(\epsilon_{2i}) + \nu_i^m $$
knitr::include_graphics("http://imgs.xkcd.com/comics/physicists.png")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.