Description Usage Arguments Details Value Author(s) References See Also Examples
A model linking each of a number of methods of measurement
linearly to the "true" value is set up in BUGS and run via the
functions jags.model
and
coda.samples
from the rjags
package.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | MCmcmc( data,
bias = "linear",
IxR = has.repl(data), linked = IxR,
MxI = TRUE, matrix = MxI,
varMxI = nlevels(factor(data$meth)) > 2,
n.chains = 4,
n.iter = 2000,
n.burnin = n.iter/2,
n.thin = ceiling((n.iter-n.burnin)/1000),
bugs.code.file = "model.txt",
clearWD = TRUE,
code.only = FALSE,
ini.mult = 2,
list.ini = TRUE,
org = FALSE,
Transform = NULL,
trans.tol = 1e-6 )
## S3 method for class 'MCmcmc'
summary( object, alpha=0.05, ...)
## S3 method for class 'MCmcmc'
print( x, digits=3, alpha=0.05, ... )
## S3 method for class 'MCmcmc'
subset( x, subset=NULL, allow.repl=FALSE, chains=NULL, ... )
## S3 method for class 'MCmcmc'
mcmc( x, ... )
|
data |
Data frame with variables |
bias |
Character. Indicating how the bias between methods should be
modelled. Possible values are |
IxR |
Logical. Are the replicates linked across methods, i.e. should
a random |
linked |
Logical, alias for |
MxI |
Logical, should a |
matrix |
Logical, alias for |
varMxI |
Logical, should the method by item effect have method-specific variances. Ignored if only two methods are compared. |
n.chains |
How many chains should be run by WinBUGS — passed on
to |
n.iter |
How many total iterations — passed on to |
n.burnin |
How many of these should be burn-in — passed on to |
n.thin |
How many should be sampled — passed on to |
clearWD |
Should the working directory be cleared for junk files after
the running of WinBUGS — passed on to |
bugs.code.file |
Where should the bugs code go? |
code.only |
Should |
ini.mult |
Numeric. What factor should be used to randomly perturb the initial values for the variance components, see below in details. |
list.ini |
List of lists of starting values for the chains, or logical
indicating whether starting values should be generated.
If
If |
org |
Logical. Should the posterior of the original model parameters be
returned too? If |
Transform |
Transformation of data ( |
trans.tol |
The tolerance used to check whether the supplied transformation and its inverse combine to the identity. |
object |
An |
alpha |
1 minus the the confidence level |
... |
Arguments passed on to other methods |
x |
An |
digits |
Number of digits after the decimal point when printing. |
subset |
Numerical, character or list giving the variables to keep.
If numerical, the variables in the |
allow.repl |
Should duplicate columns be allowed in the result? |
chains |
Numerical vector giving the number of the chains to keep. |
The model set up for an observation y_mir is:
y_mir = alpha_m + beta_m*(mu_i+b_ir+c_mi) + e_mir
where b_ir is a random item
by repl
interaction (included if
"ir" %in% random
) and c_mi is a random meth
by item
interaction (included if "mi" %in% random
). The mu_i's are
parameters in the model but are not monitored — only the alphas,
betas and the variances of b_{ir},
c_{mi} and e_{mir} are monitored and
returned. The estimated parameters are only determined up to a linear
transformation of the mus, but the linear functions linking
methods are invariant. The identifiable conversion parameters are:
alpha_m|k=alpha_m-alpha_k beta_m/beta_k, beta_m|k=beta_m/beta_k
The posteriors of these are derived and included in the posterior
, which
also will contain the posterior of the variance components (the SDs, that is).
Furthermore, the posterior of the point where the conversion lines intersects
the identity as well as the prediction SDs between any pairs of methods are
included.
The function summary.MCmcmc
method gives estimates of the conversion
parameters that are consistent. Clearly,
median(beta.1.2)=1/median(beta.2.1)
because the inverse is a monotone transformation, but there is no guarantee that
median(alpha.1.2)=median(-alpha.2.1/beta.2.1)
and hence no guarantee that the parameters derived as posterior medians
produce conversion lines that are the same in both directions. Therefore,
summary.MCmcmc
computes the estimate for alpha.2.1 as
(median(alpha.1.2)-median(alpha.2.1)/ median(beta.2.1))/2
and the estimate of alpha.1.2 correspondingly. The resulting parameter estimates defines the same lines.
If code.only==FALSE
, an object of class MCmcmc
which is
a mcmc.list
object of the relevant parameters, i.e. the
posteriors of the conversion parameters and the variance components transformed
to the scales of each of the methods.
Furthermore, the object have the following attributes:
random |
Character vector indicating which random effects ("ir","mi") were included in the model. |
methods |
Character vector with the method names. |
data |
The data frame used in the analysis. This is
used in |
mcmc.par |
A list giving the number of chains etc. used to generate the object. |
original |
If |
Transform |
The transformation used to the measurements before the analysis. |
If code.only==TRUE
, a list containing the initial values is
generated, and the generated BUGS
code is printed to the
console.
Bendix Carstensen, Steno Diabetes Center, http://BendixCarstensen.com, Lyle Gurrin, University of Melbourne, http://www.epi.unimelb.edu.au/about/staff/gurrin-lyle.
B Carstensen: Comparing and predicting between several methods of measurement, Biostatistics, 5, pp 399-413, 2004
BA.plot
,
plot.MCmcmc
,
print.MCmcmc
,
check.MCmcmc
1 2 3 4 5 6 7 8 9 10 11 | |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.