X1: X1

Description Usage Arguments Value Author(s) Examples

View source: R/single_snps.R

Description

Compute test statistic X1, posterior probability of Za and Zd in full model.

Usage

1
X1(Z, pars1)

Arguments

Z

n x 2 matrix of Z scores; Z[,1]=Z_d, Z[,2]=Z_a

pars1

parameters of full model; in order, pi0, pi1, tau, sigma_1, sigma_2, rho

Value

vector of values of X1

Author(s)

James Liley

Examples

1
2
3
4
5
nn=100000
Z=abs(rbind(rmnorm(0.8*nn,varcov=diag(2)), rmnorm(0.15*nn,varcov=rbind(c(1,0),c(0,2^2))), rmnorm(0.05*nn,varcov=rbind(c(3^2,2),c(2,4^2)))));
pars=c(0.8,0.15,3,2,4,2)
X1=X1(Z,pars)
plotZ(Z,rlim=2); points(Z[which(X1>0.7),],col="red",pch=16)

jamesliley/subtest documentation built on May 18, 2019, 11:21 a.m.