-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfit.Rd
70 lines (60 loc) · 2.58 KB
/
fit.Rd
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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fit.R
\docType{methods}
\name{fit}
\alias{fit}
\alias{fit,DRE-method}
\title{Fit a model to an object's data.}
\usage{
fit(object, ...)
\S4method{fit}{DRE}(object, type = "menls", name = NULL,
loess.xlog = TRUE, control.weight = 10, silent = FALSE, ...)
}
\arguments{
\item{object}{object of class DRE}
\item{...}{other arguments passed to the model-fitting function, e.g. to loess or nls}
\item{type}{type of model to fit, character. Currently supports "melm", "loess" and "menls": see Details}
\item{name}{a name to assign to the model, character}
\item{loess.xlog}{fit response vs. ln(dose) when using loess}
\item{control.weight}{weight to assing to the control.response when using loess with loess.xlog = F, numeric}
\item{silent}{logical: should the report of error messages be suppressed?}
}
\value{
An object of the same class as the input with a model object appended to its @model slot
}
\description{
Fit a model and append it to the @model slot of the input object.
}
\details{
The following model types can be specified by using the \code{type} argument:
\itemize{
\item \code{melm} - fit a median effect equation model with parameters \emph{ic50} and \emph{m} using linear least
squares \code{\link[stats]{lm}}.
The data are linearized as log(fa/fu) = m*log(dose) - m*log(ic50),
where fu is fraction unaffected, fu = response/control.response. fa is fraction affected, fa = 1-fu.
If fu > 1, it is set to 0.9999
\item \code{menls} - fit a median effect equation model with parameters \emph{ic50} and \emph{m} using non-linear
least squares \code{\link[stats]{nls}}
\item \code{loess} - fit a LOESS local regression model, using both dose-response data and the untreated control value,
i.e. \code{object@control.response}.
It is recommended to assign a high weight to the control, if there is a relatively large number of untreated control
data points in an experiment. This is determined by the \code{control.weight} argument.
Consider setting it to the ratio of the number of control data points to the number of replicates in the dose-response
data.
It is set to 10 by default.
}
}
\section{Methods (by class)}{
\itemize{
\item \code{DRE}: Fit a DRE object
This method fits a dose-response curve model and appends it to the model slot of a DRE object
}}
\examples{
data(sim15_screen3)
x = fit(dre(sim15_screen3,"Cpd10"),type="melm")
model(x)$melm
plot(x)
}
\seealso{
\code{\linkS4class{DRE}}, \code{\linkS4class{DRModel}}
}