Skip to content

Commit 3211bc4

Browse files
authored
Merge pull request #255 from DeclareDesign/cran-fix
Cran fix
2 parents ee1b943 + 88d37d1 commit 3211bc4

File tree

6 files changed

+19
-12
lines changed

6 files changed

+19
-12
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: DesignLibrary
22
Type: Package
33
Title: Library of Research Designs
4-
Version: 0.1.4.9999
4+
Version: 0.1.5
55
Authors@R: c(person("Graeme", "Blair", email = "graeme.blair@ucla.edu", role = c("aut")),
66
person("Jasper", "Cooper", email = "jjc2247@columbia.edu", role = c("aut", "cre")),
77
person("Alexander", "Coppock", email = "alex.coppock@yale.edu", role = c("aut")),

NAMESPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ importFrom(DeclareDesign,diagnose_design)
3535
importFrom(DeclareDesign,draw_data)
3636
importFrom(DeclareDesign,draw_estimands)
3737
importFrom(DeclareDesign,draw_estimates)
38+
importFrom(DeclareDesign,label_estimator)
3839
importFrom(DeclareDesign,redesign)
3940
importFrom(DeclareDesign,set_diagnosands)
40-
importFrom(DeclareDesign,tidy_estimator)
4141
importFrom(estimatr,difference_in_means)
4242
importFrom(estimatr,iv_robust)
4343
importFrom(estimatr,lm_lin)

NEWS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# DesignLibrary 0.1.5
2+
3+
* fixed bug in randomized_response_designer diagnosands
4+
5+
* deprecated `tidy_estimator()`
6+
17
# DesignLibrary 0.1.4
28

39
* updated tests to be compatible with rlang 0.3.0

R/factorial_designer.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#'
2626
#' @author \href{https://declaredesign.org/}{DeclareDesign Team}
2727
#' @concept factorial
28-
#' @importFrom DeclareDesign declare_assignment declare_estimand declare_estimator declare_population declare_potential_outcomes declare_reveal declare_step diagnose_design tidy_estimator
28+
#' @importFrom DeclareDesign declare_assignment declare_estimand declare_estimator declare_population declare_potential_outcomes declare_reveal declare_step diagnose_design label_estimator
2929
#' @importFrom fabricatr fabricate fabricate
3030
#' @importFrom randomizr conduct_ra
3131
#' @importFrom estimatr tidy lm_robust
@@ -211,7 +211,7 @@ factorial_designer <- function(
211211

212212
estimator_expr <- expr(
213213
declare_estimator(
214-
handler = tidy_estimator(function(data){
214+
handler = label_estimator(function(data){
215215
data[, names(data) %in% !!treatment_names] <- data[, names(data) %in% !!treatment_names] - 0.5
216216
mod <- lm_robust(formula = !!estimator_formula, data = data, weights = 1/Z_cond_prob)
217217
estimate_df <- tidy(mod)

R/process_tracing_designer.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,25 +190,25 @@ process_tracing_designer <- function(
190190
))}
191191

192192
prior_only_estimator <- declare_estimator(
193-
handler = tidy_estimator(prior_only),
193+
handler = label_estimator(prior_only),
194194
label = "No tests (Prior)",
195195
estimand = estimand
196196
)
197197

198198
E1_only_estimator <- declare_estimator(
199-
handler = tidy_estimator(E1_only),
199+
handler = label_estimator(E1_only),
200200
label = label_E1,
201201
estimand = estimand
202202
)
203203

204204
E2_only_estimator <- declare_estimator(
205-
handler = tidy_estimator(E2_only),
205+
handler = label_estimator(E2_only),
206206
label = label_E2,
207207
estimand = estimand
208208
)
209209

210210
E1_and_E2_estimator <- declare_estimator(
211-
handler = tidy_estimator(E1_and_E2),
211+
handler = label_estimator(E1_and_E2),
212212
label = paste(label_E1, "and", label_E2),
213213
estimand = estimand
214214
)

R/randomized_response_designer.R

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#' @author \href{https://declaredesign.org/}{DeclareDesign Team}
1717
#' @concept experiment
1818
#' @concept descriptive
19-
#' @importFrom DeclareDesign declare_assignment declare_diagnosands declare_estimand declare_estimator declare_population declare_potential_outcomes declare_reveal set_diagnosands tidy_estimator
19+
#' @importFrom DeclareDesign declare_assignment declare_diagnosands declare_estimand declare_estimator declare_population declare_potential_outcomes declare_reveal set_diagnosands label_estimator
2020
#' @importFrom fabricatr fabricate draw_binary
2121
#' @importFrom randomizr conduct_ra
2222
#' @export
@@ -58,7 +58,7 @@ randomized_response_designer <- function(N = 1000,
5858

5959
# A: Answer Strategy
6060
estimator_randomized_response <- declare_estimator(
61-
handler = tidy_estimator(
61+
handler = label_estimator(
6262
function(data) with(
6363
data,
6464
data.frame(estimate = (mean(Y) - prob_forced_yes) / (1 - prob_forced_yes)))),
@@ -67,7 +67,7 @@ randomized_response_designer <- function(N = 1000,
6767
)
6868

6969
estimator_direct_question <- declare_estimator(
70-
handler = tidy_estimator(function(data) with(
70+
handler = label_estimator(function(data) with(
7171
data,
7272
data.frame(estimate = mean(direct_answer)))),
7373
estimand = estimand,
@@ -81,7 +81,8 @@ randomized_response_designer <- function(N = 1000,
8181

8282
randomized_response_design <- set_diagnosands(
8383
randomized_response_design,
84-
declare_diagnosands(select = bias)
84+
declare_diagnosands(bias = mean(estimate - estimand)
85+
)
8586
)
8687

8788
}}}

0 commit comments

Comments
 (0)