我已经弄了很久了,快疯掉了,求助各位大侠
,一下程序出现错误: 意外的'}' in "}"
library(MASS)
sink(”ch0.out”) # put output in ch0.out file
a<-scan(”data.txt”) #要先改变工作路径:从主菜单中选择“文件”(File)→“改变工作目录”(Change dir...)。
y<-a[31:60]
x<-a[1:30]
z<-lm(y~x)
summary(z)
plot(x,y) # scatter plot
plot(fitted(z),studres(z))
qqnorm(studres(z))
qqline(studres(z))
makepsfile<-function(){
ps.options(horizontal=F)
ps.options(height=4.0, width=7.5)
postscript(“ch1.ps”)
par(mfrow =c(1,3))
plot(x,y)
plot(fitted(z),studres(z))
qqnorm(studres(z))
qqline(studres(z))
dev.off()
}