R/associations.folder.R

Defines functions phi.folder pearson.folder tschuprow.folder cramer.folder

Documented in cramer.folder pearson.folder phi.folder tschuprow.folder

cramer.folder <- function(xf) {
  # convert xf to a data frame
  x = as.data.frame(xf, stringsAsFactors = TRUE)
  
  group = x[, "group"] # Factor: the groups
  x = x[, -ncol(x)] # Data frame of the variables
  
  # Apply cramer.data.frame to the data of each group
  return(by(x, INDICES=group, FUN=cramer.data.frame, check = FALSE))
}

tschuprow.folder <- function(xf) {
  # convert xf to a data frame
  x = as.data.frame(xf, stringsAsFactors = TRUE)
  
  group = x[, "group"] # Factor: the groups
  x = x[, -ncol(x)] # Data frame of the variables
  
  # Apply tschuprow.data.frame to the data of each group
  return(by(x, INDICES=group, FUN=cramer.data.frame, check = FALSE))
}

pearson.folder <- function(xf) {
  # convert xf to a data frame
  x = as.data.frame(xf, stringsAsFactors = TRUE)
  
  group = x[, "group"] # Factor: the groups
  x = x[, -ncol(x)] # Data frame of the variables
  
  # Apply tschuprow.data.frame to the data of each group
  return(by(x, INDICES=group, FUN=pearson.data.frame, check = FALSE))
}

phi.folder <- function(xf) {
  # convert xf to a data frame
  x = as.data.frame(xf, stringsAsFactors = TRUE)
  
  group = x[, "group"] # Factor: the groups
  x = x[, -ncol(x)] # Data frame of the variables
  
  # Apply tschuprow.data.frame to the data of each group
  return(by(x, INDICES=group, FUN=pearson.data.frame, check = FALSE))
}

Try the dad package in your browser

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

dad documentation built on Aug. 30, 2023, 5:06 p.m.