f4_logor_stat: Compute Statistics for Log Odds Ratio of Posterior...

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

The function computes statistics for log odds ratio of posterior probability.

Usage

1
2
  logor.stat(x, fcobj, post.z, cov.param = NULL, cov.post.z = NULL,
                 cov.logit.z = NULL, all.x = FALSE, drop.ETA1 = FALSE)

Arguments

x

an input list of two elements X.gbd and PV.gbd.

fcobj

a fclust object.

post.z

a matrix of dim = N * K for posterior probabilities, which is also the return value of post.prob().

cov.param

a covariance matrix of dim = d * d for parameters, which is also a return of cov.param(). d is total number of parameters which is dependent on data and models.

cov.post.z

a covariance list of length equal to number of active voxels, which is also a return of cov.post.z().

cov.logit.z

a covariance list of length equal to number of active voxels, which is also a return of cov.logit.z().

all.x

all cov matrices for all observations are returned if TRUE, while for only active observations (those of class ids are greater than 1) if FALSE.

drop.ETA1

if drop the ETA[1] from the cov matrix due to the min.1st.prop constrain.

Details

For posterior probability, this function compute log odd ratio, cov matrix of log odd ratio, degrees of freedom, and testing statistics.

Value

A list is returned with four elements: log.or, cov.log.or, df, and test.stat.

Author(s)

Wei-Chen Chen and Ranjan Maitra.

References

http://maitra.public.iastate.edu/

See Also

post.prob(), cov.param(), cov.post.z(), cov.logit.z().

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
library(MixfMRI, quietly = TRUE)
.FC.CT$model.X <- "I"
.FC.CT$CONTROL$debug <- 0
K <- 3

### Fit toy1.
set.seed(1234)
X.gbd <- toy1$X.gbd
X.range <- apply(X.gbd, 2, range)
X.gbd <- t((t(X.gbd) - X.range[1,]) / (X.range[2,] - X.range[1,]))
PV.gbd <- toy1$PV.gbd
fcobj <- fclust(X.gbd, PV.gbd, K = K, min.1st.prop = 0.5)

### Test log odds ratio.
x <- list(X.gbd = X.gbd, PV.gbd = PV.gbd)
post.z <- post.prob(x, fcobj)
lor <- logor.stat(x, fcobj, post.z)

### Check if 95% CE covers log odd ratio = 1.
id <- !is.na(lor$df)
id.cover.0 <- which(lor$test.stat[id] < pchisq(0.95, lor$df[id]))

### Get voxels needed for merging.
id.active <- which(fcobj$class != 1)
id.merge <- id.active[id][id.cover.0]

### Check results.
post.z[id.merge,]
cbind(toy1$X.gbd[id.merge,], toy1$PV.gbd[id.merge])

MixfMRI documentation built on April 26, 2018, 5:03 p.m.