[R] Help Me to Adjust the R Code

From: alyaa wakf <alyaawakf2002_at_yahoo.com>
Date: Fri, 25 Jan 2008 12:29:59 -0800 (PST)

   YAHOO.Shortcuts.hasSensitiveText = false; YAHOO.Shortcuts.sensitivityType = []; YAHOO.Shortcuts.doUlt = false; YAHOO.Shortcuts.location = "us"; YAHOO.Shortcuts.lang = "us"; YAHOO.Shortcuts.document_id = 0; YAHOO.Shortcuts.document_type = ""; YAHOO.Shortcuts.document_title = ""; YAHOO.Shortcuts.document_publish_date = ""; YAHOO.Shortcuts.document_author = ""; YAHOO.Shortcuts.document_url = ""; YAHOO.Shortcuts.document_tags = ""; YAHOO.Shortcuts.annotationSet = { "lw_1201292041_0": { "text": "Windows XP", "extended": 0, "startchar": 442, "endchar": 451, "start": 442, "end": 451, "extendedFrom": "", "predictedCategory": "PLACE", "predictionProbability": "0.334904", "weight": 0.35, "type": ["shortcuts:/us/class/product", "shortcuts:/us/tag/news/thing"], "category": ["CONCEPT", "THING"], "context": "Canty using R 2.6.0 on Windows XP It also works for me" }, "lw_1201292041_1": { "text": "Windows XP", "extended": 0, "startchar": 706, "endchar": 715, "start": 706, "end": 715,
 "extendedFrom": "", "predictedCategory": "OTHER", "predictionProbability": "0.423928", "weight": 0.35, "type": ["shortcuts:/us/class/product", "shortcuts:/us/tag/news/thing"], "category": ["CONCEPT", "THING"], "context": "1.2.1 and S-PLUS 2000 on Windows XP after installing the S-PLUS bootstrap" }, "lw_1201292041_2": { "text": "Egypt", "extended": 0, "startchar": 5796, "endchar": 5800, "start": 5796, "end": 5800, "extendedFrom": "", "predictedCategory": "PLACE", "predictionProbability": "0.981315", "weight": 0.35, "type": ["shortcuts:/us/instance/place/destination", "shortcuts:/us/instance/place/eg/country"], "category": ["PLACE"], "context": "Faculty of Commerce Mansoura University Egypt Be a better friend newshound", "metaData": { "geoArea": "984206", "geoCountry": "Egypt", "geoIsoCountryCode": "EG", "geoLocation": "(30.246469, 26.69636)", "geoName": "Egypt", "geoPlaceType": "Country", "type": "shortcuts:/us/instance/place/eg/country" }  }, "lw_1201292041_3": { "text":
 "Yahoo! Mobile", "extended": 0, "startchar": 5919, "endchar": 5931, "start": 5919, "end": 5931, "extendedFrom": "", "predictedCategory": "ORGANIZATION", "predictionProbability": "0.679211", "weight": 0.35, "type": ["shortcuts:/us/instance/organization/company/yahoo_property"], "category": ["ORGANIZATION"], "context": "friend newshound and know-it-all with Yahoo Mobile Try it now", "metaData": { "yprop_name": "Yahoo! Mobile", "yprop_url": "http://mobile.yahoo.com/" }  } };  YAHOO.Shortcuts.overlaySpaceId = "97546169";  YAHOO.Shortcuts.hostSpaceId = "97546168";       Hi,
   

  The following code, from Angelo Canty article on line "Resampling Methods in R: the boot Package, 2002", works fine for Angelo Canty using R 2.6.0 on Windows XP.   It also works for me using R 1.2.1 and S-PLUS 2000 on Windows XP after installing the S-PLUS bootstrap library, with slight differences in my outputs.        

> library(boot)

> library(survival)
> set.seed(12345)
> mel <- melanoma[melanoma$ulcer==1,]
> mel$cens <- 1*(mel$status==1)
> mel.cox <- coxph(Surv(time, status==1)~thickness,
  + data=mel)
> mel.surv <- survfit(mel.cox)
> mel.cens <- survfit(Surv(time-0.001*(status==1),status!=1)~1,
  + data=mel)
> mel.fun <- function(d) {

  + cox <- coxph(Surv(time, status==1)~thickness,
  + data=d)
  + cox$coefficients}

> mel.boot.con <- censboot(mel, mel.fun, R=999, sim="cond",
  + F.surv=mel.surv, G.surv=mel.cens,
  + cox=mel.cox, index=c(1,8))
> mel.boot.con
   

  CONDITIONAL BOOTSTRAP FOR CENSORED DATA Call:
censboot(data = mel, statistic = mel.fun, R = 999, F.surv = mel.surv,

    G.surv = mel.cens, sim = "cond", cox = mel.cox, index = c(1,

        8))

Bootstrap Statistics :

      original bias std. error
t1* 0.09967665 0.03579701 0.04973614    

  I want to apply the Fast bootstrap method from Salibian-Barrera and Zamar (2003) and Salibian-Barrera, M., Van Aels, S. and Willems, G. (2007) to the previous example, i.e., to produce a confidence interval for the exponent of the coefficient of tumour thickness in the Melanoma dataset . Moreover, I want to compare the performance of the Fast bootstrap with that of the classical bootstrap, which requires of course computing power and time. How I can adjust the previous code to do what I want. I asked Angelo Canty for helping me to do this, but he told me that he is afraid that he does not know anything about the Fast Bootstrap to which I refer. He suspects that one could force his boot package to do something like this but he is not sure if that would be possible through censboot or not. Although my problem does seem interesting for him, he is afraid that he is not currently in a position to take on any new collaborations. He remains available to answer any  questions about the boot package itself as it is currently written, he just does not have the time to consider including new elements into the library at this time. Salibian-Barrera and Zamar ( 2003) have studied in their paper the problem of estimating the distribution of statistics defined by estimating equations. In particular, they have considered two cases: robust regression estimates and quasi-likelihood estimates.Their approach applies in principle to the wider class of estimates defined by estimating equations. The Fast bootstrap povides an inference procedure that is notably faster than the classical bootstrap (where the estimating equations have to be fully solved for each bootstrap sample). Salibian-Barrera and Zamar simulation studies have shown that this Fast bootstrap method is more efficient and more robust to model departures. I think that the paper of Salibian-barrera and Zamar (2003) is not published till now. Now I do not have an electronic copy of  this paper draft but I have a hard copy. And so I can send you an attachment including some written sections from this paper "Fast and Stable Bootstrap Methods for Statistics Defined by Estimating Equations, Salibian-Barrera and Zamar (2003)". Please tell me If you want to send you this attachment, which can also includes what I want to do, and what I suggest.   I need the adjusted code bad. I hope you help me. If you can not help me, please guide me to anyone who can help me. Thank you in advance.    

      Alyaa Mohammad El-wakf
  Assistant Lecturer
  Department of Applied Statistics and Insurance   Faculty of Commerce
  Mansoura University
  Egypt        


        [[alternative HTML version deleted]]



R-help_at_r-project.org 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 Fri 25 Jan 2008 - 20:33:18 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 Sat 26 Jan 2008 - 00:30:08 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.

list of date sections of archive