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
setwd("") | |
library(tidyverse) | |
library(censusapi) | |
library(ggrepel) | |
data(fips_codes) | |
############### |
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
\documentclass{article} | |
\usepackage{tikz} | |
\usetikzlibrary{calc} | |
\usetikzlibrary{matrix} | |
\usetikzlibrary{positioning} | |
\usetikzlibrary{arrows} | |
\usetikzlibrary{decorations.markings} | |
\begin{document} |
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
Binv(p,q)=exp(lgamma(p+q)-lgamma(p)-lgamma(q)) | |
beta(x,p,q)=p<=0||q<=0?1/0:x<0||x>1?0.0:Binv(p,q)*x**(p-1.0)*(1.0-x)**(q-1.0) | |
ymax = 3.2 | |
xmin = 0.0 | |
xmax = 1.0 | |
set term gif animate delay 4 | |
set output "betapdf.gif" |
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
# FN calcualtes Box-Steffensmeier %h(t), (Box-Steffensmeier / Jones, 2004, 60) | |
# | |
# %h(t) = ( exp(b*X_1) - exp(b*X_2) ) /exp(b*X_2) | |
# | |
# Input: | |
# - x: a vector of two values for the quantity of interest that changes from the first value to the second value | |
# - xname: the variable name of the covariate that is the quantity of interest | |
# - Xfix: a dataframe of all other covariate values that are kept constant | |
# - model: the coxph model | |
# Output: |