calcb1 {DBpower} | R Documentation |

## calc_b1.R

### Description

Calculate lower bound or upper bound on power when considering only the largest test statistic in magnitude, i.e. only |Z|_(J) and not |Z|_(J-1).

### Usage

```
calcb1(lower = TRUE, upper = FALSE, muVec, sigMat, bounds)
```

### Arguments

`lower` |
Boolean, whether to calculate lower bound. |

`upper` |
Boolean, whether to calculate upper bound. |

`muVec` |
Mean vector of test statistics under the alternative (assuming it's MVN). |

`sigMat` |
Covariance matrix of test statistics under the alternative (assuming it's MVN). |

`bounds` |
A J*1 vector of bounds on the magnitudes of the test statistics, where the first element is the bound for |Z|_(1) and the last element is the bound for |Z|_(J). |

### Value

A list with the elements:

`allProbsLower` |
J*1 vector of all components summed to calculate lower bound. |

`lowerProb` |
Lower bound. |

`allProbsUpper` |
J*1 vector of all components summed to calculate upper bound. |

`upperProb` |
Upper bound. |

### Examples

```
myCov <- matrix(data=0.3, nrow=5, ncol=5)
diag(myCov) <- 1
myBounds <- set_GBJ_bounds(alpha = 0.01, J=5, sig_vec = myCov[lower.tri(myCov)])
calcb1(muVec = c(1, 0, 0, 0, 0), sigMat = myCov, bounds=myBounds)
```

[Package

*DBpower*version 0.1.0 Index]