繁体   English   中英

用于 gls 的 Abline 不会 plot

[英]Abline for gls won't plot

我正在尝试使用回归线 plot 下面的 model ,我可以生成 plot 但我尝试过的所有 abline 命令似乎都不起作用(也在下面)。 R 似乎很高兴,而不是 output 我尝试的第一个 abline 命令出现任何错误消息,但 plot 上不会出现任何行。 我也尝试将 abline function 添加到 plot 代码本身中,但这也不起作用。 任何帮助,将不胜感激。

model2<-gls(transformedlongevity~transformedproportion, data=independencedata, 
            correlation=corPagel(1,trimtree))
summary(model2)
plot(model2, xlab= "Transformed Value of Proportion of Life Spent Under Parental Care (Years)", 
     ylab="Transformed Value of Maximum Life Span (Years)", 
     main= "Time Spent Under Parental Care Relative 
     to Longevity of Passerine Species")


abline(gls(transformedproportion~transformedlongevity, independencedata), untf=T)
abline(a=0, b=coef(model2)) 
abline(coef(model2)) 

请包括在您的帖子中使用的 package。 因此,如果您的gls来自nlme ,那么您看到的 plot 是残差,而不是预测值。 使用来自 nlme 的示例集:

library(nlme)
fm1 <- gls(follicles ~ Time, Ovary,
            correlation = corAR1(form = ~ 1 | Mare))
plot(fm1)

在此处输入图像描述

所以拟合线在这里没有意义。 您最有可能想要这样做:

plot(Ovary$Time,Ovary$follicles)
abline(fm1,col="blue")

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM