Skip to content

Commit

Permalink
Merge pull request #181 from SiWen314/LOA.ANOVA
Browse files Browse the repository at this point in the history
LOA - Update sim,NormalIG.Hierarchical.R for within modality situation
  • Loading branch information
brandon-gallas authored Aug 16, 2024
2 parents 8a30981 + 38fe56c commit 3013a13
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions Rpackage/iMRMC/R/sim.NormalIG.Hierarchical.R
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,26 @@ sim.NormalIG.Hierarchical = function(config,R = NULL,AR = NULL,BR = NULL,is.with
if(C_dist == 'normal'){

C = matrix(rep(rnorm(nC,0,config$sigma_C),nR),nR,nC,byrow =TRUE)
## Mod A/ first replicate
tauC.A = matrix(rep(rnorm(nC,0,config$sigma_C.A),nR),nR,nC,byrow =TRUE)
tauC.B = matrix(rep(rnorm(nC,0,config$sigma_C.B),nR),nR,nC,byrow =TRUE)

## Mod B/ second replicate
if(is.within){
tauC.B = tauC.A
}else{
tauC.B = matrix(rep(rnorm(nC,0,config$sigma_C.B),nR),nR,nC,byrow =TRUE)
}

}else if(C_dist == 'beta'){

C = matrix(rep(rbeta(nC,config$a_C,config$b_C),nR),nR,nC,byrow =TRUE)
## Mod A/ first replicate
tauC.A = matrix(rep(rbeta(nC,config$a_C.A,config$b_C.A),nR),nR,nC,byrow =TRUE)
tauC.B = matrix(rep(rbeta(nC,config$a_C.B,config$b_C.B),nR),nR,nC,byrow =TRUE)

## Mod B/ second replicate
if(is.within){
tauC.B = tauC.A
}else{
tauC.B = matrix(rep(rbeta(nC,config$a_C.B,config$b_C.B),nR),nR,nC,byrow =TRUE)
}
}

# RC
Expand Down

0 comments on commit 3013a13

Please sign in to comment.