edibble icon indicating copy to clipboard operation
edibble copied to clipboard

fill_vars

Open emitanaka opened this issue 3 years ago • 3 comments

Fill values for record vars using expected range of values (by default assumes uniform or normal or allow distribution?)

emitanaka avatar Jan 15 '21 09:01 emitanaka

maybe call it fill_rcrds or simulate_rcrds

emitanaka avatar Mar 26 '21 05:03 emitanaka

start_design() %>% 
  set_trts(treat = c("A", "B", "C")) %>% 
  set_units(unit = 12) %>% 
  allocate_trts(treat ~ unit) %>% 
  randomise_trts() %> %
  set_rcrds(response = unit) %>% 
  expect_rcrds(response = to_be_numeric(with_value(between = c(0, 100))) %>% 
  simulate_rcrds(response = sim_norm(mean = ~30 + treat, sd = 3, 
                                     effects = list(treat = c("A" = 3, "B" = 2, "C" = 0)))

emitanaka avatar Apr 02 '21 23:04 emitanaka

fill_rcrds = literally just fill records based on expect_rcrds (with some simple choice of distribution). if not specified then just sample from standard normal. The idea is to just have some numbers or factor levels filled quickly so you can run analysis as demonstration. simulate_rcrd is for more complex case.

emitanaka avatar Apr 06 '21 03:04 emitanaka