do_rank: For each witness, rank other witnesses by distance

View source: R/do_rank.R

do_rankR Documentation

For each witness, rank other witnesses by distance

Description

This uses do_reduction() to reduce missing data then do_dist() to obtain the corresponding distance matrix. (It doesn't matter if the input data frame is already reduced.)

Usage

do_rank(
  fr,
  n = 15,
  keep = "",
  alpha = 0.05,
  write = FALSE,
  fn = "output/rank/output.txt"
)

Arguments

fr

a data frame.

n

minimum acceptable number of pairwise defined columns in the reduced data frame. Values can range from 1 to the number of columns. (Default = 15.)

keep

a row to be kept from elimination provided that it has enough defined (i.e. non-NA) elements to satisfy the minimum acceptable number condition.

alpha

alpha value (i.e. probability of a type I error) (default = 0.05).

write

logical flag: (default = FALSE) if TRUE then ranked distances will be written to file fn.

fn

a connection or character string naming the file to write to.

Details

Function stats::qbinom() is used to estimate lower and upper critical distances (LCD, UCD). Distances that are less than the LCD or greater than the UCD are marked with an asterisk. (Such distances are not expected to happen by chance.)

The output format facilitates use in Markdown documents. (E.g., asterices are escaped with "\".)

Value

A matrix giving ranked distances for each witness.


tjfinney/ANTTV documentation built on July 1, 2024, 11 p.m.