DeclareDesign / estimatr

estimatr: Fast Estimators for Design-Based Inference
https://declaredesign.org/r/estimatr
Other
131 stars 20 forks source link

alpha not passing thru? #391

Closed acoppock closed 1 year ago

acoppock commented 2 years ago
library(estimatr)

dat <- 
  data.frame(
    Y = rnorm(100),
    Z = rbinom(100, 1, 0.5)
  )

lm_robust(Y ~ Z, data = dat)
lm_robust(Y ~ Z, alpha = 0.10, data = dat)

returns:

> lm_robust(Y ~ Z, data = dat)
              Estimate Std. Error    t value   Pr(>|t|)   CI Lower  CI Upper DF
(Intercept)  0.2332325  0.1353415  1.7232889 0.08799008 -0.0353483 0.5018132 98
Z           -0.1578283  0.1921291 -0.8214704 0.41337238 -0.5391022 0.2234455 98
> lm_robust(Y ~ Z, alpha = 0.10, data = dat)
              Estimate Std. Error    t value   Pr(>|t|)     CI Lower  CI Upper DF
(Intercept)  0.2332325  0.1353415  1.7232889 0.08799008  0.008491007 0.4579739 98
Z           -0.1578283  0.1921291 -0.8214704 0.41337238 -0.476868457 0.1612118 98

p-values should be different

nfultz commented 2 years ago

Shouldn't it just affect the width of the CIs? Not the p?

lukesonnet commented 2 years ago

lmao im sure Neal is right but I don't trust past luke at all so instead of closing this I'm gonna ask Alex to follow-up.