DeclareDesign / DesignLibrary

Library of Research Designs
https://declaredesign.org/library/
Other
30 stars 3 forks source link

Add two_arm_covariate_designer #214

Closed jaspercooper closed 5 years ago

jaspercooper commented 5 years ago

Description

Builds a design with one treatment and one control arm. Treatment effects can be specified either by providing \code{control_mean} and \code{treatment_mean} or by specifying a \code{control_mean} and \code{ate}. Non random assignment is specified by a possible correlation, \code{rho_WZ}, between \code{W} and a latent variable that determines the probability of \code{Z}.
Nonignorability is specified by a possible correlation, \code{rho_WY}, between \code{W} and outcome \code{Y}.

Checklist:

nfultz commented 5 years ago

You should be able to use generics and not broom with estimatr, fwiw

jaspercooper commented 5 years ago

Thanks, @nfultz I just tried it because I'm getting a weird error on travis, where DD doesn't seem to be finding the right model method for lm_lin objects. Weird though, because it runs fine locally:

Error in validation_fn(handler)(ret, dots, label) : You provided a lm_lin model, which DeclareDesign does not directly support. It's possible that the broom package can help. Please install the broom package with install.packages('broom') and try declaring your estimator again. If that fix does not work, you may need to write a custom estimator.

@acoppock suggests checking the generics version so I'll try that. Happy for any advice.

nfultz commented 5 years ago

lm_lin doesn't have a tidy method defined in estimatr: https://github.com/DeclareDesign/estimatr/blob/master/R/S3_tidy.R

We could add one I guess.

jaspercooper commented 5 years ago

Not sure I understand how the diagnosis and designer can work fine locally without a tidy method, and then break on Travis, though. Do you have a sense of what is generating this @nfultz ?

clarabicalho commented 5 years ago

validation_fn() is set to error for lm_lin, even though tidy() works on lm_lin class with the current estimatr version. Should still create S3 method for lm_lin?

PR on DeclareDesign: https://github.com/DeclareDesign/DeclareDesign/compare/remove-error-message-for-lm_lin?expand=1

coveralls commented 5 years ago

Pull Request Test Coverage Report for Build 1260


Totals Coverage Status
Change from base Build 1258: 0.0%
Covered Lines: 862
Relevant Lines: 862

💛 - Coveralls