yk<-rnorm(100,10,2)
zk<-rnorm(100,10,2)
yk.p<-as.factor(ifelse(yk>10,1,0))
selection<-BER(N=100,Pi=0.3,type="selec")
BER(yk=yk[selection$Ksel],Pi=0.3,type="estm",parameter="total")
BER(Pi=0.3,yk=yk[selection$Ksel],type="estm",parameter="mean")
BER(yk=yk.p[selection$Ksel],Pi=0.3,type="estm",parameter="prop")
BER(yk=yk[selection$Ksel],zk=zk[selection$Ksel],Pi=0.3,
type="estm",parameter="ratio")
# Domain Estimates
#Sex<-sample(2,100,replace=T)
Sex<-rep(1:2,each=50)
dk<-factor(Sex,labels=c("Man","Woman"))
BER(yk=yk[selection$Ksel],dk=dk[selection$Ksel],Pi=0.3,
type="estm.Ud",parameter="total")
BER(yk=yk[selection$Ksel],dk=dk[selection$Ksel],Pi=0.3,
type="estm.Ud",parameter="mean")
BER(yk=yk.p[selection$Ksel],dk=dk[selection$Ksel],Pi=0.3,
type="estm.Ud",parameter="prop")
BER(yk=yk[selection$Ksel],zk=zk[selection$Ksel],
dk=dk[selection$Ksel],Pi=0.3,type="estm.Ud",parameter="ratio")
Run the code above in your browser using DataLab