+ Reply to Thread
Results 1 to 5 of 5

Random sampling multiple times from dataset

Hybrid View

  1. #1
    Registered User
    Join Date
    04-13-2022
    Location
    New Zealand
    MS-Off Ver
    2019
    Posts
    3

    Random sampling multiple times from dataset

    Hi there,

    I am currently trying to assess how small a sample of fruit size can be while still returning a value close enough to the true mean fruit size. I have a multiple datasets with 100 measurements in each. For each of these datasets I want to resample 30 times for n=10, n=20, n=50.... and so on. I don't need to see the values for the 30 resamples, I just want the 30 means, one from each resample. With these, I can assess the variation between them to decide on the smallest sample size with an acceptable amount of error.

    What I would like to do would be to automate or speed up the random resampling from the n=100 dataset. I've tried multiple approaches (using random numbers and the sampling tool in data analysis), but when repeating 30 times and for various n= resamples, it is still very time consuming.

    Any advice would be appreciated.

    Cheers.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,403

    Re: Random sampling multiple times from dataset

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, relevant cells highlighted and a few explanatory notes.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    04-13-2022
    Location
    New Zealand
    MS-Off Ver
    2019
    Posts
    3

    Re: Random sampling multiple times from dataset

    Hi,

    Sorry about that. I have attached an example which contains a sheet with the raw data ("data") and a sheet with my manual resampling results ("n=10 resamp").

    What I have done is repeatedly sort the data sheet by the random number column (A) and then sample the first ten data points the table and paste the mean as a value into the corresponding column in the n=10 resamp sheet.

    Hopefully that is sufficient to give some context to my query.

    Cheers.
    Attached Files Attached Files

  4. #4
    Forum Contributor John Vergara's Avatar
    Join Date
    01-17-2022
    Location
    Colombia
    MS-Off Ver
    365
    Posts
    206

    Re: Random sampling multiple times from dataset

    Hi alex_hoek (and AliGW)!

    Check the file with two options. One with Microsoft 365 formulas, and another with UDF (User Defined Function) programmed with VBA.

    Blessings!
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-13-2022
    Location
    New Zealand
    MS-Off Ver
    2019
    Posts
    3

    Re: Random sampling multiple times from dataset

    Thanks a lot for that. Much easier than the manual approach I was using.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Random Sampling using vba. Please help me
    By jathind in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-09-2015, 03:29 PM
  2. Random Sampling - please help
    By zakajam1980 in forum Excel General
    Replies: 4
    Last Post: 08-03-2013, 01:31 AM
  3. Random Sampling with no Replacements
    By kitty425 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-15-2013, 01:04 AM
  4. Help with random sampling, please.
    By tjroby in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-07-2013, 01:31 PM
  5. Auto Random Sampling
    By rpanuganti in forum Excel General
    Replies: 0
    Last Post: 05-02-2013, 05:51 AM
  6. Copying a dataset multiple times - and selecting titles for this dataset
    By alocke in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-07-2012, 10:15 PM
  7. Random Sampling
    By orangeIV in forum Excel General
    Replies: 2
    Last Post: 03-26-2007, 11:59 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1