This file contains hidden or 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 |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 How Power Can Vary | |
| # Description: The purpose of this script is to show how power can vary | |
| # based on effect size and sample size. Power is calculated for several scenarios | |
| # then plotted to demonstrate the importance of power/sample size. | |
| # Setup ---- | |
| library(tidyverse) # ol faithful |
This file contains hidden or 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 Standard Error | |
| # Description: The purpose of this script is to demonstrate standard error. | |
| # A sample is repeatedly drawn then the mean is calculated. The result, each | |
| # sample mean is then plotted | |
| # Setup ---- | |
| library(tidyverse) # ol faithful |
This file contains hidden or 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 P-Value | |
| # Description: The purpose of this script is to demonstrate what a | |
| # p-value is. A logistic regression was used and the difference in deviances for | |
| # including the main effect in the model vs not (aka Likelihood Ratio Test). | |
| # Setup ---- | |
| library(tidyverse) # ol faithful |
This file contains hidden or 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 Confidence Intervals | |
| # Description: The purpose of this script is to simulate data to show what a | |
| # confidence interval is. The goal is to highlight that the 95% has to do | |
| # with us repeatedly sampling the value. | |
| # Setup ---- | |
| library(tidyverse) # ol faithful | |
| library(ggridges) # used for ridge plot |
This file contains hidden or 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: Dichotomization Can Reduce Precision (SE) | |
| # Description: Demonstrating how dichotomization of a continuous covariate | |
| # can reduce precision (showing this based on the standard error) | |
| # Setup ---- | |
| library(tidyverse) # ol' faithful | |
| # Parameters for the Simulation ---- |
This file contains hidden or 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 Power Loss | |
| # Description: Demonstrating the reduction in power by dichotomizing a covariate. | |
| # Setup ---- | |
| library(tidyverse) # ol faithful | |
| library(broom) # for tidying the model results | |
| # Function for Estimating Treatment Effect ---- |
OlderNewer