[R] Resampling Stats software

Brandon Vaughn bbvaughn at bellsouth.net
Thu Dec 18 06:24:52 CET 2003


Thanks to everyone who wrote in with suggestions.  I will check out the
books mentioned.

The book I mentioned "Resampling: The New Statistics" is actually available
free online at:

http://www.resample.com/content/text/index.shtml

It seems pretty good as an introduction.  But then again, I am new at this
concept.

Does anyone know right off hand how to do simple simulation with R?  Like
for instance, in the book mentioned above, there is an example of figuring
out the probability that a company with 20 trucks with have 4 or more fail
on a given day (the probability that any given truck fails is .10).  So the
way they do it is to simulate uniform numbers from 1 to 10, and let the
number 1 represent a defective truck.  So here is the setup in the program
Resampling Stat:

	REPEAT 400   [repeat simulation 400 times]
	GENERATE 20 1,10 a  	[generate 20 numbers between 1 and 10; store
in vector a]
	COUNT a = 1 b	[count the number of 1's and store in vector b]
	SCORE b z	[keep track of each trial in vector z]
	END	[repeat process]
	COUNT z > 3 k	[count the number of times trials more than 3 and
store]
	DIVIDE k 400 kk	[convert to probability and store]
	PRINT kk	[print result]

This seems like a simple problem, and seemingly simple process in Resampling
Stats.  Any idea on how to get started doing this in R?

Thanks everyone again for your advice and help!
Brandon 

-----Original Message-----
From: Jason Turner [mailto:jasont at indigoindustrial.co.nz] 
Sent: Monday, December 15, 2003 11:13 PM
To: Brandon Vaughn
Cc: r-help at stat.math.ethz.ch
Subject: Re: [R] Resampling Stats software

Brandon Vaughn wrote:
...
> I am new to R (I have most of my experience in SAS and SPSS).  I was 
> wondering if anyone has used both Resampling Stats and R, and could 
> comment on strengths/relationships.

There are a few add-on packages for resampling with R.  "boot" is the one
I've used, and can strongly recommend.

> Also, I have no clue on how to do the various examples from the book 
> "Resampling: The New Statistics" in R.  Can anyone give me some 
> possible starting points?  Or websites/books?

I've never heard of the book you cite, but these two are good.  The first is
a pure bootstrap book, with examples in S-PLUS (the R library is rather
close).  The second is an applied stats book, which includes a section on
resampling methods.  All its examples are in S-PLUS, with notes about where
R differs (very little).

@Book{DavidsonHinkley1997,
author =	 {A. C. Davidson and D. V. Hinkley},
   title =	 {Bootstrap Methods and their Application},
   publisher =	 {Cambridge University Press},
   year =	 {1997},
}

@book{VenablesRipley2002,
   author =	 "Venables, W.R. and Ripley, B.D.",
   title =	 "Modern Applied Statistics with S",
   edition =	 "Fourth",
   publisher =	 {Springer-Verlag},
   address =	 {New York},
   year =	 2002,
}

Cheers

Jason
--
Indigo Industrial Controls Ltd.
http://www.indigoindustrial.co.nz
64-21-343-545
jasont at indigoindustrial.co.nz




More information about the R-help mailing list