+ Reply to Thread
Results 1 to 3 of 3

Thread: Bootstrap and hypothesis test

  1. #1
    TS Contributor
    Points: 12,227, Level: 72
    Level completed: 45%, Points required for next Level: 223
    rogojel's Avatar
    Location
    I work in Europe, live in Hungary
    Posts
    1,470
    Thanks
    160
    Thanked 332 Times in 312 Posts

    Bootstrap and hypothesis test




    Hi,
    I have to decide whether two groups have the same variance or not. My sample size is less then impressive, 13 data points per group. I ran Bartletts test and got a p-value of 0.09 - but I suspected that the relatively high value might be due to the small sample size.

    So, I ran a bootstrap - sampled with replacement 15 points per group and ran the Bartlett test 100 times. I get a p value that is lower then 0.05 in 50% of the runs.

    Could I conclude that probably there is a systematic difference between the two groups?

    regards

  2. #2
    TS Contributor
    Points: 40,089, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Awards:
    Downloads
    gianmarco's Avatar
    Location
    Italy
    Posts
    1,367
    Thanks
    232
    Thanked 301 Times in 225 Posts

    Re: Bootstrap and hypothesis test

    Maybe I am wrong....I had just 5 minutes to play around with some R code....
    I was thinking about calculating the permuted distribution of the difference between the two samples' standard deviations.
    The distribution will be centered about 0, and then you should gauge where your observed difference lies.

    Example, with two samples draw from a normal distribution with differet mean AND with different standard deviations:
    Code: 
    a <- rnorm(100, 10,5)
    b <- rnorm(100,20,3)
    pooledData <- c(a, b)
    size.sample1 <- length(a)
    size.sample2 <- length(b)
    size.pooled <- size.sample1+size.sample2
    nIter <- 1000
    stDiff <- numeric(nIter+1)
    stDiff[1] <- sd(a)-sd(b)
    for(i in 2:length(stDiff)){
      index <- sample(1:size.pooled, size=size.sample1, replace=F)
      sample1.perm <- pooledData[index]
      sample2.perm <- pooledData[-index]
      stDiff[i] <- sd(sample1.perm) - sd(sample2.perm)
    }
    p.value <- round(mean(abs(stDiff) >= abs(stDiff[1])), digits=4)
    p.value
    plot(density(stDiff))
    abline(v=stDiff[1], lty=2, col="red")
    http://cainarchaeology.weebly.com/

  3. #3
    Omega Contributor
    Points: 38,303, Level: 100
    Level completed: 0%, Points required for next Level: 0
    hlsmith's Avatar
    Location
    Not Ames, IA
    Posts
    6,993
    Thanks
    397
    Thanked 1,185 Times in 1,146 Posts

    Re: Bootstrap and hypothesis test


    rogojel, I may wonder what type of results you get when using n=13 in your bootstrap? Also, what does the empirical distributions of the two groups look like, can you post that as well?
    Stop cowardice, ban guns!

+ Reply to Thread

           




Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts






Advertise on Talk Stats