How to create a (total) Ghrelin calibration curve?

Version 5
by (unknown)
Version 6
by (unknown)

Deletions or items before changed

Additions or items after changed

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