Plot asymptote in grotwth curve in R
How can I plot the line asymptote off this curve above?
# Create Data
Conc <- c(0.03125, 0.06250, 0.12500, 0.25000, 0.50000, 1.00000, 0.03125, 0.06250, 0.12500, 0.25000, 0.50000, 1.00000, 0.03125, 0.06250, 0.12500, 0.25000, 0.50000, 1.00000, 0.03125, 0.06250, 0.12500, 0.25000, 0.50000, 1.00000, 0.03125, 0.06250, 0.12500, 0.25000, 0.50000, 1.00000, 0.03125, 0.06250, 0.12500, 0.25000, 0.50000, 1.00000)
Response <- c(167.11246201, 53.96960486, 128.42857143, 43.67173252, 4.51975684, 0.34042553, 120.10334347, 101.14589666, 155.17629179, 35.31306991, 8.56534954, 1.71124620, 146.34954407, 108.50151976, 163.60182371, 64.70212766, 2.88145897, 0.50759878, 82.92401216, 109.80547112, 116.69300912, 26.85410334, 3.01519757, 0.37386018, 87.06990881, 84.82978723, 118.36474164, 27.52279635, 2.34650456, 0.10638298, 89.47720365, 109.47112462, 85.43161094, 17.69300912, 2.31306991, 0.07294833)
df <- data.frame(Conc = Conc, Response = Response)
#Make Modell
library(drc)
#adjust model
drm <- drm(Response ~ Conc, data = df, fct = LL.4())
#plot
plot(drm)
This is an exemple of what I mean?
enter image description here
r math statistics
add a comment |
How can I plot the line asymptote off this curve above?
# Create Data
Conc <- c(0.03125, 0.06250, 0.12500, 0.25000, 0.50000, 1.00000, 0.03125, 0.06250, 0.12500, 0.25000, 0.50000, 1.00000, 0.03125, 0.06250, 0.12500, 0.25000, 0.50000, 1.00000, 0.03125, 0.06250, 0.12500, 0.25000, 0.50000, 1.00000, 0.03125, 0.06250, 0.12500, 0.25000, 0.50000, 1.00000, 0.03125, 0.06250, 0.12500, 0.25000, 0.50000, 1.00000)
Response <- c(167.11246201, 53.96960486, 128.42857143, 43.67173252, 4.51975684, 0.34042553, 120.10334347, 101.14589666, 155.17629179, 35.31306991, 8.56534954, 1.71124620, 146.34954407, 108.50151976, 163.60182371, 64.70212766, 2.88145897, 0.50759878, 82.92401216, 109.80547112, 116.69300912, 26.85410334, 3.01519757, 0.37386018, 87.06990881, 84.82978723, 118.36474164, 27.52279635, 2.34650456, 0.10638298, 89.47720365, 109.47112462, 85.43161094, 17.69300912, 2.31306991, 0.07294833)
df <- data.frame(Conc = Conc, Response = Response)
#Make Modell
library(drc)
#adjust model
drm <- drm(Response ~ Conc, data = df, fct = LL.4())
#plot
plot(drm)
This is an exemple of what I mean?
enter image description here
r math statistics
tryabline
witha= asymptote
andb=0
– Jrakru56
Nov 16 '18 at 14:48
Unfortunately it did not work, that is the mensagem: Error in abline(a = asymptote, b = 0) : object 'asymptote' not found
– Vitor Muller Anunciato
Nov 16 '18 at 14:57
Sorry, I was not clear. I meant assign the value of the asymptote to the parametera
. See below
– Jrakru56
Nov 16 '18 at 15:00
add a comment |
How can I plot the line asymptote off this curve above?
# Create Data
Conc <- c(0.03125, 0.06250, 0.12500, 0.25000, 0.50000, 1.00000, 0.03125, 0.06250, 0.12500, 0.25000, 0.50000, 1.00000, 0.03125, 0.06250, 0.12500, 0.25000, 0.50000, 1.00000, 0.03125, 0.06250, 0.12500, 0.25000, 0.50000, 1.00000, 0.03125, 0.06250, 0.12500, 0.25000, 0.50000, 1.00000, 0.03125, 0.06250, 0.12500, 0.25000, 0.50000, 1.00000)
Response <- c(167.11246201, 53.96960486, 128.42857143, 43.67173252, 4.51975684, 0.34042553, 120.10334347, 101.14589666, 155.17629179, 35.31306991, 8.56534954, 1.71124620, 146.34954407, 108.50151976, 163.60182371, 64.70212766, 2.88145897, 0.50759878, 82.92401216, 109.80547112, 116.69300912, 26.85410334, 3.01519757, 0.37386018, 87.06990881, 84.82978723, 118.36474164, 27.52279635, 2.34650456, 0.10638298, 89.47720365, 109.47112462, 85.43161094, 17.69300912, 2.31306991, 0.07294833)
df <- data.frame(Conc = Conc, Response = Response)
#Make Modell
library(drc)
#adjust model
drm <- drm(Response ~ Conc, data = df, fct = LL.4())
#plot
plot(drm)
This is an exemple of what I mean?
enter image description here
r math statistics
How can I plot the line asymptote off this curve above?
# Create Data
Conc <- c(0.03125, 0.06250, 0.12500, 0.25000, 0.50000, 1.00000, 0.03125, 0.06250, 0.12500, 0.25000, 0.50000, 1.00000, 0.03125, 0.06250, 0.12500, 0.25000, 0.50000, 1.00000, 0.03125, 0.06250, 0.12500, 0.25000, 0.50000, 1.00000, 0.03125, 0.06250, 0.12500, 0.25000, 0.50000, 1.00000, 0.03125, 0.06250, 0.12500, 0.25000, 0.50000, 1.00000)
Response <- c(167.11246201, 53.96960486, 128.42857143, 43.67173252, 4.51975684, 0.34042553, 120.10334347, 101.14589666, 155.17629179, 35.31306991, 8.56534954, 1.71124620, 146.34954407, 108.50151976, 163.60182371, 64.70212766, 2.88145897, 0.50759878, 82.92401216, 109.80547112, 116.69300912, 26.85410334, 3.01519757, 0.37386018, 87.06990881, 84.82978723, 118.36474164, 27.52279635, 2.34650456, 0.10638298, 89.47720365, 109.47112462, 85.43161094, 17.69300912, 2.31306991, 0.07294833)
df <- data.frame(Conc = Conc, Response = Response)
#Make Modell
library(drc)
#adjust model
drm <- drm(Response ~ Conc, data = df, fct = LL.4())
#plot
plot(drm)
This is an exemple of what I mean?
enter image description here
r math statistics
r math statistics
asked Nov 16 '18 at 14:34
Vitor Muller AnunciatoVitor Muller Anunciato
54
54
tryabline
witha= asymptote
andb=0
– Jrakru56
Nov 16 '18 at 14:48
Unfortunately it did not work, that is the mensagem: Error in abline(a = asymptote, b = 0) : object 'asymptote' not found
– Vitor Muller Anunciato
Nov 16 '18 at 14:57
Sorry, I was not clear. I meant assign the value of the asymptote to the parametera
. See below
– Jrakru56
Nov 16 '18 at 15:00
add a comment |
tryabline
witha= asymptote
andb=0
– Jrakru56
Nov 16 '18 at 14:48
Unfortunately it did not work, that is the mensagem: Error in abline(a = asymptote, b = 0) : object 'asymptote' not found
– Vitor Muller Anunciato
Nov 16 '18 at 14:57
Sorry, I was not clear. I meant assign the value of the asymptote to the parametera
. See below
– Jrakru56
Nov 16 '18 at 15:00
try
abline
with a= asymptote
and b=0
– Jrakru56
Nov 16 '18 at 14:48
try
abline
with a= asymptote
and b=0
– Jrakru56
Nov 16 '18 at 14:48
Unfortunately it did not work, that is the mensagem: Error in abline(a = asymptote, b = 0) : object 'asymptote' not found
– Vitor Muller Anunciato
Nov 16 '18 at 14:57
Unfortunately it did not work, that is the mensagem: Error in abline(a = asymptote, b = 0) : object 'asymptote' not found
– Vitor Muller Anunciato
Nov 16 '18 at 14:57
Sorry, I was not clear. I meant assign the value of the asymptote to the parameter
a
. See below– Jrakru56
Nov 16 '18 at 15:00
Sorry, I was not clear. I meant assign the value of the asymptote to the parameter
a
. See below– Jrakru56
Nov 16 '18 at 15:00
add a comment |
3 Answers
3
active
oldest
votes
I am not sure what is the right way here, but I usually do it like this:
Logistic funtion
Still don't know how to use LL.4()
for this purpose
flogis <- function(x, b, c, d, e){
c + (d - c)/(1 + exp(b*(log(x) - log(e))))
}
Dataset
Make some example data:
dose <- rep(exp(seq(-5, 5, length.out = 10)), each = 3)
dat <- data.frame(
dose = dose,
response = flogis(dose, -1, 0, 1, .5) + rnorm(length(dose), 0, .05)
)
head(dat)
# dose response
#1 0.006737947 0.01310683
#2 0.006737947 0.08292573
#3 0.006737947 0.03263079
#4 0.020468076 0.02763111
#5 0.020468076 0.01934260
#6 0.020468076 0.01296994
Fitting 4-parameters log-logistic model
library(drc)
model <- drm(response ~ dose, data = dat, fct = LL.4())
summary(model)
#Model fitted: Log-logistic (ED50 as parameter) (4 parms)
#
#Parameter estimates:
#
# Estimate Std. Error t-value p-value
#b:(Intercept) -1.0012680 0.0887792 -11.2782 1.637e-11 ***
#c:(Intercept) 0.0049506 0.0243151 0.2036 0.8402
#d:(Intercept) 0.9889417 0.0163848 60.3573 < 2.2e-16 ***
#e:(Intercept) 0.4054848 0.0419639 9.6627 4.310e-10 ***
#---
#Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#
#Residual standard error:
#
#0.04466107 (26 degrees of freedom)
Grab model parameters for use with ggplot
coefs <- setNames(coef(model), c("b", "c", "d", "e"))
y50 <- predict(model, newdata = data.frame(dose = coefs["e"]))
Plot data
(Sorry, have no time to play with text labels, and don't understand what phi2 + phi3
means on the example plot, but pretty sure that is something which is going on around EC50)
ggplot(dat, aes(x = dose, y = response)) +
stat_function(fun = function(x, b, c, d, e){
c + (d - c)/(1 + exp(b*(log(x) - log(e))))
}, args = coefs, col = "skyblue", lwd = 1) +
geom_point(pch = 21, fill = "white") +
geom_hline(yintercept = coefs[c("c", "d")], lty = 2, colour = "gray50") +
geom_segment(aes(x = coefs["e"], y = 0, xend = coefs["e"], yend = y50),
lty = 2, colour = "gray50") +
geom_segment(aes(x = coefs["e"], y = y50, xend = 0, yend = y50),
lty = 2, colour = "gray50") +
scale_x_log10(
breaks = scales::trans_breaks("log10", function(x) 10^x),
labels = scales::trans_format("log10", scales::math_format(10^.x))
) +
annotation_logticks(sides = "b") +
labs(x = "Dose",
y = "Response"
) +
expand_limits(y = 1) +
ggthemes::theme_few()
add a comment |
try this :
library(drc)
#adjust model
drm <- drm(Response ~ Conc, data = df, fct = LL.4())
#plot
plot(drm)
abline(a=112.6868 , 0)
add a comment |
You can extract the value of the asymptote from the drm
object:
asymptote <- coef(drm)[3]
This value can be used for plotting:
plot(drm)
abline(asymptote, 0)
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53339882%2fplot-asymptote-in-grotwth-curve-in-r%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
I am not sure what is the right way here, but I usually do it like this:
Logistic funtion
Still don't know how to use LL.4()
for this purpose
flogis <- function(x, b, c, d, e){
c + (d - c)/(1 + exp(b*(log(x) - log(e))))
}
Dataset
Make some example data:
dose <- rep(exp(seq(-5, 5, length.out = 10)), each = 3)
dat <- data.frame(
dose = dose,
response = flogis(dose, -1, 0, 1, .5) + rnorm(length(dose), 0, .05)
)
head(dat)
# dose response
#1 0.006737947 0.01310683
#2 0.006737947 0.08292573
#3 0.006737947 0.03263079
#4 0.020468076 0.02763111
#5 0.020468076 0.01934260
#6 0.020468076 0.01296994
Fitting 4-parameters log-logistic model
library(drc)
model <- drm(response ~ dose, data = dat, fct = LL.4())
summary(model)
#Model fitted: Log-logistic (ED50 as parameter) (4 parms)
#
#Parameter estimates:
#
# Estimate Std. Error t-value p-value
#b:(Intercept) -1.0012680 0.0887792 -11.2782 1.637e-11 ***
#c:(Intercept) 0.0049506 0.0243151 0.2036 0.8402
#d:(Intercept) 0.9889417 0.0163848 60.3573 < 2.2e-16 ***
#e:(Intercept) 0.4054848 0.0419639 9.6627 4.310e-10 ***
#---
#Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#
#Residual standard error:
#
#0.04466107 (26 degrees of freedom)
Grab model parameters for use with ggplot
coefs <- setNames(coef(model), c("b", "c", "d", "e"))
y50 <- predict(model, newdata = data.frame(dose = coefs["e"]))
Plot data
(Sorry, have no time to play with text labels, and don't understand what phi2 + phi3
means on the example plot, but pretty sure that is something which is going on around EC50)
ggplot(dat, aes(x = dose, y = response)) +
stat_function(fun = function(x, b, c, d, e){
c + (d - c)/(1 + exp(b*(log(x) - log(e))))
}, args = coefs, col = "skyblue", lwd = 1) +
geom_point(pch = 21, fill = "white") +
geom_hline(yintercept = coefs[c("c", "d")], lty = 2, colour = "gray50") +
geom_segment(aes(x = coefs["e"], y = 0, xend = coefs["e"], yend = y50),
lty = 2, colour = "gray50") +
geom_segment(aes(x = coefs["e"], y = y50, xend = 0, yend = y50),
lty = 2, colour = "gray50") +
scale_x_log10(
breaks = scales::trans_breaks("log10", function(x) 10^x),
labels = scales::trans_format("log10", scales::math_format(10^.x))
) +
annotation_logticks(sides = "b") +
labs(x = "Dose",
y = "Response"
) +
expand_limits(y = 1) +
ggthemes::theme_few()
add a comment |
I am not sure what is the right way here, but I usually do it like this:
Logistic funtion
Still don't know how to use LL.4()
for this purpose
flogis <- function(x, b, c, d, e){
c + (d - c)/(1 + exp(b*(log(x) - log(e))))
}
Dataset
Make some example data:
dose <- rep(exp(seq(-5, 5, length.out = 10)), each = 3)
dat <- data.frame(
dose = dose,
response = flogis(dose, -1, 0, 1, .5) + rnorm(length(dose), 0, .05)
)
head(dat)
# dose response
#1 0.006737947 0.01310683
#2 0.006737947 0.08292573
#3 0.006737947 0.03263079
#4 0.020468076 0.02763111
#5 0.020468076 0.01934260
#6 0.020468076 0.01296994
Fitting 4-parameters log-logistic model
library(drc)
model <- drm(response ~ dose, data = dat, fct = LL.4())
summary(model)
#Model fitted: Log-logistic (ED50 as parameter) (4 parms)
#
#Parameter estimates:
#
# Estimate Std. Error t-value p-value
#b:(Intercept) -1.0012680 0.0887792 -11.2782 1.637e-11 ***
#c:(Intercept) 0.0049506 0.0243151 0.2036 0.8402
#d:(Intercept) 0.9889417 0.0163848 60.3573 < 2.2e-16 ***
#e:(Intercept) 0.4054848 0.0419639 9.6627 4.310e-10 ***
#---
#Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#
#Residual standard error:
#
#0.04466107 (26 degrees of freedom)
Grab model parameters for use with ggplot
coefs <- setNames(coef(model), c("b", "c", "d", "e"))
y50 <- predict(model, newdata = data.frame(dose = coefs["e"]))
Plot data
(Sorry, have no time to play with text labels, and don't understand what phi2 + phi3
means on the example plot, but pretty sure that is something which is going on around EC50)
ggplot(dat, aes(x = dose, y = response)) +
stat_function(fun = function(x, b, c, d, e){
c + (d - c)/(1 + exp(b*(log(x) - log(e))))
}, args = coefs, col = "skyblue", lwd = 1) +
geom_point(pch = 21, fill = "white") +
geom_hline(yintercept = coefs[c("c", "d")], lty = 2, colour = "gray50") +
geom_segment(aes(x = coefs["e"], y = 0, xend = coefs["e"], yend = y50),
lty = 2, colour = "gray50") +
geom_segment(aes(x = coefs["e"], y = y50, xend = 0, yend = y50),
lty = 2, colour = "gray50") +
scale_x_log10(
breaks = scales::trans_breaks("log10", function(x) 10^x),
labels = scales::trans_format("log10", scales::math_format(10^.x))
) +
annotation_logticks(sides = "b") +
labs(x = "Dose",
y = "Response"
) +
expand_limits(y = 1) +
ggthemes::theme_few()
add a comment |
I am not sure what is the right way here, but I usually do it like this:
Logistic funtion
Still don't know how to use LL.4()
for this purpose
flogis <- function(x, b, c, d, e){
c + (d - c)/(1 + exp(b*(log(x) - log(e))))
}
Dataset
Make some example data:
dose <- rep(exp(seq(-5, 5, length.out = 10)), each = 3)
dat <- data.frame(
dose = dose,
response = flogis(dose, -1, 0, 1, .5) + rnorm(length(dose), 0, .05)
)
head(dat)
# dose response
#1 0.006737947 0.01310683
#2 0.006737947 0.08292573
#3 0.006737947 0.03263079
#4 0.020468076 0.02763111
#5 0.020468076 0.01934260
#6 0.020468076 0.01296994
Fitting 4-parameters log-logistic model
library(drc)
model <- drm(response ~ dose, data = dat, fct = LL.4())
summary(model)
#Model fitted: Log-logistic (ED50 as parameter) (4 parms)
#
#Parameter estimates:
#
# Estimate Std. Error t-value p-value
#b:(Intercept) -1.0012680 0.0887792 -11.2782 1.637e-11 ***
#c:(Intercept) 0.0049506 0.0243151 0.2036 0.8402
#d:(Intercept) 0.9889417 0.0163848 60.3573 < 2.2e-16 ***
#e:(Intercept) 0.4054848 0.0419639 9.6627 4.310e-10 ***
#---
#Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#
#Residual standard error:
#
#0.04466107 (26 degrees of freedom)
Grab model parameters for use with ggplot
coefs <- setNames(coef(model), c("b", "c", "d", "e"))
y50 <- predict(model, newdata = data.frame(dose = coefs["e"]))
Plot data
(Sorry, have no time to play with text labels, and don't understand what phi2 + phi3
means on the example plot, but pretty sure that is something which is going on around EC50)
ggplot(dat, aes(x = dose, y = response)) +
stat_function(fun = function(x, b, c, d, e){
c + (d - c)/(1 + exp(b*(log(x) - log(e))))
}, args = coefs, col = "skyblue", lwd = 1) +
geom_point(pch = 21, fill = "white") +
geom_hline(yintercept = coefs[c("c", "d")], lty = 2, colour = "gray50") +
geom_segment(aes(x = coefs["e"], y = 0, xend = coefs["e"], yend = y50),
lty = 2, colour = "gray50") +
geom_segment(aes(x = coefs["e"], y = y50, xend = 0, yend = y50),
lty = 2, colour = "gray50") +
scale_x_log10(
breaks = scales::trans_breaks("log10", function(x) 10^x),
labels = scales::trans_format("log10", scales::math_format(10^.x))
) +
annotation_logticks(sides = "b") +
labs(x = "Dose",
y = "Response"
) +
expand_limits(y = 1) +
ggthemes::theme_few()
I am not sure what is the right way here, but I usually do it like this:
Logistic funtion
Still don't know how to use LL.4()
for this purpose
flogis <- function(x, b, c, d, e){
c + (d - c)/(1 + exp(b*(log(x) - log(e))))
}
Dataset
Make some example data:
dose <- rep(exp(seq(-5, 5, length.out = 10)), each = 3)
dat <- data.frame(
dose = dose,
response = flogis(dose, -1, 0, 1, .5) + rnorm(length(dose), 0, .05)
)
head(dat)
# dose response
#1 0.006737947 0.01310683
#2 0.006737947 0.08292573
#3 0.006737947 0.03263079
#4 0.020468076 0.02763111
#5 0.020468076 0.01934260
#6 0.020468076 0.01296994
Fitting 4-parameters log-logistic model
library(drc)
model <- drm(response ~ dose, data = dat, fct = LL.4())
summary(model)
#Model fitted: Log-logistic (ED50 as parameter) (4 parms)
#
#Parameter estimates:
#
# Estimate Std. Error t-value p-value
#b:(Intercept) -1.0012680 0.0887792 -11.2782 1.637e-11 ***
#c:(Intercept) 0.0049506 0.0243151 0.2036 0.8402
#d:(Intercept) 0.9889417 0.0163848 60.3573 < 2.2e-16 ***
#e:(Intercept) 0.4054848 0.0419639 9.6627 4.310e-10 ***
#---
#Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#
#Residual standard error:
#
#0.04466107 (26 degrees of freedom)
Grab model parameters for use with ggplot
coefs <- setNames(coef(model), c("b", "c", "d", "e"))
y50 <- predict(model, newdata = data.frame(dose = coefs["e"]))
Plot data
(Sorry, have no time to play with text labels, and don't understand what phi2 + phi3
means on the example plot, but pretty sure that is something which is going on around EC50)
ggplot(dat, aes(x = dose, y = response)) +
stat_function(fun = function(x, b, c, d, e){
c + (d - c)/(1 + exp(b*(log(x) - log(e))))
}, args = coefs, col = "skyblue", lwd = 1) +
geom_point(pch = 21, fill = "white") +
geom_hline(yintercept = coefs[c("c", "d")], lty = 2, colour = "gray50") +
geom_segment(aes(x = coefs["e"], y = 0, xend = coefs["e"], yend = y50),
lty = 2, colour = "gray50") +
geom_segment(aes(x = coefs["e"], y = y50, xend = 0, yend = y50),
lty = 2, colour = "gray50") +
scale_x_log10(
breaks = scales::trans_breaks("log10", function(x) 10^x),
labels = scales::trans_format("log10", scales::math_format(10^.x))
) +
annotation_logticks(sides = "b") +
labs(x = "Dose",
y = "Response"
) +
expand_limits(y = 1) +
ggthemes::theme_few()
answered Nov 16 '18 at 15:57
utubunutubun
1,1841711
1,1841711
add a comment |
add a comment |
try this :
library(drc)
#adjust model
drm <- drm(Response ~ Conc, data = df, fct = LL.4())
#plot
plot(drm)
abline(a=112.6868 , 0)
add a comment |
try this :
library(drc)
#adjust model
drm <- drm(Response ~ Conc, data = df, fct = LL.4())
#plot
plot(drm)
abline(a=112.6868 , 0)
add a comment |
try this :
library(drc)
#adjust model
drm <- drm(Response ~ Conc, data = df, fct = LL.4())
#plot
plot(drm)
abline(a=112.6868 , 0)
try this :
library(drc)
#adjust model
drm <- drm(Response ~ Conc, data = df, fct = LL.4())
#plot
plot(drm)
abline(a=112.6868 , 0)
answered Nov 16 '18 at 14:59
Jrakru56Jrakru56
597111
597111
add a comment |
add a comment |
You can extract the value of the asymptote from the drm
object:
asymptote <- coef(drm)[3]
This value can be used for plotting:
plot(drm)
abline(asymptote, 0)
add a comment |
You can extract the value of the asymptote from the drm
object:
asymptote <- coef(drm)[3]
This value can be used for plotting:
plot(drm)
abline(asymptote, 0)
add a comment |
You can extract the value of the asymptote from the drm
object:
asymptote <- coef(drm)[3]
This value can be used for plotting:
plot(drm)
abline(asymptote, 0)
You can extract the value of the asymptote from the drm
object:
asymptote <- coef(drm)[3]
This value can be used for plotting:
plot(drm)
abline(asymptote, 0)
answered Nov 16 '18 at 15:03
Sven HohensteinSven Hohenstein
65.2k1298130
65.2k1298130
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53339882%2fplot-asymptote-in-grotwth-curve-in-r%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
try
abline
witha= asymptote
andb=0
– Jrakru56
Nov 16 '18 at 14:48
Unfortunately it did not work, that is the mensagem: Error in abline(a = asymptote, b = 0) : object 'asymptote' not found
– Vitor Muller Anunciato
Nov 16 '18 at 14:57
Sorry, I was not clear. I meant assign the value of the asymptote to the parameter
a
. See below– Jrakru56
Nov 16 '18 at 15:00