multifabCI: Multigroup FAB t-intervals

Description Usage Arguments Details Author(s) Examples

View source: R/multifabCI.R

Description

Computation of 1-alpha FAB t-intervals for heteroscedastic multigroup data.

Usage

1
multifabCI(y, g, alpha = 0.05)

Arguments

y

a numeric vector of data

g

a group membership vector, of the same length as y

alpha

the type I error rate, so 1-alpha is the coverage rate

Details

For each group j, this function computes an estimate of the parameters in a hierarchical model for means and variances from data other than group j, and uses this information to construct a FAB t-interval for group j. These intervals have 1-alpha frequentist coverage, assuming within-group normality.

Author(s)

Peter Hoff

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## -- simulated data
p<-10 ; n<-10
y<-rnorm(n*p) ; g<-rep(1:p,n) 

## -- more interesting data takes longer 
# data(radon) ; y<-radon[,2] ; g<-radon[,1] 

## -- FAB t-intervals
FCI<-multifabCI(y,g) 

## -- UMAU t-intervals 
ybar<-tapply(y,g,mean) ; ssd<-tapply(y,g,sd) ; n<-table(g) 
qtn<-cbind( qt(.025,n-1),  qt(.975,n-1) ) 
UCI<-sweep(sweep(qtn,1,ssd/sqrt(n),"*"),1,ybar,"+") 

mean( (UCI[,2]-UCI[,1])/(FCI[,2]-FCI[,1]) , na.rm=TRUE)

pdhoff/fabCI documentation built on Jan. 18, 2021, 8:39 p.m.