Learn R Programming

nCal (version 2021.9-12)

crm.fit: Fit Concentration Response Model

Description

crm.fit can fit a constant or power variance function or log transform both sides.

Usage

crm.fit (formula, data, fit.4pl=FALSE, var.model=c("constant","power"),
    robust="mean", method=c("gls-pl","gnls","mle"), max.iter=50, reltol=1e-3, 
    gof.threshold=0.2, log.both.sides=FALSE, verbose=FALSE) 

# S3 method for crm deviance(object, ...) # S3 method for crm print(x, ..., digits=3) # S3 method for crm lines(x, ...) # S3 method for crm coef(object, parameterization=c("cla","gh","ed50b","edb50"), ...)

Arguments

formula

data

fit.4pl

Boolean

var.model

string

robust

string

method

string

max.iter

number

digits

number

reltol

numeric

gof.threshold

numeric

verbose

Boolean

log.both.sides

Boolean, log transform both sides

object, x

crm object

parameterization

string, output parameterization

...

additional argument

Value

An object of crm and drm type.

var.power

estimated power parameter in the power variance function

Details

crm.fit implements an iterative method for estimating a model with power variance. method: gls-pl means GLS-PL (see reference) log.both.sides: transform both sides (see reference)

References

Fong, Y., Yu, X. (2014) Transformation Model Choice in Nonlinear Regression Analysis of Serial Dilution Assays, submitted

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
dat.std=dat.QIL3[dat.QIL3$assay_id=="LMX001",]

# run 3 iter to save time for examples
fit.1=crm.fit(fi~expected_conc, dat.std, var.model="power", verbose=TRUE, max.iter=2)
fit.2=crm.fit(log(fi)~expected_conc, dat.std, verbose=TRUE)
fit.3=crm.fit(log(fi)~expected_conc, dat.std, var.model="power", verbose=TRUE, max.iter=2)

sapply(list(fit.1, fit.2, fit.3), coef)
fit.1$var.power
fit.2$var.power
fit.3$var.power

plot(fit.1, log="xy", type="all", lwd=3, pch="*")
lines(fit.2, expy=TRUE, col=2, lwd=3)
lines(fit.3, expy=TRUE, col=4, lty=2, lwd=3)
    
# }
# NOT RUN {

# }

Run the code above in your browser using DataLab