unsup_get_pval_shrinkage: Evaluate p-value of u using James-Stein shrinkage

View source: R/unsup_get_pval_shrinkage.R

unsup_get_pval_shrinkageR Documentation

Evaluate p-value of u using James-Stein shrinkage

Description

Create augmented sample containing subject 1's observations and u. Compute James-Stein shrinkage estimate of subject 1 mean using augmented subject 1 sample and data from all other subjects. As nonconformity scores, compute the absolute difference between each observation in the augmented subject 1 sample and the James-Stein shrinkage estimate. The p-value is the proportion of observations in the augmented sample with nonconformity score >= u's nonconformity score.

Usage

unsup_get_pval_shrinkage(u, Y)

Arguments

u

Hypothetical new observation on subject 1

Y

List containing data of all subjects. Each item in the list is a vector with one subject's observations.

Value

p-value of u relative to subject 1's sample, using the James-Stein shrinkage estimate


RobinMDunn/ConformalTwoLayer documentation built on March 22, 2022, 6:38 p.m.