Re: [R] Bootstrapping in R

2016-10-19 Thread Bryan Mac
Hi, After running the bootstrapping, I would like to the output of the bootstrapped samples. How can I view the bootstrapped samples of each variable? Bryan Mac bryanmac...@gmail.com > On Oct 18, 2016, at 3:57 AM, Rui Barradas wrote: > > It means that the sd of the bootstrap samples is 0.21

Re: [R] Bootstrapping in R

2016-10-03 Thread ruipbarradas
Hello, I've just ran your code and it all went well. So my doubt is: if you have 1269 rows why choose only 100 and bootstrap? It doesn't seem to make much sense to me. Try to run the entire df through DataSummary  and compare the results with the bootstrap results. Rui Barradas   Citando Bry

Re: [R] Bootstrapping in R

2016-10-03 Thread Bryan Mac
Hi all, Here is the first six rows of my data. In total I have 1269 rows. My goal is to get conduct nonparametric bootstrap and case resampling. I would like to randomly select 100 out of the 1269 After that, I wish to bootstrap that randomly selected 100 out of 1269. I assume I need to set t

Re: [R] Bootstrapping in R

2016-10-02 Thread ruipbarradas
Right. To see it in action just compare the results of the two calls to boot. library(boot) set.seed(1007) x <- rnorm(100) y <- x + rnorm(100) dat <- data.frame(x, y) #Wrong stat1 <- function(DF, f){ model <- lm(DF$y ~ DF$x, data = DF[f,]) #Doesn't bootstrap DF coef(model) }

Re: [R] Bootstrapping in R

2016-10-02 Thread peter dalgaard
> On 01 Oct 2016, at 16:11 , Daniel Nordlund wrote: > > You haven't told us anything about the structure of your data, or the > definition of the DataSummary function. Yes. Just let me add that a common error with boot() is not to pay attention to the required form of the statistic= function

Re: [R] Bootstrapping in R

2016-10-01 Thread Christoph Puschmann
Dear Rui, You can insert a “formula” argument in the code. For example, if you boot a regression, you can insert the formula in the command. Though I just realised that it is not necessary to do. All the best, Christoph > On 1 Oct 2016, at 19:49, ruipbarra...@sapo.pt wrote: > > Sorry, but w

Re: [R] Bootstrapping in R

2016-10-01 Thread ruipbarradas
Sorry, but what formula? formula is not a ?boot argument. To the OP: Michael is probably right, if you reset the seed each time, you'll get equal values, otherwise you should get different results due to randomization. Rui Barradas Quoting Christoph Puschmann : Dear Bryan, Did you try t

Re: [R] Bootstrapping in R

2016-10-01 Thread Christoph Puschmann
Dear Bryan, Did you try to include formula in the boot command? like: results <- boot(data, statistic, R, formula) All the best, Christoph > On 1 Oct 2016, at 19:24, Michael Dewey wrote: > > Dear Bryan > > You are not resetting the seed each time by any chance? > > Michael > > On 01/10/

Re: [R] Bootstrapping in R

2016-10-01 Thread Daniel Nordlund
On 9/30/2016 6:44 PM, Bryan Mac wrote: Hi, I have read the help page and it was helpful but, I am having concerns because each time I run this code I get the same value. I expected that each time I run the code, I will get different values due to random sampling. How do I get this randomizati

Re: [R] Bootstrapping in R

2016-10-01 Thread Michael Dewey
Dear Bryan You are not resetting the seed each time by any chance? Michael On 01/10/2016 02:44, Bryan Mac wrote: Hi, I have read the help page and it was helpful but, I am having concerns because each time I run this code I get the same value. I expected that each time I run the code, I will

Re: [R] Bootstrapping in R

2016-09-30 Thread Bryan Mac
Hi, I have read the help page and it was helpful but, I am having concerns because each time I run this code I get the same value. I expected that each time I run the code, I will get different values due to random sampling. How do I get this randomization? The values shouldn’t be the same eac

Re: [R] Bootstrapping in R

2016-09-29 Thread ruipbarradas
Hello, Read the help page ?boot::boot. For instance, try the following. library(boot) x <- rnorm(100) stat <- function(x, f) mean(x[f]) boot(x, stat, R = 100) Hope this helps, Rui Barradas Citando bryan.mac24 : Hi all, I am wondering how to conduct bootstrapping in R. I need bootstrap

Re: [R] Bootstrapping in R

2013-04-25 Thread David Carlson
landt Sent: Thursday, April 25, 2013 4:36 AM To: Preetam Pal Cc: r-help@r-project.org Subject: Re: [R] Bootstrapping in R On Apr 25, 2013, at 7:02, Preetam Pal wrote: > Hi all, > > 1>i have 3 vectors a,b and c, each of length 25... i want to > 1>define a > new data fra

Re: [R] Bootstrapping in R

2013-04-25 Thread Michael Weylandt
On Apr 25, 2013, at 7:02, Preetam Pal wrote: > Hi all, > > 1>i have 3 vectors a,b and c, each of length 25... i want to define a > new data frame z such that z[1] = (a[1] b[1] c[1]), z[2] = (a[2] b[2] c[2]) > and so on...how do i do it in R > z <- data.frame(a, b, c) > > 2> Then i wan

Re: [R] Bootstrapping in R

2009-12-09 Thread David Winsemius
On Dec 9, 2009, at 9:05 AM, Trafim Vanishek wrote: I missed number of bootstrap replicates R boot(Reg, bootcoeff, R=10) but still it doesn't work Error in statistic(data, original, ...) : unused argument(s) (original) On Wed, Dec 9, 2009 at 2:46 PM, Trafim Vanishek wrote: Dear all,

Re: [R] Bootstrapping in R

2009-12-09 Thread Trafim Vanishek
I missed number of bootstrap replicates R boot(Reg, bootcoeff, R=10) but still it doesn't work Error in statistic(data, original, ...) : unused argument(s) (original) On Wed, Dec 9, 2009 at 2:46 PM, Trafim Vanishek wrote: > Dear all, > > I have some error trying to bootstrap from a matrix. The