Skip to content

Bug of gs_design_wlr when the input enroll_rate's rate sum is not 1 #344

@LittleBeannie

Description

@LittleBeannie

Overview of the bug:

The following codes gives the error message "Error: accr_param must sum to 1."

gs_power_wlr(enroll_rate = define_enroll_rate(duration = c(1, 1, 6), rate = c(2, 10.8, 30.2)))

Although the input sample size sum(c(1, 1, 6) * c(2, 10.8, 30.2)) = 194 is an integer, it still reports an error on the accrual parameters.

Debug finding:

By debuging, it looks the problem lies in npsurvSS::create_arm(). It has a strict check of the accrual parameters, i.e., sum(accr_param) == 1. Where accr_param = enroll_rate$rate * enroll_rate$duration / sum(enroll_rate$rate * enroll_rate$duration). It is possible that sum(accr_param) might be some number very CLOSE to 1, but not exactly 1, say, 1.0000001. If it happens, it will give an error message.
image

Proposed solution:

Option 1: send a PR to npsurvSS and ask Godwin to do a new CRAN release (stable but may take long time to wait for the CRAN release)

Option 2: Build an internal gsDesign2:::creat_arm() function and lose the check of sum(accr_para) == 1 to gsDesign2:::is_wholenumber() (not stable but fast)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions