The ‘ilab’ class and its constructor function.
construct.ilab(org, item, measurand, x, u, df, k, U, U.lower, U.upper,
distrib=NULL, distrib.pars=NULL, study=NA, title=NA, p=0.95, ...)
Character vector or factor of organisation names.
vector or factor of identifiers for test items. Coerced to factor on storage.
vector or factor identifying the measurand(s) involved in the study.
numeric vector of reported values.
numeric vector of reported standard uncertainties or standard errors associated with x.
optional numeric vector of degrees of freedom associated with each reported uncertainty.
numeric vector of coverage factors. The coverage factor is the factor multiplying u to obtain U.
numeric or character vector of expanded uncertainties or confidence interval half-widths. Coerced to numeric but may include a character representation of interval limits; see Details.
numeric vectors of lower and upper limits for the confidence interval around x, allowing asymmetric intervals. Defaults to U or to the limits specified by U. See Details.
A character vector of length length(x)
or a named list
of names of distribution functions associated with u
. If a character vector,
distrib
is recycled to length length(x)
.
A named list of lists of parameters describing the distributions
associated with u
to be passed to the relevant distribution function.
If distrib
is present but distrib.pars
is not, an attempt is made
to set defaults based on other parameters; see Details.
A character value or vector or a factor identifying different studies
or study populations within the data set. Typically used, for example, for identifying
participants in global and regional components of a combined study. Recycled to length
length(x)
if necessary.
An optional title for the study. May be a character vector, in which case each element is displayed on a separate line when printed.
Confidence level assumed to apply to k
. Used only to set a default value
for df
when distrib
indicates a t-distribution and df
is
unspecified.
Other named factors or character vectors used to group observations.
An object of class ‘ilab’ consisting of:
A character value or vector describing the study
A character string describing any subset operation used to form the object.
A data frame with columns:
org | Factor of organisations submitting results in the study |
item | Factor of test item identifiers. |
measurand | Factor of measurands determined for each item |
x | numeric vector of reported values. |
u | numeric vector of reported standard uncertainties or standard errors associated with x. |
df | numeric vector of degrees of freedom associated with each reported
uncertainty. Set to NA if not provided. |
k | numeric vector of coverage factors. The coverage factor is the factor multiplying u to obtain U. |
U | numeric or character vector of expanded uncertainties or confidence
interval half-widths. U is coerced to numeric but may include
a character representation of interval limits; see Details. |
U.lower, U.upper | numeric vectors of lower and upper limits for the confidence interval around x. |
study | Identifier for study groups (see Arguments above). |
… | Other grouping factors (supplied in ‘…’ in construct.ilab )
which can be used for sub-categorisation. |
An unnamed list of distribution names.
An unnamed list of lists of parameters describing the distributions
associated with u
.
If U
is a character vector, it may contain character representations of range.
Two forms are permitted:
Interpreted as limits of a range from a
to b
. U.lower
and U.upper
are calculated from these limits and x
U.upper
is set to a
in "+a"
,
and U.lower
is set to b
in "-b"
.
If distrib.pars
is missing, an attempt is made to deduce appropriate
distribution parameters from x
, u
, df
and distrib
.
In doing so, the following assumptions and values apply for the respective distributions:
mean=x$name, sd=u$name
.
min=x-sqrt(3)*u, max=x+sqrt(3)*u
.
min=x-sqrt(6)*u, max=x+sqrt(6)*u, mode=x
.
df=df, mean=x, sd=u
.
In addition, if distrib
contains "t"
or "t.scaled"
, and
df
is NA
, the corresponding degrees of freedom are chosen based on
k
and p
.
None, yet.
# NOT RUN {
data(Pb)
construct.ilab(org=Pb$lab, x=Pb$value, measurand="Pb", item="none",
u=Pb$u, k=Pb$k, U=Pb$U, title=c("CCQM K30", "Lead in wine"),
method=Pb$method)
#Illustrate default for U and automatic distrib.pars
construct.ilab(org=Pb$lab, x=Pb$value, measurand="Pb", item="none",
u=Pb$u, k=Pb$k, distrib="norm")
construct.ilab(org=Pb$lab, x=Pb$value, measurand="Pb", item="none",
u=Pb$u, k=Pb$k, distrib="t.scaled")
# }
Run the code above in your browser using DataLab