[R] Plot in drc package
li li
hannah.hlx at gmail.com
Tue Dec 8 04:26:17 CET 2015
Hi all,
I have the following data and I fit a log logistic model using the drm
function in DRC package.
I saved the fitted model in an object called "mod". (See below)
I understand that we can use the plot function to plot the regression
curve with the original data points using the code "plot(mod, type="all",
col="blue")". I have two questions regarding the generated plot:
1. the concentration stop at 10 in the graph. How can I show data for
all concentration values? (in the original data set, the largest
concentration is 20).
2. The plot looks like on the log (conc) scale (If I simply plot resp
against conc, the shape of the data is not sigmoid). However, the x label
automatically and the scale of the x axis come out as conc. It seems to be
it should be on the log scale instead.
Thanks very much in advance!!
Hanna
> dat
resp conc
1 -68 20.000000000
2 -74 20.000000000
3 -75 20.000000000
4 -47 10.000000000
5 -53 10.000000000
6 -58 10.000000000
7 8 5.000000000
8 -25 5.000000000
9 -18 5.000000000
10 75 2.500000000
11 89 2.500000000
12 116 2.500000000
13 346 1.250000000
14 471 1.250000000
15 515 1.250000000
16 1003 0.625000000
17 1033 0.625000000
18 866 0.625000000
19 1384 0.312500000
20 1431 0.312500000
21 1460 0.312500000
22 1853 0.156250000
23 1918 0.156250000
24 1858 0.156250000
25 1995 0.078125000
26 2034 0.078125000
27 1991 0.078125000
28 2065 0.039062500
29 2044 0.039062500
30 2090 0.039062500
31 2148 0.019531250
32 2048 0.019531250
33 2003 0.019531250
34 2075 0.009765625
35 2068 0.009765625
36 2056 0.009765625
> mod <- drm(resp ~ conc, fct=LL.4(), data=dat)
> summary(mod)
Model fitted: Log-logistic (ED50 as parameter) (4 parms)
Parameter estimates:
Estimate Std. Error t-value p-value
b:(Intercept) 1.536783 0.060292 25.489167 0e+00
c:(Intercept) -86.952455 18.941887 -4.590485 1e-04
d:(Intercept) 2089.228320 16.413634 127.286154 0e+00
e:(Intercept) 0.581979 0.017057 34.119620 0e+00
Residual standard error:
48.61747 (32 degrees of freedom)
[[alternative HTML version deleted]]
More information about the R-help
mailing list