【发布时间】:2021-08-25 21:16:47
【问题描述】:
我发现了这篇关于这个主题的帖子,并且能够像帖子所说的那样将其导出: Can I export the result from a loess regression out of R?
但是,正如该帖子中海报的最后一条评论所说,我没有得到我的 LOESS 线的结果。有没有人对如何让它正确导出有任何见解?
谢谢!
我的导出代码在这里:
#loess object
CL111_loess <- loess(dur_cleaned~TS_LightOn, data = CL111)
#get SE
CL111_predict <- predict(CL111_loess, se=T)
CL111_ouput <- data.frame("fitted" = CL111_predict$fit, "SE"=CL111_predict$se.fit)
write.csv(CL111_ouput, "CL111_output.csv")
原始图的数据是here:
我的原始情节的代码在这里:
{r}
#individual plot
ggplot(data = CL111) + geom_smooth(mapping = aes(x = TS_LightOn, y = dur_cleaned), method = "lm", se = FALSE, colour = "Green") +
labs(x = "TS Light On (Seconsd)", y = "TS Response Time (Seconds)", title = "Layout 1, Condition AO, INS High") +
theme(plot.title = element_text(hjust = 0.5)) +
stat_smooth(mapping = aes(x = TS_LightOn, y = dur_cleaned), method = "loess", se = TRUE) + xlim(0, 400) + ylim (0, 1.0)
#find coefficients for best fit line
lm(CL111_LM$dur_cleaned ~ CL111_LM$TS_LightOn)
【问题讨论】: