# Test for power transformation fla<-read.table('fldat1.txt',header=T,row.names=NULL) attach(fla) tvot<-bush+gore+brow+nade+harr+hage+mcre+phil+moor pbush<-100*bush/tvot pgore<-100*gore/tvot pbrow<-100*brow/tvot pnade<-100*nade/tvot pbuch<-100*buch/tvot inco<-inco/1000 u<-c(1:49,51:67) lpop<-log(npop) lblac<-log(blac) lhisp<-log(hisp) #xvar1<-cbind(lpop,whit,lhisp,hsed,inco,pbush) xvar1<-cbind(lpop,whit,lhisp,hsed,inco,pbush,pbrow) ydot<-exp(mean(log(buch))) lam<-0.01*(1:100) rss<-rep(0,100) for(i in 1:100){ y<-ydot^(1-lam[i])*buch^lam[i]/lam[i] xvar2<-xvar1*tvot^lam[i] nreg<-lm(y~xvar2,subset=u) rss[i]<-60*(summary(nreg)$sigma)^2/10000 } postscript(file='fl6.ps',horizo=F) par(mfrow=c(2,1),bty='l',las=1,oma=c(0,0,0,0)) plot(lam,rss,type='l',xlab='Lambda',ylab='Rescaled RSS (/10000)') #mtext(' Gain Functions of Various Filters', #line=1,side=3,cex=1.5,outer=T) dev.off()