derSimonian-Laird | R Documentation |
Calculates derSimonian-Laird estimate of location, with standard error, assuming a random-effects model
dsl(x, ..., na.rm = FALSE)
## Default S3 method:
dsl(x, s, n = NULL, groups = NULL, ..., na.rm = FALSE)
x |
numeric vector of mean values for groups, or (if |
s |
numeric vector of length |
n |
integer giving the number of observations in each group. May be a vector
of length |
groups |
factor, or vetor which can be coerced to factor, of groups. If
present, |
na.rm |
logical: if |
... |
Further parameters passed to other methods. |
dsl
implements the derSimonian-Laird random-effects estimate of location,
using the implementation described by Jackson (2010).
The estimator assumes a model of the form
x_i=\mu+b_i+e_i
in which b_i
is drawn from N(0, \tau^2)
and
e_i
is drawn from N(0, \sigma_i^2)
.
The estimator forms a direct calculation of \tau
, and uses this to
form revised estimates of standard error \sqrt{s_i^2+\tau^2}
in x
, calculates weights as the inverse of these and in turn calculates a
weighted mean, allowing for any calculated excess variance \tau^2
.
This implementation permits input in the form of:
means x
and standard errors s
, in which case neither n
nor
groups
are supplied;
means x
, standard deviations s
and group size(s) n
,
standard errors then being calculated as s/sqrt(n)
individual observations x
with a groupinf factor groups
, in
which case standard errors are calculated from the groups using tapply
.
A loc.est object; see loc.est for details. In the returned object, individual
values xi
are always input means (calculated from groups and n
as
necessary); method.details
is returned as a list containing:
The estimated location.
The standard error in the location.
The excess variance (as a standard deviation).
S L R Ellison s.ellison@lgcgroup.com
Jackson et al. (2010) J Stat Plan Inf 140, 961-970
loc.est-class
#PCB measurements in a sediment from Key Comparison CCQM-K25
#s are reported standard uncertainties
pcb105 <- data.frame(x=c(10.21, 10.9, 10.94, 10.58, 10.81, 9.62, 10.8),
s=c(0.381, 0.250, 0.130, 0.410, 0.445, 0.196, 0.093))
with( pcb105, dsl(x, s) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.