Re: [R] Separating boot results

From: Patrick Santoso <patrick.santoso_at_gmail.com>
Date: Thu, 19 May 2011 15:08:14 -0400

Thanks for the suggestion Jorge!

Pat
On Thu, May 19, 2011 at 2:12 PM, Jorge Ivan Velez <jorgeivanvelez_at_gmail.com>wrote:

> Hi Patrick,
>
> How about this (untested)?
>
> a <- codboot[c(4)]
> round(a$bca[4, 5], 2)
>
> HTH,
> Jorge
>
>
> On Thu, May 19, 2011 at 7:20 AM, Patrick Santoso <> wrote:
>
>> Good Morning,
>>
>> I'm having what I hope to be a simple problem. I am generating bootstrap
>> confidence intervals using package (boot) - which works perfectly. The
>> issue
>> I am having is getting the results into a format which I can write out to
>> a
>> database. To be clear I am having no problems generating the results, I
>> just
>> need to convert the format of the results such that I can store the
>> results
>> in a dataframe to save out to a database.
>>
>> I am doing the following:
>>
>> ## Generate 20,000 bootstrap samples
>> cod.boot <- boot(trimmed$ratio, cod, R=20000)
>>
>> ## generate 90% BCA boostrap confidence intervals
>> codboot <- boot.ci(cod.boot,conf = c(0.90), type= c("bca"))
>>
>> At this point I have stored the answer I want to the variable codboot, but
>> the problem is it is in the format as follows:
>>
>> BOOTSTRAP CONFIDENCE INTERVAL CALCULATIONS
>> Based on 20000 bootstrap replicates
>>
>> CALL :
>> boot.ci(boot.out = cod.boot, conf = c(0.9), type = c("bca"))
>>
>> Intervals :
>> Level BCa
>> 90% ( 6.10, 10.23 )
>> Calculations and Intervals on Original Scale
>>
>> What I would like is the 6.10, and 10.23 each stored in their own
>> variables
>> so I can combine them into my existing dataframe (using cbind). The best
>> I've been able to do so far is:
>>
>> a <- codboot[c(4)]
>>
>> which gives me a:
>>
>> $bca
>> conf
>> [1,] 0.9 2343.41 19683.87 6.099788 10.23007
>>
>> which is closer, but I cannot parse this variable enough to get the 6.10
>> and
>> 10.23 out since apparently strsplit doesn't allow splitting on spaces.
>>
>> Any help would be greatly appreciated!
>>
>> Best Regards & Thank You in Advance
>>
>> Patrick
>>
>>
>>
>>
>>
>> --
>>
>> Patrick Santoso
>>
>> University of New Hampshire
>>
>> [[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.
>>
>
>

-- 

Patrick Santoso

603 969 4673

	[[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 Thu 19 May 2011 - 22:16:41 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

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 19 May 2011 - 22:20: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