benbhansen-stats / propertee

Prognostic Regression Offsets with Propagation of ERrors, for Treatment Effect Estimation (IES R305D210029).
https://benbhansen-stats.github.io/propertee/
Other
2 stars 0 forks source link

vcovDA's applicable to paired assignment, w/ illustrative vignette #67

Open benthestatistician opened 2 years ago

benthestatistician commented 2 years ago
benthestatistician commented 2 years ago

(Xinhe and Josh, pls don't hesitate to update & add appropriate detail to issue statement.)

benthestatistician commented 2 years ago

The 2 papers I shared w/ @jwasserman2 today, as sources about the econometric conventional wisdom regarding sandwich estimation of covariance after paired assignment of clusters:

benthestatistician commented 2 years ago

@jwasserman2 and I had a brief discussion today of the implementation of logic deciding which flavor of design-based variance estimator should be applied in which strata. This post is a followup to that discussion.

It would be useful for this purpose to have abstracted a table from the Design tallying the numbers of assignment unit by block, e.g.

Condi tion
Block C T
B1 1 3
B2 2 2

I promised I'd poke around for some related code elsewhere. Found it not to exist in the form that I had remembered. But I'll point out that flexida::treatment_table() is doing something related and is perhaps adaptible to this purpose.

josherrickson commented 2 years ago

Edit: Nevermind I was completely misremembering how that function worked. I do agree that a more generic table'ing function could be useful.

josherrickson commented 2 years ago

I expanded treatment_table into the new dtable() function (alias'd to design_table() for now but I'm considering removing that).

dtable(design, "treatment") replicates the existing functionality of treatment_table(), but now supports e.g. dtable(design, "t", "b") to obtain the table you drew above.

> data(simdata)
> des <- rct_design(z ~ uoa(cid1, cid2) + block(bid), data = simdata)
> dtable(des, "tr", "bl")
      treatment
blocks 0 1
     1 3 1
     2 2 1
     3 1 2

(The 2nd and 3rd arguments, x and optionally y, match against the full names "treatment", "blocks", etc, so x = "tre" for example is valid.)

jwasserman2 commented 2 years ago

Thoughts on some of the implementation here, specifically the "cluster level" dispatch, have been updated by #85

benthestatistician commented 3 months ago

Please see list of outstanding to-do's for the vignette at top of thread for #179.