-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_combined_power.R
More file actions
18 lines (15 loc) · 984 Bytes
/
create_combined_power.R
File metadata and controls
18 lines (15 loc) · 984 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# create version of record power variables that combine the initial versions of Tilburg variables with the design versions
library(tidyverse)
library(targets)
tar_make()
tar_load(repli_outcomes)
# for each power threshold, create a 'combined' version of the power variable
# draws on the corresponding value from the design set when it's available
# draws on the value from the initial set of power variables when the design version is unavailable
combined_power_variables <- repli_outcomes %>%
mutate(
combined_power_50 = ifelse(!is.na(rr_power_50_original_effect_design), rr_power_50_original_effect_design, repli_power_for_50_effect),
combined_power_75 = ifelse(!is.na(rr_power_75_original_effect_design), rr_power_75_original_effect_design, repli_power_for_75_effect),
combined_power_100 = ifelse(!is.na(rr_power_100_original_effect_design), rr_power_100_original_effect_design, rr_power_100_original_effect),
) %>%
select(report_id, contains("combined_"))