Skip to content

Issue with cluster parameter in ddd() function - no effect and error with custom data #25

@xiezheyu

Description

@xiezheyu

Dear Ortiz-Villavicencio and Sant’Anna

Hi, first, thank you for developing and maintaining the triplediff package. It is an incredibly valuable tool for the research community. I encountered two issues when using the cluster parameter in the ddd() function:

Issue 1: Cluster parameter has no effect
When comparing results with and without the cluster parameter, I get identical outputs:

Without cluster

att_gt <- ddd(yname = "y", tname = "time", idname = "id", gname = "state",
pname = "partition", xformla = ~cov1 + cov2 + cov3 + cov4,
data = data, control_group = "nevertreated",
base_period = "universal", est_method = "dr")

With cluster

att_gt <- ddd(yname = "y", tname = "time", idname = "id", gname = "state",
pname = "partition", xformla = ~cov1 + cov2 + cov3 + cov4,
data = data, control_group = "nevertreated",
base_period = "universal", est_method = "dr", cluster = "cluster")
Both return the same results, suggesting the cluster parameter might not be working as expected.

Issue 2: Error with custom data
When using my dataset with the cluster parameter, I frequently encounter this error:

Error in as.vector(x, "list"):
cannot coerce type 'closure' to vector of type 'list'
This error doesn't occur when I remove the cluster parameter from the function call.

Could you please help investigate these issues? The cluster parameter seems important for obtaining robust standard errors, but it's currently not functioning properly.

Thank you for your time and this excellent package!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions