Skip to content

Conversation

@clarabicalho
Copy link
Contributor

Return warning for which value takes precedence when user inputs both sd and outcome_sds and they do not match.

Warning for which value takes precedence when user inputs both `sd` and `outcome_sds` and they do not match.
if(max(c(sd_i, outcome_sds) < 0) ) stop("sd_i and outcome_sds must be nonnegative")
if(max(c(prob_A, prob_B) < 0)) stop("prob_ arguments must be nonnegative")
if(max(c(prob_A, prob_B) > 1)) stop("prob_ arguments must not exceed 1")
if(!is.null(outcome_means) && all(!is.null(c(mean_A0B0, mean_A0B1, mean_A1B0, mean_A1B1))) &&
Copy link
Contributor

@nfultz nfultz Aug 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this check will work as intended, it is not user friendly to require people to set outcome_means=NULL when they want to provide all 4 means.

Also is.null is not vectorized, would double check the second half as well.

> is.null(c(2, NULL))
[1] FALSE

Adding some tests that set the mean_AB params should help shake out these issues.

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

Successfully merging this pull request may close these issues.

3 participants