powerplot | R Documentation |

Uses the function `RRsimu`

to estimate the power of the multivariate RR methods (correlation `RRcor`

, logistic regression `RRlog`

, and/or linear regression `RRlin`

.

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 )

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

`show.messages` |
toggle printing of progress messages |

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

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

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.