Learn R Programming

countfitteR (version 1.4)

sim_dat: Data created from simulation of NB Poiss

Description

Data created from simulation of NB Poiss

Usage

sim_dat

Arguments

Examples

Run this code
# NOT RUN {
# code used to generate the data
# be warned: the simulations will take some time
# }
# NOT RUN {
library(dplyr)
set.seed(15390)
sim_dat <- do.call(rbind, lapply(10^(-3L:2), function(single_theta)
  do.call(rbind, lapply(1L:10/2, function(single_lambda) 
    do.call(rbind, lapply(1L:100, function(single_rep) {
      
      foci <- lapply(1L:10, function(dummy) rnbinom(600, size = single_theta, mu = single_lambda))
      names(foci) <- paste0("C", 1L:10)
      
      fit_counts(foci, separate = TRUE, model = "all") %>%
        summary_fitlist %>% 
        mutate(between = single_lambda < upper & single_lambda > lower) %>%
        group_by(model) %>% 
        summarize(prop = mean(between)) %>%
        mutate(replicate = single_rep, lambda = single_lambda, theta = single_theta)
    }))
  ))
))
# }

Run the code above in your browser using DataLab