dtrials {droptest} | R Documentation |
Completes a simulated drop test.
Description
dtrials
returns simulated bernoulli trials (drops) that compose one
drop test.
Usage
dtrials(q, max.trials = 20, fail.criteria = 1,
data.structure = "data.table")
Arguments
q |
Integer. Specifies the probability that a reaction occurs.
A reaction is interpreted as a failure therfore q is the probability
of failure for the bernoulli trials. Probability of success would be
|
max.trials |
Integer. The maximum number of bernoulli trials to
perform. where each trial represents one drop of the impactor onto
a sample. Trials performed will always be less than or equal to
|
fail.criteria |
Integer. Specifies number of reactions (failures)
that can occur before an entire test is considered a failure. Must be
less than or equal to |
data.structure |
Instructs function to return result as a data.table or list. Default is data.table. Note: Other functions in this package only work with data.tables. List is an option strictly for future flexibility. |
Value
A data table or list. Containing the following elements:
-
F_CRITERIA The failure criteria specified.
-
REACT The total number of simulated reactions (failures).
-
NON_REACT The total number of simulated non-reactions (successes).
-
TRIALS The number of simulated trials performed until the failure condition was met.
-
MAX_TRIALS The maximum number of simulated trials specified.
-
PCT_REACT The percent of simulated trials that yielded a reaction (failure).
-
Q The probability of failure (reaction) as specified.
-
P The probability of success (non-reaction).
-
RESULT Whether the simulated test series as a whole failed or passed based on the failure criteria specified.
Author(s)
Chad Ross chad.ross@gmail.com
See Also
Examples
dtrials(0.05)
dtrials(0.05, max.trials = 60)
dtrials(0.05, fail.criteria = 2)
dtrials(0.05, max.trials = 60, fail.criteria = 2)
dtrials(0.05, data.structure = "list")