sim_b1 {DBpower} | R Documentation |

## sim_R1.R

### Description

Simulate the probability of falling in the region used for the b1 lower bound or the b1 upper bound.

### Usage

```
sim_b1(lower = TRUE, upper = TRUE, n, muVec, sigMat, bounds)
```

### Arguments

`lower` |
Boolean, if true sim lower bound. |

`upper` |
Boolean, if true sim upper bound. |

`n` |
Number of simulations. |

`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:

`lowerBound` |
Lower bound on power. |

`upperBound` |
Upper bound on power. |

### 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)])
sim_b1(n=5000, muVec = c(1, 0, 0, 0, 0), sigMat = myCov, bounds=myBounds)
```

[Package

*DBpower*version 0.1.0 Index]