DeclareDesign Community

How does the `declare_diagnosands` function work?

#1

I am having a little trouble with the declare_diagnosands function.

my_population <- declare_population(N = 500, noise = rnorm(N))

my_potential_outcomes <- declare_potential_outcomes(
  Y_Z_0 = noise, Y_Z_1 = noise +
  rnorm(N, mean = 2, sd = 2))

my_assignment <- declare_assignment()

my_estimand <- declare_estimand(ATE = mean(Y_Z_1 - Y_Z_0))

my_estimator <- declare_estimator(Y ~ Z, estimand = my_estimand)

my_reveal <- declare_reveal()

my_diagnosands <- declare_diagnosands(select = c(bias, rmse))

design <- my_population + my_potential_outcomes + my_estimand +
        my_assignment + my_reveal + my_estimator + my_diagnosands


diagnosis <- diagnose_design(design, sims = 10)
get_diagnosands(diagnosis)

I am expecting to only have bias and rmse. Instead I still have all diagnosands. Am I using this function correctly?

Also, is it correct to say that declare_diagnosands is outside of the MIDA framework?

0 Likes

#2

Hi John-Henry,

I am expecting to only have bias and rmse. Instead I still have all diagnosands. Am I using this function correctly?
Also, is it correct to say that declare_diagnosands is outside of the MIDA framework?

These questions are related, in that we don’t conceive of diagnosands as part of the design itself. They’re things that you can learn about designs.

So, in that spirit, we see it as most natural to think of diagnosands as something that comes in at the diagnostic phase:

diagnosis <- diagnose_design(design, sims = 10, diagnosands = my_diagnosands)

Which will give you what you want.

That said, you could also use set_diagnosands() and have code similar to what you had before:

design <- set_diagnosands(design,my_diagnosands)
diagnose_design(design, sims = 10)
1 Like

#3

Looking at the documentation, I see that we’re not so clear about this, however. I’ll issue it and update our documentation – thanks for bringing this to our attention!

1 Like