1
遇到问题,我有以下数据:使用GGPLOT2功能stat_smooth
#means and SEs
s2humanlikem<-c(1.895,1.658,2.684,2.421,2.921,2.158,3.632,2.737,4.526,4.105)
s2humanlikese<-c(.199,.157,.250,.234,.243,.225,.197,.235,.145,.180)
s2agent<-c("Software","Software","Machine","Machine","Robot","Robot","Android","Android","Human","Human")
Story<-c("Cooperative","Self-interested")
#combine into dataframe
hri2<-data.frame(s2agent,s2humanlikem,s2humanlikese,Story)
#make numeric and factor
hri2$s2agent <- factor(hri2$s2agent, levels = c("Software","Machine", "Robot", "Android","Human"))
hri2$s2humanlikem<-as.numeric(levels(hri2$s2humanlikem))[hri2$s2humanlikem]
hri2$s2humanlikese<-as.numeric(levels(hri2$s2humanlikese))[hri2$s2humanlikese]
,我试图用下面的代码绘制:
但是你可以看到,图中的轴是不可思议的。由于某种原因,这两条线也没有对齐,我不明白为什么。任何帮助,将不胜感激。
感谢您的关注!
啊哈!我应该尝试过。非常感谢。 – smgmu 2014-10-03 15:29:46
有没有办法在这里使用se = TRUE?这个函数似乎是手动计算标准错误,但我已经在数据框中指定了它。 (误差线可以工作,但阴影区域会很好。)谢谢。 – smgmu 2014-10-03 15:39:30
不,因为每个组的每个x值只有一个观察值。您无法从一个值计算SE。 – Jaap 2014-10-03 15:54:27