Learn R Programming

singcar (version 0.1.5)

MTD: Multivariate Test of deficit

Description

Testing for abnormality in the distance between a a vector of observations for a single case and a vector of population means. Please see vignette for further details.

Usage

MTD(
  case,
  controls,
  conf_level = 0.95,
  method = c("pd", "pchi", "pf", "pmd"),
  mahalanobis_dist = NULL,
  k = NULL,
  n = NULL
)

Value

A list with class "htest" containing the following components:

statisticHotelling's T^2 statistic for the case's Mahalanobi's distancep.value
The p value associated with the Hotelling statisticestimateEstimates of the case Mahalanobis distance and index as well as abnormality
intervalList of interval measure for the estimates
sample.sizenumber of controls.method

Arguments

case

Vector of case scores

controls

Matrix or data frame with scores from the control sample, each column representing a variable

conf_level

Level of confidence for the confidence intervals

method

One out of "pd", "pchi", "pf" and "pmd". Use "pmd" if the Mahalanobi's distance seems suspiciously small

mahalanobis_dist

Mahalanobi's distance of the case if summary statistics are used

k

The number of dimensions, if summary statistics are used

n

The size of the control sample

Examples

Run this code

caseA <- size_weight_illusion[1, "V_SWI"]
contA <- size_weight_illusion[-1, "V_SWI"]
caseB <- size_weight_illusion[1, "K_SWI"]
contB <- size_weight_illusion[-1, "K_SWI"]

MTD(case = c(caseA, caseB), controls = cbind(contA, contB),
  conf_level = 0.95, method = c("pd", "pchi", "pf", "pmd"),
  mahalanobis_dist = NULL, k = NULL, n = NULL)


Run the code above in your browser using DataLab