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
# Title: Plotting Distributions for PS Methods | |
# Description: An example of plotting the distributions before and after | |
# IPTW of two confounders. | |
# Setup ---- | |
#... Libraries ---- | |
library(tidyverse) # ol faithful |
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
# Title: Conditioning on a Collider | |
# Description: Directed acyclic graphs (DAGs) are a great tool that can be | |
# used to guide variable selection. Colliders, a variable where two arrowheads meet, | |
# should not be adjusted for since they can induce bias. This code aims to prove | |
# and quantify the bias using a simple example. | |
# Setup ---- | |
#... Libraries ---- |
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
# Title: Demonstration of the Central Limit Theorem | |
# Description: The purpose of this script is to simulate data for three different | |
# distributions (normal, logistic and poisson) for four different sample sizes. | |
# Each of these is then plotted to demonstrate how the sampling distribution | |
# changes with increasing sizes of the sample. | |
# Setup ---- |
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
# Title: Calculating Probability of Censoring | |
# Description: Inverse probability of censoring weighting (IPCW) can be used to remove the potential selection bias | |
# caused by censoring. There are different ways to calculate the probability of censoring. The goal of this code was | |
# to examine whether the two methods produced the same result. | |
# Setup ---- | |
#... Libraries |