Description Usage Arguments Details Value Note Author(s) References Examples

Calculates the D-effficiency of design *ξ_1* respect to design *ξ_2* with arbitrary precision.

1 | ```
eff(ymean, yvar, param, points1, points2, weights1, weights2, prec = 53)
``` |

`ymean` |
a character string,
formula of |

`yvar` |
a character string, formula of |

`param` |
a vector of values of parameters which must correspond to |

`points1` |
a vector of |

`points2` |
a vector of |

`weights1` |
a vector of |

`weights2` |
a vector of |

`prec` |
(optional) a number, the maximal precision to be used for D-efficiency calculation, in bite. Must be at least |

If response variables have the same constant variance, for example *σ^2*, then `yvar`

must be *1*.

Consider design *ξ* with *n* *m*-dimensional points. Then, the vector of *ξ* points is

*(x_1, x_2, …, x_i, …, x_n),*

where *x_i = (x_{i1}, x_{i2}, …, x_{im})*. Hence the length of vector points is *mn*.

D-efficiency as an 'mpfr' number.

This function is applicable for models that can be written as *E(Y_i)=f(x_i,β)*
where *y_i* is the *ith* response variable, *x_i* is the observation vector of the *ith* explanatory variables, *β* is the vector of parameters and *f* is a continuous and differentiable function with respect to *β*.
In addition, response variables must be independent with distributions that belong to the Natural exponential family. Logistic,Poisson, Negative Binomial, Exponential, Richards, Weibull, Log-linear, Inverse Quadratic and Michaelis-Menten are examples of these models.

Ehsan Masoudi, Majid Sarmad and Hooshang Talebi

Masoudi, E., Sarmad, M. and Talebi, H. 2012, An Almost General Code in R to Find Optimal Design, In Proceedings of the 1st ISM International Statistical Conference 2012, 292-297.

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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | ```
## Logistic dose-response model
ymean <- "(1/(exp(-b2*(x1-b1))+1))"
yvar <- "(1/(exp(-b2*(x1-b1))+1))*(1-(1/(exp(-b2*(x1-b1))+1)))"
eff (ymean, yvar, param = c(.9, .8), points1 = c(-3, 1, 2),
points2 = c(-1.029256, 2.829256), weights1 = rep(.33, 3), weights2 = c(.5, .5),
prec = 54)
## or
ldlogistic(a = .9 , b = .8, form = 2, lb = -5, ub = 5, user.points = c(-3, 1, 2),
user.weights = c(.33, .33, .33))$user.eff
## Poisson model:
ymean <- yvar <- "exp(b1 + b2 * x1)"
eff (ymean, yvar, param = c(.9, .8), points1 = c(-3, 1, 2), points2 = c(2.5, 5.0),
weights1 = rep(.33, 3), weights2 = c(.5, .5), prec = 54)
#####################################################################
## In the following, ymean and yvar for some famous models are given:
## Logistic model:
ymean <- "1/(exp(-b1 - b2 * x1) + 1)"
yvar <- "(1/(exp(-b1 - b2 * x1) + 1))*(1 - (1/(exp(-b1 - b2 * x1) + 1)))"
## Poisson dose response model:
ymean <- yvar <- "b1 * exp(-b2 * x1)"
## Inverse Quadratic model:
ymean <- "(b1 * x1)/(b2 + x1 + b3 * (x1)^2)"
yvar <- "1"
#
ymean <- "x1/(b1 + b2 * x1 + b3 * (x1)^2)"
yvar <- "1"
## Weibull model:
ymean <- "b1 - b2 * exp(-b3 * x1^b4)"
yvar <- "1"
## Richards model:
ymean <- "b1/(1 + b2 * exp(-b3 * x1))^b4"
yvar <- "1"
## Michaelis-Menten model:
ymean <- "(b1 * x1)/(1 + b2 * x1)"
yvar <- "1"
#
ymean <- "(b1 * x1)/(b2 + x1)"
yvar <- "1"
#
ymean <- "x1/(b1 + b2 * x1)"
yvar <- "1"
## log-linear model:
ymean <- "b1 + b2 * log(x1 + b3)"
yvar <- "1"
## Exponential model:
ymean <- "b1 + b2 * exp(x1/b3)"
yvar <- "1"
## Emax model:
ymean <- "b1 + (b2 * x1)/(x1 + b3)"
yvar <- "1"
## Negative binomial model Y ~ NB(E(Y), theta) where E(Y) = b1 * exp(-b2 * x1):
theta <- 5
ymean <- "b1 * exp(-b2 * x1)"
yvar <- paste ("b1 * exp(-b2 * x1)*(1 + (1/", theta, ") * b1 * exp(-b2 * x1))", sep = "")
## Linear regression model:
ymean <- "b1 + b2 * x1 + b3 * x2 + b4 * x1 * x2"
yvar = "1"
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.