kolesarm / RDHonest

Honest inference in regression discontinuity designs
56 stars 15 forks source link

Outputting results of RDHonest into a table #3

Closed mcneilsm closed 3 years ago

mcneilsm commented 3 years ago

Hello,

I'm interested in outputting the results of the RDHonest command into a table. Is there already a straightforward way of doing so? If not, is there code available to make the command compatible with broom::tidy() or another table-making function?

Thank you- Shelby

kolesarm commented 3 years ago

Hi Shelby: The RDHonest command returns a list with the estimates, which you can then format as you wish (see help for RDHonest for a description of the output). For example,

## Try different specifications for M
r1 <- RDHonest(voteshare ~ margin, data = lee08, M = 0.1, opt.criterion = "FLCI")
r2 <- RDHonest(voteshare ~ margin, data = lee08, M = 0.2, opt.criterion = "FLCI")
r3 <- RDHonest(voteshare ~ margin, data = lee08, M = 0.05, opt.criterion = "FLCI")
data.frame(rbind(r1[c(1, 3, 4, 7)], r2[c(1, 3, 4, 7)], r3[c(1, 3, 4, 7)]))

yields

  estimate  maxbias      sd      hl
1  5.95445 0.883391 1.27878 3.00169
2  5.81907  1.00156  1.4089  3.3334
3  6.09927 0.750635 1.14972  2.6588

At the moment, the output is not in the format that broom::tidy() could use, however.

mcneilsm commented 3 years ago

Thank you for the clarification and example-I appreciate it!