我给你贴了一个例子,是面板数据的多元分析——
library(foreign)
Panel <- read.dta("http://dss.princeton.edu/training/Panel101.dta")
library(gplots)
plotmeans(y ~ country, main="Heterogeineity across countries", data=Panel)
# plotmeans draw a 95%
confidence interval
around the means
detach("package:gplots")
# Remove package ‘gplots’
from the workspace
如果还想深入的了解更多程序的内容,这里有篇文档,可以帮助理解:
http://www.princeton.edu/~otorres/Panel101R.pdf