Description Usage Arguments Details Value Author(s) References See Also Examples
Generates predicted intervals of some effect estimate given observed data and a hypothesis about the distribution of future data.
1 2 3 |
y |
a numeric vector of outcomes (with at least 2 elements and no missing values) |
group |
an optional vector of groups. If it exists, it must be the same length as
|
N |
A required vector with length equal to the number of distinct groups.
The ith element is what we want the number of observations to be for the ith
group after simulation. (So if |
true.y |
Either "observed","no.diff", or a vector of constants. Define mean/proportion used when simulating the data. |
ref |
An optional group name that will serve as the reference group. Default is the first alphabetically. |
data.type |
A required field indicating the type of data/statistical test that should be performed to get the effect estimate. Either "t.test" or "binary" |
var.equal |
TRUE/FALSE whether to assume variance equal in t-test. Default is FALSE. This does not affect the variance used when simulating data. Data is always simulated with the variance for the group, not the pooled variance |
conf.level |
Confidence level for intervals (between 0 and 1). Default is 0.95. This is the confidence level
used for the predicted intervals and will also define the confidence level used for the observed
interval unless |
obs.conf.level |
Confidence level for the observed intervals (between 0 and 1). Default is the same level specified
for the predicted intervals in the |
iters |
Number of predicted intervals to generate. Default is 100 |
The pred.int
function takes a vector of observations (y
) as well as (optionally)
the group of each observation (group
), and the total number of observations expected
in each group (N
) when all data is observed. The function then calculates the
amount of data that needs to be simulated in each group, and simulates the outcome, which
is either binary or normal depending on the value of data.type
.
When simulating data, the parameter true.y
determines the mean/proportion of the population
from which the simulated data will be drawn. This is either the observed mean/proportion
(true.y="observed"
), the pooled mean/proportion (true.y="no.diff"
), or a vector of
constants (representing the mean/proportion in each group).
Selecting data.type="t.test"
with more than one group generates confidence intervals
using a t.test either under the assumption of equal variance if var.equal=TRUE
or
unequal variance if var.equal=FALSE
. In the latter case the degrees of freedom are
corrected using Satterthwaite's approximation.
Selecting data.type="binary"
generates confidence intervals using a test for equality
of proportions (similar to that calculated in prop.test
). A continuity correction is
not applied.
When there is more than one group, the program treats one group as the reference group and generates N-1 sets of predicted intervals (where N is the number of groups), where each group is compared to the reference group. When all the observations are in the same group (or no group vector was provided) one-sample tests are performed.
An object of class pred.int
is returned, which is a list of the following:
obs.mean |
Observed mean for each group (vector with length = n(groups) |
obs.n |
Observed n for each group |
sim.n |
Number simulated for each group |
ci |
A list of vectors of length 3 that contain the point estimate, lower, and upper confidence intervals for the observed effect. There are n(groups)-1 elements in the list (one for each comparison/graph) |
pi |
A list of matrices with 3 columns and |
data.type |
Data type (passed from input parameter) |
conf.level |
Confidence level used for predicted intervals (passed from input parameter) |
obs.conf.level |
Confidence level used for observed intervals (see |
Daniel G. Muenz, Ray Griner rgriner@sdac.harvad.edu, Huichao Chen, Lijuan Deng, Sachiko Miyahara, and Scott R. Evans evans@sdac.harvard.edu, with contributions from Lingling Li, Hajime Uno, and Laura M. Smeaton.
See package documentation for affiliations and contributions.
Evans SR, Li L, Wei LJ, "Data Monitoring in Clinical Trials Using Prediction", Drug Information Journal, 41:733-742, 2007.
Li L, Evans SR, Uno H, Wei LJ. "Predicted Interval Plots: A Graphical Tool for Data Monitoring in Clinical Trials", Statistics in Biopharmaceutical Research, 1:4:348-355, 2009.
1 2 3 4 5 6 7 8 9 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.