Created
February 18, 2020 20:34
-
-
Save BioSciEconomist/f1bf51ad668368123494ad48954850cb to your computer and use it in GitHub Desktop.
IV/LATE/CACE Power Analysis
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
# ------------------------------------------------------------------ | |
# |PROGRAM NAME: sample size for LATE.R | |
# |DATE: 1/30/19 | |
# |CREATED BY: MATT BOGARD | |
# |PROJECT FILE: M:\Matt B\MB Coders Corner | |
# |---------------------------------------------------------------- | |
# | PURPOSE: sample size and power calculations for LATE in instrumental variables analysis | |
# |---------------------------------------------------------------- | |
# based on: Kirk Bansak. "A Generalized Framework for the Estimation of Causal Moderation Effects with | |
# Randomized Treatments and Non-Randomized Moderators." (Under Review) https://arxiv.org/pdf/1610.08580.pdf | |
# conservative N LATE Power Analysis (p.21 in Bansak 2017 using formulas on p. 19) | |
M <- qnorm(1-.05/2) + qnorm(.8) # multiplier | |
pi <- .63 # compliance rate | |
p <- .67 # treatment assignment probability | |
k <- .10 # effect size | |
# Nlow <- (M^2*(1+.25*k^2 -k))/(p*(1-p)*k^2*pi^2) | |
Nhigh <- (M^2*(1+.25*k^2 + k))/(p*(1-p)*k^2*pi^2) | |
print(Nhigh) | |
Nstar <-(M^2*(1+.25*k^2))/(p*(1-p)*k^2*pi^2) | |
print(Nstar) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment