# powerplot: Power plots for multivariate RR methods In danheck/RRreg: Correlation and Regression Analyses for Randomized Response Data

 powerplot R Documentation

## Power plots for multivariate RR methods

### Description

Uses the function `RRsimu` to estimate the power of the multivariate RR methods (correlation `RRcor`, logistic regression `RRlog`, and/or linear regression `RRlin`.

### Usage

```powerplot(
numRep,
n = c(100, 500, 1000),
pi,
cor = c(0, 0.1, 0.3),
b.log = NULL,
model,
p,
method = c("RRcor", "RRlog", "RRlin"),
complyRates = c(1, 1),
sysBias = c(0, 0),
groupRatio = 0.5,
alpha = 0.05,
nCPU = 1,
show.messages = TRUE
)
```

### Arguments

 `numRep` number of boostrap replications `n` vector of samples sizes `pi` true prevalence `cor` vector of true correlations `b.log` vector of true logistic regression coefficients `model` randomized response model `p` randomization probability `method` multivariate RR method `complyRates` probability of compliance within carriers/noncarriers of sensitive attribute `sysBias` probability of responding 'yes' in case of noncompliance `groupRatio` ratio of subgroups in two-group RR designs `alpha` type-I error used to estimate power `nCPU` either the number of CPU cores or a cluster initialized via `makeCluster`. `show.messages` toggle printing of progress messages

### Value

a list of the class `powerplot` containing an array `res` with the power estimates and details of the simulation (e.g., model, p, pi, etc.)

`RRsimu` for Monte-Carlo simulation / parametric bootstrap

### Examples

```# Not run
# pplot <- powerplot(100, n=c(150,250), cor=c(0,.3,.5),
#                   method="RRlog", pi=.6, model="Warner", p=.3)
# plot(pplot)

```

danheck/RRreg documentation built on Dec. 3, 2022, 7:50 p.m.