DeclareDesign Community

DeclareDesign Beginner's Tutorial

Hi everyone,

I wrote an extensive tutorial for beginners that hopefully some of you might find useful! Please feel free to send feedback or let me know about parts they might be unclear

https://rpubs.com/john-henry/declare-design-1

1 Like

Here is one useful figure from the guide that I use to help me think about the process :slight_smile:

That diagram is most excellent! :+1:

And a couple minor things I’d mention/comments:

  • when you are loading libraries / set.seed - also load future and do plan(multicore) to run simulations in parallel. This is a good habit to model.
  • redesign / expand_design do different things: redesign edits an instantiated design (including captured variables), vs expand_design is meant to be used with the design library functions. expand_design is “more hygenic” I would maybe add a dotted line from expand_design to the Design Library.
  • For density plot, you could set fill aesthetic instead of just a line.
  • All diagnosand se’s are bootstrapped, and the number of reps can be adjusted
  • For the power plot, I’d recommend geom_ribbons + lines instead of bar / error bar.
    • Also the ±1.96*se is probably fine, you could go through qbeta if you saw it going out of bounds - it looked pretty close.
  • When discussing redesign, you could specifically call out that it forms all combinations rather than letting the reader pick it up from the example.
1 Like

Wow this is beautiful! Thank you for sharing it!

1 Like

I found this to be super helpful. Two quick things:

  1. It’d be useful for you to include a definition of “estimate” and “estimand.”
  2. You don’t define n_sims in your code, but it’s clear through output that you’d set it to be 100.
1 Like

@nfultz thank you for the advice! I am going to include those changes when I get the chance and maybe DM (?) you.

@Flourish thanks you for the advice on point 1! I will include that. In regard to 2. I define n_sims around the place where I load the libraries, but I’ll try and make that more clear. Thank you!

Ah! Sorry I missed that. Great work! If you need any motivation to create even more tutorials on this, I should say that this has been the most helpful document I’ve come across by far. Would love if you made similar tutorials on more advance designs.

1 Like

Thanks! I have a draft of a more complicated tutorial written for DD, and a tutorial on DesignLibrary (also aimed at beginners). I’m hoping to get them both out by January!

1 Like