simS {MCPModGeneral} | R Documentation |
Covariance Matrix Simulation
Description
For non-canonical links, simulating the covariance matrix is sometimes the easiest way to get an estimate of the covariance matrix. Even for the canonical links, simulating the covariance matrix may be desirable, as theoretical covariance matrices are based off of asymptotic properties which may not hold for small sample sizes.
Usage
simS(
doses,
resp,
nSample,
Ntype = c("arm", "total", "actual"),
nSim = 1000,
alRatio = NULL,
family,
link,
modelPar = NULL,
placEff = NULL,
verbose = FALSE
)
Arguments
doses |
A numerical vector of doses, corresponding to the theoretical response values provided. |
resp |
A numeric vector of response values corresponding to the doses.
This should be on the link scale (e.g. |
nSample |
An integer if |
Ntype |
One of "arm", "total", or 'actual". See documentation for
|
nSim |
An integer specifying the number of simulations used to estimate the covariance matrix. |
alRatio |
Vector describing the relative patient allocations to the dose
groups up to proportionality, e.g. |
family |
A character string containing the error distribution to be used in the model. |
link |
A character string specifying the link to be using when modeling the glm. |
modelPar |
A numeric vector containing the additional parameters for the family argument. If the family is negative binomial, the dispersion parameter should be supplied. If the family is binomial, no model parameter should be supplied. |
placEff |
A numeric value specifying the mean response at the placebo
This is required if |
verbose |
A logical specifying whether the patient allocation should be printed, in addition to the results. |
Value
Numeric containing the estimated covariance matrix.
Examples
data(migraine)
models = Mods(linear = NULL, emax = 1, quadratic = c(-0.004), doses = migraine$dose)
simS(migraine$dose, getResp(models)[,1], 30, "arm", 10, family = "binomial",
link = "logit", verbose = TRUE)