How to create a (total) Ghrelin calibration curve?

Version 6
by (unknown)
Version 7
by (unknown)

Deletions or items before changed

Additions or items after changed

1 == Computing Ghrelin calibration curve using R ==
2
3 The calibration curve can be created using R, and libracy "drc". Optionally, one can use library "sfmisc" for formatting of the labels on plot axis.
4 The R code is attached below.
5
6 {{{
7
8 ##### Install libraries
9 install.packages("drc")
10 install.packages("sfsmisc")
11 require(drc)
12 library(sfsmisc)
13
14 ##### Read the data
15 hormone.data <- read.csv("ghrelin_conc std_a std_b avg.csv")
16 hormone.data <- hormone.data[,1:3]
17 colnames(hormone.data)[1:3] <- c("Concentration","Response_1", "Response_2")
18
19 ##### Reorganize the data
20 hormone.data <- reshape(hormone.data, varying=c("Response_1","Response_2"), direction="long", v.names=c("Response"))
21 hormone.data <- hormone.data[,c("Concentration", "Response")]
22
23 ##### Fitting the model (4-parameter log-logistic function)
24 hormone.data.model <- drm(Response ~ Concentration, data = hormone.data, fct = LL.4())
25 summary(hormone.data.model)
26
27 +
}}}
28 +
29 +
The calibration curve can be plotted using the commands below:
30 +
31 +
{{{
32 ##### Plotting a nice plot
33 par(pty="s", mar=c(5,5,1,1))
34 plot(hormone.data.model, type="confidence", cex.lab=2, axes=F, xlim=c(-10,10^6))
35 axis(side=1, at=hormone.data[1:6,1], labels=pretty10exp(hormone.data[1:6,1]), cex.axis=1.2)
36 axis(side=2, at=seq(0,1,0.2), labels=seq(0,1,0.2))
37 plot(hormone.data.model, type="all", add=T, pch=21, col="red", lwd=1, cex=2, bg="green")
38 +
}}}
39
40 -
##### Computing the concentration from the response, for instance for a response=0.1, and alpha=1-0.95
41 -
ED(hormone.data.model, respLev=0.1, interval="delta", type="absolute", level=0.95)
42
43 -
}}}
+
44 +
45 +
##### Computing the concentration from the response, for instance for a response=0.1, and alpha=1-0.95
46 +
ED(hormone.data.model, respLev=0.1, interval="delta", type="absolute", level=0.95)