Learn R Programming

LW1949 (version 1.1.0)

assessfit: Assess Fit of Dose-Response Curve

Description

Assess the fit of a dose-response curve using the chi-squared statistic. The curve is described by the intercept and slope of a straight line in the log dose vs. probit effect scale.

Usage

assessfit(params, DEdata, fit = gamtable1(), simple = TRUE)

Arguments

params
A numeric vector of length two, with the estimated intercept and slope of the dose-effect relation on the log10 and probit scale. These parameters define the dose-response curve.
DEdata
A data frame of dose-effect data (typically, the output from dataprep) containing at least these four variables: dose, ntot, pfx, fxcateg.
fit
A model object that can be used to predict the corrected values (as proportions) from distexpprop5, the distance between the expected values (as proportions) and 0.5, default gamtable1().
simple
A logical scalar indicating if the output should be restricted to just the P value, default TRUE.

Value

If simple=FALSE, a list of length two. The first element, chi, is a numeric vector of length three: chistat, chi-squared statistic; df, degrees of freedom; and pval, P value. The second element, contrib, is a matrix of three numeric vectors the same length as obsn: exp, expected effects; obscorr, observed effects corrected; and contrib, contributions to the chi-squared. If simple=TRUE, a numeric scalar, the chi-squared statistic (see details).

Details

This function is used to find the dose-response curve that minimizes the chi-squared statistic measuring the distance between the observed and expected values of the response (the proportion affected). Following Litchfield and Wilcoxon (1949, steps B1 and B2), records with expected effects < 0.01% or > 99.99% are deleted, and other expected effects are "corrected" using the correctval function.

References

Litchfield, JT Jr. and F Wilcoxon. 1949. A simplified method of evaluating dose-effect experiments. Journal of Pharmacology and Experimental Therapeutics 96(2):99-113. http://jpet.aspetjournals.org/content/96/2/99.abstract.

See Also

LWchi2 and chisq.test.

Examples

Run this code
conc <- c(0.0625, 0.125, 0.25, 0.5, 1)
numtested <- rep(8, 5)
nalive <- c(1, 4, 4, 7, 8)
mydat <- dataprep(dose=conc, ntot=numtested, nfx=nalive)
gamfit <- gamtable1()
assessfit(log10(c(0.125, 0.5)), mydat, simple=FALSE)

Run the code above in your browser using DataLab