RE: S-plus code and data arrangement

From: Mouksassi Mohamad-Samer Date: August 23, 2007 technical Source: mail-archive.com
Hi Zheng, You should modify your code to prevent it. A hint : try to test if the current sampled individual is different from the previous one or not : if yes modify it... sample code follows : temp.id<- sample(unique(tab$ID), replace=T) # c(1,2,3,4,6,5,6) # temp.data<-NULL while(length(temp.id)>0) { if (temp.id[length(temp.id)]==temp.id[1]) temp.id[length(temp.id)]<- temp.id[length(temp.id)]+1000 temp.data<-rbind(temp.data,tab[tab$ID%in%temp.id,]) temp.id<-temp.id[duplicated(temp.id)] }}) Cheers. Samer
Quoted reply history
-----Original Message----- From: [EMAIL PROTECTED] on behalf of Zheng Lu Sent: Thu 23/08/2007 11:50 To: [email protected] Subject: [NMusers] S-plus code and data arrangement Dear All: When I apply sample()in S-plus to do for example, bootstrapping, let's say we have four patients(patient ID is 1,2,3,4), one of the results can be 4,4,4,4, how can I do to make NONMEM treat this result as four patients, not just one patient. Do I need do something with data arrangement or some other functions in S-plus can deal with this. Any instructions will be highly appreciated. Zheng
Aug 23, 2007 Zheng Lu S-plus code and data arrangement
Aug 23, 2007 Mouksassi Mohamad-Samer RE: S-plus code and data arrangement
Aug 23, 2007 Liviawati Sutjandra RE: S-plus code and data arrangement