rm(list=ls())
setwd("/Users/innoshuadmin/Dropbox/RDHeteroTest/RDMonoTest/simulationR2/mktable")
require(stargazer) 

nmodel=4
modelvec=c(0,nmodel,nmodel*2)
smvec=1:3
panel<-c("A","B","C")
for (ind in 1:3){
	load(paste("SRDpanel",panel[ind],"_model1.RData",sep=""))
	rej_DGP1<-cbind(rejincprop_ks[modelvec+1,smvec],rejdecprop_ks[modelvec+1,smvec],rejincprop_ks_gms[modelvec+1,smvec],rejdecprop_ks_gms[modelvec+1,smvec])
	load(paste("SRDpanel",panel[ind],"_model2.RData",sep=""))
	rej_DGP2<-cbind(rejincprop_ks[modelvec+2,smvec],rejdecprop_ks[modelvec+2,smvec],rejincprop_ks_gms[modelvec+2,smvec],rejdecprop_ks_gms[modelvec+2,smvec])
	load(paste("SRDpanel",panel[ind],"_model3.RData",sep=""))
	rej_DGP3<-cbind(rejincprop_ks[modelvec+3,smvec],rejdecprop_ks[modelvec+3,smvec],rejincprop_ks_gms[modelvec+3,smvec],rejdecprop_ks_gms[modelvec+3,smvec])
	load(paste("SRDpanel",panel[ind],"_model4.RData",sep=""))
	rej_DGP4<-cbind(rejincprop_ks[modelvec+4,smvec],rejdecprop_ks[modelvec+4,smvec],rejincprop_ks_gms[modelvec+4,smvec],rejdecprop_ks_gms[modelvec+4,smvec])	
	rej=rbind(rej_DGP1,rej_DGP2,rej_DGP3,rej_DGP4)
	rownames(rej) <- c("n=2000","n=4000","n=8000","n=2000","n=4000","n=8000","n=2000","n=4000","n=8000","n=2000","n=4000","n=8000")
stargazer(rej,digits=3,out = paste("simutable13",panel[ind],".tex",sep="")) 
}
