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

Independent test of outdata.R #13

Closed
LittleBeannie opened this issue Jun 10, 2022 · 2 comments · Fixed by #46
Closed

Independent test of outdata.R #13

LittleBeannie opened this issue Jun 10, 2022 · 2 comments · Fixed by #46
Assignees

Comments

@LittleBeannie
Copy link
Collaborator

Test plan of outdata():

meta <- meta_dummy()
 outdata(meta_dummy(), "apat", "wk12", "rel", n = meta()$data_population %>% group_by(TRTA) %>% summarize(n = n()), group = "TRTA", reference_group = 1, order = 1:3)
  • Its class is "outdata"
  • Its output is a list of length 8, including meta, population, observation, parameter, n, order, group, and reference_group.
@LittleBeannie
Copy link
Collaborator Author

Test plan of new_outdata():

  • It outputs an error when metalite:::new_outdata(1)
  • The output of the following code is an "outdata
meta <- meta_dummy()
x <- list(meta = meta_dummy(), population = "apat", observation = "wk12", parameter = "rel", n = meta$data_population %>% group_by(TRTA) %>% summarize(n = n()), group = "TRTA", reference_group = 1, order = 1:3)
new_outdata(x)

@LittleBeannie
Copy link
Collaborator Author

LittleBeannie commented Jun 10, 2022

Test plan of validate_outdata()

  • It outputs an error
Error in `FUN()`:
! variable 'reference_group' must be a numeric value

when run

meta <- meta_dummy()
validate_outdata(outdata(meta = meta_dummy(), population = "apat", observation = "wk12", parameter = "rel", n = meta$data_population %>% group_by(TRTA) %>% summarize(n = n()), group = "TRTA", reference_group = "Placebo", order = 1:3))
  • It outputs an error
Error in `FUN()`:
! variable 'order' must be a numeric value

when run

meta <- meta_dummy()
validate_outdata(outdata(meta = meta_dummy(), population = "apat", observation = "wk12", parameter = "rel", n = meta$data_population %>% group_by(TRTA) %>% summarize(n = n()), group = "TRTA", reference_group = 1, order = c("Placebo", "Xanomeline Low Dose", "Xanomeline High Dose")))
  • It outputs an error
Error in `FUN()`:
! variable 'population' must be a character value

when run

meta <- meta_dummy()
validate_outdata(outdata(meta = meta_dummy(), population = 1, observation = "wk12", parameter = "rel", n = meta$data_population %>% group_by(TRTA) %>% summarize(n = n()), group = "TRTA", reference_group = 1, order = 1:3))
  • It outputs an error
Error in `FUN()`:
! variable 'reference_group' must be length 1

when run

meta <- meta_dummy()
validate_outdata(outdata(meta = meta_dummy(), population = "apat", observation = "wk12", parameter = "rel", n = meta$data_population %>% group_by(TRTA) %>% summarize(n = n()), group = "TRTA", reference_group = 1:2, order = 1:3))
  • It outputs an error
Error in `FUN()`:
! variable 'population' must be length 1

when run

meta <- meta_dummy()
validate_outdata(outdata(meta = meta_dummy(), population = c("apat", "ITT"), observation = "wk12", parameter = "rel", n = meta$data_population %>% group_by(TRTA) %>% summarize(n = n()), group = "TRTA", reference_group = 1, order = 1:3))

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

Successfully merging a pull request may close this issue.

2 participants