0

Script:

lettuce

m0<-drm(weight~conc, data = lettuce, fct = LL.3())

summary(m0)

modelFit(m0)

plot(m0)

I want to know how to plot the exact value of conc in the axis x with their corresponding value in y and how to plot the ().

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • Not sure what the "exact value of conc" might be, but the `plot,drc` function _does_ plot the weights versus conc values for the data and the estimated weight curve. Perhaps you're using an IDE (such as R,app on a Mac) where the interactive graphics device does not put the graphics window "in front" automatically. You need to be clear what "plotting the R^2" might mean. (probably means "annotate the plot" in which case this is undoubtedly a duplicate in which case you should search.) – IRTFM Jan 09 '18 at 17:19
  • The r² is the Coefficient of Determination. – Vitor Muller Anunciato Jan 10 '18 at 17:14

1 Answers1

0

I'm taking my best shot at this question, but it is under the assumption that the question may be the result of difficulties with a user interface that was unstated and terminology that has not been clarified despite my efforts in comments. I'm assuming this was a request to annotate a drc plot with an R^2 value. The plot.drc function is a base graphics function, so will plot to the interactive device by default and appears to do so on my machine (a Mac), which will not always bring the quartz()-device window to the fore of the viewing layers. It needed to be pulled to the fore by using the dropdown menu.

I'm (now) going to demonstrate in code how to a) calculate an R^2 and b) annotate a base graphics graphic on a png()-device.

png()      # opens file for graphics output
plot(m0)   # will need dev.off() to complete output
cor( fitted(m0), lettuce$weight) ^2  # calculation of R^2
# [1] 0.8143727 # output to interactive console
text( x=20, y=1.2, labels= bquote(R^2 == .(cor( fitted(m0), lettuce$weight) ^2) ) )
dev.off()

enter image description here

IRTFM
  • 258,963
  • 21
  • 364
  • 487