[R] bootstrapping on the growth curve

Suyan Tian stian at mail.rockefeller.edu
Tue Dec 4 18:57:55 CET 2007


Hi, I am trying to get 95% CI s around a quantile growth curve, but  
my result looks strange to me.

Here is the function I defined myself

boot.qregress<-function(mat1, group,  quantile, int, seed.1){

     boot.fit<-NULL
     set.seed(seed.1)
     for (i in 1:int){

     index<-sample((unique(mat1$Subject[mat1$Group==group])), length 
(unique(mat1$Subject[mat1$Group==group])), replace=TRUE)

     #make the bootstrapping dataset
     mat.junk<-NULL
     for (j in 1: length(index)){

         mat.junk<-rbind(mat.junk, mat1[mat1$Subject==index[j], ])	
     	}

    boot.fit<-cbind(boot.fit, cobs(mat.junk$Day, mat.junk$Weight,   
constraint="none",  degree=2, tau=quantile, lambda=-1)$fitted)	
     	
    	}

    boot.fit 	

}


The curves I made from the bootstrapping is attached, I don't  
understand why for a group, the 5% curve drops suddenly around time  
130. I am thinking about missingness since before 130 there are 50  
patients, but after day 130 there are only 40 patients for this group.

Any suggestions on the R-code (especially about how to do the  
bootstrapping for the growth curves) or why the drops happened would  
be appreciated.

Thanks a lot,

Suyan
     	




More information about the R-help mailing list