triple_goal | R Documentation |
triple_goal
implements the “Triple Goal” estimates
of Shen and Louis (1998) for a vector of parameters given a sample
from the posterior distribution of those parameters. Also computes
“constrained Bayes” estimators of Ghosh (1992).
triple_goal(s, stop.if.ties = FALSE, quantile.type = 7)
s |
A |
stop.if.ties |
logical; if TRUE, function stops if any units have identical posterior mean ranks; otherwise breaks ties at random. |
quantile.type |
|
In typical applications, the matrix s
will be a sample of size
n
from the joint posterior distribution of a vector of
K
group-specific parameters. Both the triple goal and constrained
Bayes estimators are designed to mitigate problems arising from
underdispersion of posterior means; see references.
A dataframe with K
rows with fields:
theta_pm |
Posterior mean estimates of group parameters. |
theta_psd |
Posterior standard deviation estimates of group parameters. |
theta_cb |
“Constrained Bayes” estimates of group parameters using formula in Shen and Louis (1998). |
theta_gr |
“Triple Goal” estimates of group parameters using algorithm defined in Shen and Louis (1998). |
rbar |
Posterior means of ranks of group parameters (1=lowest). |
rhat |
Integer ranks of group parameters (=rank(rbar)). |
J.R. Lockwood jrlockwood@ets.org
Shen W. and Louis T.A. (1998). “Triple-goal estimates in two-stage hierarchical models,” Journal of the Royal Statistical Society, Series B 60(2):455-471.
Ghosh M. (1992). “Constrained Bayes estimation with applications,” Journal of the American Statistical Association 87(418):533-540.
set.seed(1001) .K <- 50 .nsamp <- 500 .theta_true <- rnorm(.K) .s <- matrix(.theta_true, ncol=.K, nrow=.nsamp, byrow=TRUE) + matrix(rnorm(.K*.nsamp, sd=0.4), ncol=.K, nrow=.nsamp) .e <- triple_goal(.s) str(.e) head(.e)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.