powerplot: Power plots for multivariate RR methods

Description Usage Arguments Value See Also Examples

View source: R/powerplot.R

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
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.)

See Also

RRsimu for Monte-Carlo simulation / parametric bootstrap

Examples

1
2
3
4
# 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 Sept. 5, 2021, 7:36 p.m.