This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% BibTeX standard bibliography style `apsr' (one of the harvard family) version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09. | |
% Copyright (C) 2011, all rights reserved. | |
% Copying of this file is authorized only if either: | |
% (1) you make absolutely no changes to your copy, including name, or | |
% (2) if you do make changes, you name it something other than btxbst.doc, plain.bst, unsrt.bst, alpha.bst, abbrv.bst, agsm.bst, dcu.bst or kluwer.bst, jmr.bst, apsr.bst. | |
% This restriction helps ensure that all standard styles are identical. | |
% The file harvard.tex has the documentation for this style. | |
% ACKNOWLEDGEMENT: | |
% This document is a modified version of alpha.bst and apsr.bst to which it owes much of its functionality. It has been adapted to produce American Political Science Association style references |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# load packages | |
library(tidyverse) | |
library(brms) | |
library(marginaleffects) | |
# load fake data that should resemble final data set (these are "big" effects--effects might be smaller than this) | |
toy <- read_csv("https://gist.githubusercontent.com/carlislerainey/ba2c556f322135fe439ed9639975c922/raw/bc0ab6fecc23762d8da736eecb888bd1e4cbc92a/toy.csv") %>% | |
glimpse() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Category | Issue | Policy | |
---|---|---|---|
Economic | Drug Costs | allowing imported drugs from Canada | |
Economic | Drug Costs | eliminate drug advertisements | |
Economic | Drug Costs | requiring to pay higher share in drugs | |
Economic | Education | free state college tuition | |
Economic | Energy | adding monthly charge to utility bill to combat climate change | |
Economic | Energy | carbon dioxide emission limits | |
Economic | Energy | coal | |
Economic | Energy | drilling | |
Economic | Energy | energy efficiency |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(DeclareDesign) | |
# Original parameters | |
tau <- 1 # treatment effect | |
se <- tau / (qnorm(0.95) + qnorm(0.80)) # standard error for 80% power | |
n_planned <- 500 # sample size per condition in planned full study | |
# calculate required standard deviation to yield 80% power given the above | |
sigma <- se * sqrt(2 * n_planned / 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# load packages | |
library(modelsummary) | |
# get latest version of {crdata} package, if updated | |
remotes::install_github("carlislerainey/crdata") | |
# load (and slightly wrangle) data from Barrilleaux and Rainey (2014) | |
br <- crdata::br2014 %>% | |
# recode from centered GOP gov. indicator to 0/1 Dem. gov. indicator | |
# (explanatory variables are centered about mean) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# load packages | |
library(tidyverse) | |
# update {crdata} if necessary | |
remotes::install_github("carlislerainey/crdata") | |
# load data | |
weis <- crdata::weisiger2014 | |
# rescale weisiger2014 explanatory variables using arm::rescale() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# load packages | |
library(tidyverse) | |
# create data frame of the potential outcomes | |
po <- tribble( | |
~Name, ~Y1, ~Y0, | |
"Alex Smith", 7, 5, | |
"Jamie Doe", 2, 3, | |
"Pat Johnson", 7, 7, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# load packages | |
library(tidyverse) | |
# create data frame of the potential outcomes | |
po <- tribble( | |
~Name, ~Y1, ~Y0, | |
"Alex Smith", 7, 5, | |
"Jamie Doe", 2, 3, | |
"Pat Johnson", 7, 7, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# load packages | |
library(tidyverse) | |
# create data frame of the potential outcomes | |
po <- tribble( | |
~Name, ~Y1, ~Y0, | |
"Alex Smith", 7, 5, | |
"Jamie Doe", 2, 3, | |
"Pat Johnson", 7, 7, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# load packages | |
library(rstan) | |
library(bayesplot) | |
# make a stan model | |
fancy_stan_model <- " | |
generated quantities { | |
int<lower=0, upper=1> y_sim = bernoulli_rng(0.5); | |
} | |
" |
NewerOlder