Learn R Programming

NPC (version 1.1.0)

DiffSumWithNA: Sum Test Statistic for MCAR Data

Description

This function calculates a test statistic analogous to the difference of means, but adjusted to accommodate missing responses. The result is intended to be used as a test statistic in a permutation test. Under the assumption that the data are missing completely at random, the resulting permutation test is "nearly" exact under the null of distributional equality of the observed responses (Pesarin and Salmaso 2010, 234--44).

Usage

DiffSumWithNA(y, tr, tl, ...)

Arguments

y
Response variable (vector)
tr
Treatment variable (vector)
tl
The level of treatment variable (e.g., "treated" or 1) that indicates treated observations
...
Additional arguments (included for compatibility but ignored)

Value

A scalar test statistic

References

Pesarin, Fortunato, and Luigi Salmaso. 2010. Permutation Tests for Complex Data. Chichester, UK: Wiley.