ComLikMulCom: Multiple Comparisons using Composite Likelihood

Description Usage Arguments Details Value Author(s) References Examples

View source: R/ComLikMulCom.R

Description

Multiple hypothesis testing H_0 :Cβ = 0, based on composite likelihood inference for clustered data, with common covariance structure across the clusters. The critical value is based on multivariate normal quantile, using the R-package multcomp by Hothorn, et.al.

Usage

1
ComLikMulCom(data, yno, idno, y.type = c("normal", "probit", "quadratic exponential")[1], type = c("many_one", "all_pair")[1], f = 1)

Arguments

data

data set in long format containing response, covariates and one variable that identifies the cluster

yno

the response column number

idno

column number of the variable that identify the clusters

y.type

the model of the response variable, it could be normal, probit, or quadratic exponential

type

type of the test, it could be many-to-one or all-pair comparisons

f

the baseline variable for many to one type

Details

The current functions handle the clustered normal and probit data with equal size. For quadratic exponential data, clusters can have different sizes.

Value

m

number of individuals in each cluster, if equal

n

number of clusters

p

number of covariates

Cov_beta

covariance matrix of the covariates

T_stat

the test statistic

normal_quantile

the simultaneous normal quantile

MNQ

results of individual null hypotheses based on composite likelihood

Bon

results of individual null hypotheses based on Bonferroni approach

Sidak

results of individual null hypotheses based on Dunn-Sidak approach

Scheffe

results of individual null hypotheses based on Scheffe method

Author(s)

Mahdis Azadbakhsh, Xin Gao, Hanna Jankowski.

References

Azadbakhsh,M., Gao,X., Jankowski,H. (2016) Multiple Comparisons Using Composite Likelihood in Clustered Data. Submitted.

Hothorn, T., Bretz, F., Westfall, P., Heiberger, R. M., Schutzenmeister, A.(2010) multcomp: Simultaneous Inference for General Linear Hypotheses, R package version 1.1-7, http://CRAN.R-project.org/package=multcomp

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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
### artificial data set (normal)
m <- 3
n <- 20
p <- 5

v <- sample(seq(-4,4,0.05),360,replace= TRUE)
cx <- matrix(v, nrow=(n*m))

ind <- rep(0,n*m)
for(i in 1: n) {ind[(m*(i-1)+1):(m*i)]<-   i}

cxx <- cbind(cx,ind)
colnames(cxx) <- c("res", "c1","c2","c3","c4", "c5", "ind")

idno <- which( colnames(cxx)=="ind" )
yno <- which( colnames(cxx)=="res" )

ComLikMulCom(cxx, yno , idno , y.type ="normal" ,  type = "many_one", f=3)
ComLikMulCom(cxx, yno , idno , y.type ="normal" ,  type = "all_pair")



### probit


v <- sample(seq(-4,4,0.05),300,replace= TRUE)
y <- sample(c(0,1),60,replace= TRUE)
cx <- matrix(v, nrow=60)

colnames(cx) <- c("c1","c2","c3","c4", "c5")


id <- rep(0,n*m)
for(i in 1: n) {id[(m*(i-1)+1):(m*i)]<-   i}


cxx <- as.data.frame(cbind(y,cx,id))
idno <- which( colnames(cxx)=="id" )
yno <- which( colnames(cxx)=="y" )


ComLikMulCom(cxx, yno , idno , y.type ="probit" ,  type = "all_pair")



### Normal
m <- 3
n <- 40
p <- 5
require(MASS)
library(MASS)
library(mvtnorm)
beta <-   c(0,2,0,0,1)
sigma  <- matrix(c(0.8, 0.4, 0.4, 0.4, 0.8, 0.4, 0.4, 0.4, 0.8), nrow=3)

desx      <-    array(dim=c(m,p,n))
y         <-    matrix(0,nrow=m,ncol=n)
mu        <-    matrix(0,nrow=m,ncol=n)

for (k in 1:n){
  for(j in 1:p){
    desx[,j,k] <-   rnorm(m,1,3.5)
  }
  mu[,k]      <-   tcrossprod(desx[,,k], t(beta))
  y[,k]        <-   mvrnorm(1,mu[,k], sigma, tol = 1e-6, empirical = FALSE)
}
sss    <-    array(dim=c(m,(p+1),n))


for(i in 1:n){
  ind <- rep(i,m)
  sss[,,i]  <- cbind(ind,desx[,,i])
}

yyy         <-   rep(0,120)

for( i in 1:40){
  yyy[((i-1)*3+1):(i*3)]   <-   y[,i]
}

xxx       <-   matrix(0,nrow=120, ncol=6)

for( i in 1:40){
  xxx[((i-1)*3+1):(i*3),] 	<- 	sss[,,i]
}
dat <- cbind(yyy,xxx)
colnames(dat) <- c("response","id", "c1","c2","c3","c4", "c5")

idno <- which( colnames(dat)=="id" )
yno <- which( colnames(dat)=="response" )
ComLikMulCom(dat, yno , idno , y.type ="normal" ,  type = "many_one", f=3)
ComLikMulCom(dat, yno , idno , y.type ="normal" ,  type = "all_pair")

m-azad/CLMC documentation built on May 21, 2019, 9:17 a.m.