Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update a chunk in the RI2 guide #48

Open
jwbowers opened this issue Mar 10, 2022 · 1 comment
Open

Update a chunk in the RI2 guide #48

jwbowers opened this issue Mar 10, 2022 · 1 comment
Assignees

Comments

@jwbowers
Copy link
Collaborator

@acoppock We've been recompiling guides and ran into a problem here. We had to remove the plot to get it to run through --- and the summary shows NAs. We'd like to have the nice plot again. Any ideas about what we should do? (I changed condition_names to conditions to update the call to declare_ra FYI.) The chunk starts on line 196 and is in the section headed # 7. Randomization inference for multi-arm trials

three_arm_dat <- read.csv("three_arm_dat.csv")
three_arm_dec <- declare_ra(N = 200, 
                            conditions = c("Control", "Treatment 1", "Treatment 2"))

ri_out <-
    conduct_ri(
      formula = Y ~ Z,
      declaration = three_arm_dec,
      data = three_arm_dat,
      sims = sims
    )


summary(ri_out)
## plot(ri_out)
@jwbowers jwbowers changed the title Update a Update a chunk in the RI2 guide Mar 10, 2022
@jwbowers
Copy link
Collaborator Author

More info from brilliant Georgiy Syunyaev


"the place where this happens is in the function ri2:::conduct_conditional_ra()

specifically in 

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

and similar chunks of code (there are a bunch of them) 

at that point basically all "Treatment 1"/"Treatment 2" get by accident converted into "1"/“2""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants