acoppock / ri2

Randomization Inference for Randomized Experiments
Other
12 stars 4 forks source link

patch issue with condition names in conduct_conditional_ra() #29

Open gerasy1987 opened 2 years ago

gerasy1987 commented 2 years ago

When using multi-arm design conduct_conditional_ra() function is being called. In this function when permuted treatment vector for two conditions (which is a factor produced by *_ra()) is plugged into existing assignment vector (which is character vector) factor converts into numeric values first and then into character, e.g. in this chunk of code

assignment_vec_new[assignment_vec %in% conditions] <-
        simple_ra(
          N = sum(assignment_vec %in% conditions),
          prob_each = prob_each_local,
          conditions = conditions,
          check_inputs = FALSE
        )

One easy solution that is tested to work is to wrap *_ra() call into as.character() which is done in this pull request