R/iutsize.R

iutsize <- function(p, n, alpha=0.1, sim=1e6){
  
  i <- count <- 0
  
  q <- qf(1 - alpha, df1=p, df2=n - p) / ((n - p) / (p * (n - 1)))
  
  while(i < sim){
    
    if(rf(1, df1=1, df2=n - 1) > q){
      count <- count + 1
    }
    
    i <- i + 1
    
  }
  
  sum(count) / (2 * sim)
  
}

Try the jocre package in your browser

Any scripts or data that you put into this service are public.

jocre documentation built on May 2, 2019, 3:31 p.m.