[R] bootstrapping

David Winsemius dwinsemius at comcast.net
Wed Jan 20 16:34:20 CET 2010


On Jan 20, 2010, at 10:23 AM, <aaron.foley at students.tamuk.edu> <aaron.foley at students.tamuk.edu 
 > wrote:

>
> Hello,
>
>
>
> I was able to bootstrap 1000 times, 20 times (20 columns of 1000  
> values).  Is there a way to get mean for each column?
>

?colMeans

>
>
> Thanks!
>
>
>
> Aaron
>
>
>
>
>> Date: Sat, 16 Jan 2010 00:04:59 +0100
>> From: Stephan.Kolassa at gmx.de
>> To: aaron.foley at students.tamuk.edu
>> CC: r-help at r-project.org
>> Subject: Re: [R] bootstrapping
>>
>> Hi Aaron,
>>
>> try the argument "statistic=mean". Then boot() will give you the mean
>> turn angle in your actual data (which appears to be 6 degrees,  
>> judging
>> from what you write), as well as the means of the bootstrapped data.
>> Then you can get (nonparametric) bootstrap CIs by
>> quantile(boot$t,probs=c(.025,.975)). As far as I can see, there is
>> really no need to look at sd().
>>
>> A more interesting question would be how to deal with the fact that
>> -180=+180, there may be something to think about here...
>>
>> HTH,
>> Stephan
>>
>>
>> aaron.foley at students.tamuk.edu schrieb:
>>> Hi All,
>>>
>>>
>>>
>>> I'm new to R so please bear with me. I have a dataset with 337  
>>> turn angles ranging from -180 to 180 degrees. I need to bootstrap  
>>> (sample with replacement) 1,000 times to create expected average  
>>> turn angle with 95% CIs. The code is pretty straightforward (<- 
>>> boot(data =, statistic = ,R =)) but I am unsure how to input my  
>>> observed mean (6 degrees) and standard deviation (66 degrees) into  
>>> the statistic component. I realize there is a 'function' code but  
>>> I can't seem to carry the results over to the 'boot' code.
>>>
>>>
>>>
>>> Thanks,
>>>
>>> Aaron M. Foley
>>> PhD Candidate
>>> Caesar Kleberg Wildlife Research Institute
>>> Texas A&M University - Kingsville
>>> Cousins Hall, Room 201
>>> Kingsville, TX 78363
>>>
>>>
>>>
>>>
>>> [[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.
>>>
>>
> 		 	   		
> 	[[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.

David Winsemius, MD
Heritage Laboratories
West Hartford, CT



More information about the R-help mailing list