| assessfit {LW1949} | R Documentation | 
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
 | 
| fit | A model object that can be used to predict the corrected values
(as proportions) from  | 
| simple | A logical scalar indicating if the output should be restricted to just the P value, default TRUE. | 
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.
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).
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. [link].
See Also
LWchi2 and chisq.test.
Examples
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)