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

`unit_of_assignment()` for no clusters #193

Open benthestatistician opened 7 hours ago

benthestatistician commented 7 hours ago

Can we support rct_spec(treatment~cluster(), data=foo), as meaning that each observation is its own cluster?

benthestatistician commented 7 hours ago

This would improve usages like the following, taken from the current cov_adj() example.

data(STARdata)
STARdata$studentid <- as.character(seq_len(nrow(STARdata)))
STARdata_spec <- rct_spec(stark ~ cluster(studentid), data = STARdata)

We could instead recommend

data(STARdata)
STARdata_spec <- rct_spec(stark ~ cluster(), data = STARdata)

(NB: I did try the following without success:

data(STARdata)
STARdata_spec <- rct_spec(stark ~ cluster(data), data = STARdata)

I also got an error from OTOH this works

data(STARdata)
STARdata_spec <- rct_spec(stark ~ cluster(STARdata), data = STARdata)

.)