Search
 
SCRIPT & CODE EXAMPLE
 

R

r get all pairwise combinations

x = c(1,2,3,4,5)    
apply(combn(x,2),2,paste,collapse='_')
Comment

pairwise combinations r

compare <- function(...){

  m <- list(...)
  n_mod <- length(m)
  names(m) <- sapply(substitute(list(...))[-1], deparse)
  combs <- t(combn(x = names(m), m = 2))

  comp_value <- apply(X = combs, MARGIN = 1, function(ind) pchisq(2 * (logLik(m[[ind[2]]]) - logLik(m[[ind[1]]])), df = abs(m[[ind[1]]]$df.residual - m[[ind[2]]]$df.residual), lower.tail = FALSE))
  df_out <- data.frame(combs, comp_value)
  names(df_out) <- c("mod_1", "mod_2", "comp_value")

  return(df_out)
}
Comment

PREVIOUS NEXT
Code Example
R :: rmarkdown how to load workspace 
R :: Levels in factor in r 
R :: switch variable position in r dplyr 
R :: r create intervals cut 
R :: print string without quotes and escape sequence r 
R :: %in% in r 
R :: excel date format r 
R :: fcrit in r 
R :: generate random values binomial law in r 
R :: XLConnect 
R :: get string without ending in R 
R :: conditional mean statement r 
Rust :: append to file rust 
Rust :: create thread in rust 
Rust :: rust loop n times 
Rust :: string to bytes rust 
Rust :: rust square root 
Rust :: optional arguments rust 
Rust :: run or compile rust code 
Rust :: input output rust 
Rust :: Find the next smaller positive integer containing the same digits 
Rust :: rust comments 
Rust :: armanriazi•rust•unsafe•trait 
Rust :: armanriazi•rust•nestedtypes 
Rust :: armanriazi•rust•lifetime•drop 
Lua :: if string contains lua 
Lua :: roblox __index and __newindex 
Lua :: color3 not working lua 
Lua :: lua what is _ENV 
Lua :: What is transparency in roblox 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =