Description Usage Arguments Details Value References Examples
View source: R/10-UserEfficiency.R
Given a vector of initial estimates for the parameters, this function calculates the D-and PA- efficiency of a design ξ_1 with respect to a design ξ_2. Usually, ξ_2 is an optimal design.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
formula |
A linear or nonlinear model |
predvars |
A vector of characters. Denotes the predictors in the |
parvars |
A vector of characters. Denotes the unknown parameters in the |
family |
A description of the response distribution and the link function to be used in the model.
This can be a family function, a call to a family function or a character string naming the family.
Every family function has a link argument allowing to specify the link function to be applied on the response variable.
If not specified, default links are used. For details see |
inipars |
Vector. Initial values for the unknown parameters. It will be passed to the information matrix and also probability function. |
type |
A character. |
fimfunc |
A function. Returns the FIM as a |
x2 |
Vector of design (support) points of the optimal design (ξ_2). Similar to |
w2 |
Vector of corresponding design weights for |
x1 |
Vector of design (support) points of ξ_1. See 'Details' of |
w1 |
Vector of corresponding design weights for |
npar |
Number of model parameters. Used when |
prob |
Either |
For a known θ_0, relative D-efficiency is
exp{(log|M(ξ_1, θ_0)| - log|M(ξ_2, θ_0)|)/npar}.
The relative P-efficiency is
exp(log (∑ w1_i p(x1_i, θ_0) - log(∑ w2_i p(x2_i, θ_0)),
where x1 and w1 are usually the support points and the corresponding weights of the optimal design, respectively.
The argument x1
is the vector of design points.
For design points with more than one dimension (the models with more than one predictors),
it is a concatenation of the design points, but dimension-wise.
For example, let the model has three predictors (I, S, Z).
Then, a two-point optimal design has the following points:
{point1 = (I1, S1, Z1), point2 = (I2, S2, Z2)}.
Then, the argument x1
is equal to
x = c(I1, I2, S1, S2, Z1, Z2)
.
A value between 0 and 1.
McGree, J. M., Eccleston, J. A., and Duffull, S. B. (2008). Compound optimal design criteria for nonlinear models. Journal of Biopharmaceutical Statistics, 18(4), 646-661.
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 27 28 29 30 31 32 33 34 35 36 37 38 39 | p <- c(1, -2, 1, -1)
prior4.4 <- uniform(p -1.5, p + 1.5)
formula4.4 <- ~exp(b0+b1*x1+b2*x2+b3*x1*x2)/(1+exp(b0+b1*x1+b2*x2+b3*x1*x2))
prob4.4 <- ~1-1/(1+exp(b0 + b1 * x1 + b2 * x2 + b3 * x1 * x2))
predvars4.4 <- c("x1", "x2")
parvars4.4 <- c("b0", "b1", "b2", "b3")
# Locally D-optimal design is as follows:
## weight and point of D-optimal design
# Point1 Point2 Point3 Point4
# /1.00000 \ /-1.00000\ /0.06801 \ /1.00000 \
# \-1.00000/ \-1.00000/ \1.00000 / \1.00000 /
# Weight1 Weight2 Weight3 Weight4
# 0.250 0.250 0.250 0.250
xopt_D <- c(1, -1, .0680, 1, -1, -1, 1, 1)
wopt_D <- rep(.25, 4)
# Let see if we use only three of the design points, what is the relative efficiency.
leff(formula = formula4.4, predvars = predvars4.4, parvars = parvars4.4, family = binomial(),
x1 = c(1, -1, .0680, -1, -1, 1), w1 = c(.33, .33, .33),
inipars = p,
x2 = xopt_D, w2 = wopt_D)
# Wow, it heavily drops!
# Locally P-optimal design has only one support point and is -1 and 1
xopt_P <- c(-1, 1)
wopt_P <- 1
# What is the relative P-efficiency of the D-optimal design with respect to P-optimal design?
leff(formula = formula4.4, predvars = predvars4.4, parvars = parvars4.4, family = binomial(),
x1 = xopt_D, w1 = wopt_D,
inipars = p,
type = "PA",
prob = prob4.4,
x2 = xopt_P, w2 = wopt_P)
# .535
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.