Using the function fitHillModel(), this function fits four Hill models
with minimal and maximal effects either varying or fixed at the given
default values; it then selects the best fitting model based on the Bayesian
information criterio or Akaike information criterion, and returns a Hill fit
object with information from all fits included.
findBestHillModel(
formula,
data,
defaults,
weights = NULL,
start = NULL,
direction = 0,
lower = NULL,
upper = NULL,
useBIC = TRUE
)An object of class hillrm. Contains all of the values found in
any hillrm object (see fitHillModel()), as well as allfits, a named
list of lists containing the coefficients and parvectors for each of the
individual fits, as well as the Bayesian information criterion (bic) and
Akaike informtion criterion (aic) values for each fit.
Either an object of class formula such as would be provided
to a modeling function like lm(), or a numeric vector of concentration
values (including 0 or Inf)
If forumula is a symbolic formula, a data frame containing the
specified values. If formula is a numeric vector of concentrations, a
numeric vector of response values
A two value numeric vector containing the default minimal effect and the default maximal effect, in that order
A vector of weights (between 0 and 1) the same length as
conc and act which determines the weight with which each measurement
will impact the the sum of squared errors. Weights will be multiplied by
errors before squaring. If NULL (the default) all weights will be set
to 1. Can be a numeric vector, or the name of a column in data if formula
is a symbolic formula
A vector of four starting values for the Hill model to be fit.
Any values not being fit will be fixed at these starting values. If left as
NULL, a starting vector will be estimated from the data.
Determines the possible directionality of the dose response model. If 0 (the default) no additional constraints are placed on the parameters. If greater than 0, the fitting will require that the maximal effect is greater than the minimal effect. If less than 0, the fitting wll require tha the maximal effect is less than the minimal effect.
A length-four vector of lower bounds on the Hill parameter
values. Any parameters for which you do not wish to specify a bound can be
set to NA.
A vector of upper bounds on the Hill parameter values. Works
the same as parameter lower.
Determines the information criterion to be used. If TRUE
(the default), uses the Bayesian information criterion. If FALSE, uses
the Akaike information criterion
conc <- c(0,2^(-6:3),Inf)
hpar <- c(1,3,0,75)
response <- evalHillModel(conc, hpar) + rnorm(length(conc),sd=7.5)
hfit <- findBestHillModel(conc,response,defaults=c(0,100))
Run the code above in your browser using DataLab