[R] getting the normal dist from the chisqr with 1df

From: raymond chiruka <rtchiruka_at_yahoo.com>
Date: Thu, 10 May 2007 04:33:07 -0700 (PDT)


l used the following code to generate a sample and then calculated then did a log rank test.can l get the normal version of the logrank eg sqrt of the chisqr(1) will give you the N~(0,1).   from my sample can i use the above expression to get the normal dist from the result of the log rank test.   thank   

      s=1
       while(s!=0){ n=100
         m<-matrix(nrow=n,ncol=4)
         colnames(m)=c("treatmentgrp","strata","censoringTime","survivalTime")                  
        for(i in 1:n)  m[i,]<-c(sample(c(1,2),1,replace=TRUE),sample(c(1,2),1,replace=TRUE),rexp(1,0.07),rexp(1,0.02))                                                                    
      m<-cbind(m,0)
        m[m[,3]>m[,4],5]<-1
         colnames(m)[5]<-"censoring"
      

act.surv.time<-pmin(m[,"censoringTime"],m[,"survivalTime"])   

m<-cbind(m,act.surv.time)

      print(m)
      write.table(m,”clipboard”,sep=”\t”,col.names=NA)
      print(“.................”)
      print(“the logrank test”)
      b=data.frame(m)
      c=  survdiff(Surv(act.surv.time,censoring)~treatmentgrp,data=b)
      print(c)
      s=s-1
      print(“...............................................................”)
      }
    

       
---------------------------------


	[[alternative HTML version deleted]]



______________________________________________

R-help_at_stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu 10 May 2007 - 11:38:04 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 10 May 2007 - 12:31:15 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.