首页 文章

如何绘制模型drc包?

提问于
浏览
0

脚本:

lettuce

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

summary(m0)

modelFit(m0)

plot(m0)

我想知道如何在轴 x 中绘制 conc 的确切值及其在 y 中的对应值以及如何绘制( ) .

1 回答

  • 0

    我正在尽力解决这个问题,但是假设这个问题可能是由于用户界面存在困难而未说明的问题,以及尽管我在评论中付出了努力但尚未澄清的术语 . 我假设这是一个用R ^ 2值注释drc图的请求 . plot.drc函数是一个基本的图形函数,因此默认情况下将绘制到交互式设备,并且似乎在我的机器(Mac)上执行此操作,这不会始终将quartz() - 设备窗口置于其前面 . 查看图层 . 需要使用下拉菜单将其拉到最前面 .

    我(现在)将在代码中演示如何a)计算R ^ 2和b)在png() - 设备上注释基本图形图形 .

    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

相关问题