simulateControls | R Documentation |
Simulate (negative) controls
simulateControls(
n = 50,
mean = 0,
sd = 0.1,
seLogRr = runif(n, min = 0.01, max = 0.2),
trueLogRr = 0
)
n |
Number of controls to simulate. |
mean |
The mean of the error distribution (on the log RR scale). |
sd |
The standard deviation of the error distribution (on the log RR scale). |
seLogRr |
The standard error of the log of the relative risk. This is recycled for the controls. The default is to sample these from a uniform distribution. |
trueLogRr |
The true relative risk (on the log scale) used to generate these controls. This is recycled for the controls. |
Generate point estimates given known true effect sizes and standard errors
data <- simulateControls(n = 50 * 3, mean = 0.25, sd = 0.25, trueLogRr = log(c(1, 2, 4)))
plotTrueAndObserved(data$logRr, data$seLogRr, data$trueLogRr)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.