Displaying 1 result from an estimated 1 matches for "samp2_n".
Did you mean:
samp1_n
2009 Nov 09
0
how to stop a loop in a sampling
...leg2_n<-length(data2_n$areaid)
if (leg1_n=1) merge(data1_n,data2_n,by.x="areaid",by.y="areaid") else
{
#leg1_n=1>=2
#leg1_1=2 and leg2_1=4 for areaid=1
set.seed(1000)
samp1_n<-sample(c(1:leg1_n),1, replace = FALSE)
data1_n_samp1<-data1_n[samp1_n,]
samp2_n<-sample(c(1:leg2_n),2, replace = FALSE)
data2_n_samp2<-data2_n[samp2_n,]
merge(data1_n_samp1,data2_n_samp2,by.x="areaid",by.y="areaid")
#need to continue to sample from the remained records in data1_n and
data2_n??????????
#some criteria to stop the sampling maybe...