A Hint for Beginners
It easy to evaluate performance any estimation procedure in simple random sampling by using a bootstrapping approaching, these codes are might be helpful for researchers (Errors or Omissions are expected).
Please write your suggestions in the comment box
# data generation ---------------------------------------------------------
set.seed(1)
mat <- matrix(c(1020.240,124.5049,446.6993,1095.8000,1087.7260,138.3125,1058.9700,
615.6715,122.3639,358.0606,640.4339,637.8649,134.6296,628.5697,397.6170,
119.5213,280.9545,406.6911,405.7635,129.8475,402.3810,261.2472,115.5645,213.2678,
264.4439,264.1202,123.3882,262.9338,167.9045,109.6790,153.3738,168.7636,168.6772,114.1812,
168.3593), nrow=5,ncol=7,byrow = TRUE)
rownames(mat) <- 1:5
colnames(mat) <- LETTERS[1:7]
# plotting settings -------------------------------------------------------
ylim <- range(mat)*c(0,1200)
angle1 <- rep(c(45,45,135), length.out=5)
angle2 <- rep(c(45,135,135), length.out=5)
density1 <- seq(5,35,length.out=5)
density2 <- seq(5,35,length.out=5)
col <- 1 # rainbow(5)
# plot --------------------------------------------------------------------
op <- par(mar=c(5,4,4,1))
barplot(mat,main="", beside=TRUE, ylim=c(0,1250), ylab="Percentage Relative Efficiency",xlab="Members of the Regression Familiy",col=col, angle=angle1, density=density1)
barplot(mat, add=TRUE, beside=TRUE, ylim=c(0,1200), col=col, angle=angle2, density=density2, ylab="Percentage Relative Efficiency",xlab="Members of the Regression Familiy")
legend("top", legend=c("r=17%","r=34%","r=50%","r=67%","r=84%"), ncol=5, fill=TRUE, col=col, angle=angle1, density=density1)
par(bg="transparent")
legend("top", legend=c("r=17%","r=34%","r=50%","r=67%","r=84%"), ncol=5, fill=TRUE, col=col, angle=angle2, density=density2)
par(op)
Thanks, Your suggestions will be appreciated
Comments
Post a Comment