Hello there, I have a problem concerning bootstrapping in R - especially focusing on the resampling part of it. I try to sum it up in a simplified way so that I would not confuse anybody.
I have a small database consisting of 20 observations (basically numbers from 1 to 20, I mean: 1, 2, 3, 4, 5, ... 18, 19, 20). I would like to resample this database many times for the bootstrap process with the following two conditions. The resampled databases should also have 20 observations and you can select each of the previously mentioned 20 numbers with replacement. I guess it is obvious so far. Now the more difficult second condition is that one number can be selected only maximum 5 times. In order to make this clear I try to show you an example. So there can be resampled databases like the following ones: (1st database) 1,2,1,2,1,2,1,2,1,2,3,3,3,3,3,4,4,4,4,4 (4 different numbers are chosen, each selected 5 times) (2nd database) 1,8,8,6,8,8,8,2,3,4,5,6,6,6,6,7,19,1,1,1 (Two numbers - 8 and 6 - selected 5 times, number "1" selected four times, the others selected less than 4 times) My very first guess that came to my mind whilst thinking about the problem was the sample function where there are settings like replace=TRUE and prob=... where you can create a probability vector i.e. how much should be the probability of selecting a number. So I tried to calculate probabilities first. I thought the problem can basically described as a k-combination with repetitions. Unfortunately the only thing I could calculate so far is the total number of all possible selections which amounts to 137 846 527 049. Anybody knows how to implement my second "tricky" condition into one of the R functions? Are 'boot' and 'bootstrap' packages capable of managing this? I guess they are, I just couldn't figure it out yet... Thanks very much! Best regards, Laszlo Bodnar ____________________________________________________________________________________________________ Ez az e-mail és az összes hozzá tartozó csatolt melléklet titkos és/vagy jogilag, szakmailag vagy más módon védett információt tartalmazhat. Amennyiben nem Ãn a levél cÃmzettje akkor a levél tartalmának közlése, reprodukálása, másolása, vagy egyéb más úton történÅ terjesztése, felhasználása szigorúan tilos. Amennyiben tévedésbÅl kapta meg ezt az üzenetet kérjük azonnal értesÃtse az üzenet küldÅjét. Az Erste Bank Hungary Zrt. (EBH) nem vállal felelÅsséget az információ teljes és pontos - cÃmzett(ek)hez történÅ - eljuttatásáért, valamint semmilyen késésért, kapcsolat megszakadásból eredÅ hibáért, vagy az információ felhasználásából vagy annak megbÃzhatatlanságából eredÅ kárért. Az üzenetek EBH-n kÃvüli küldÅje vagy cÃmzettje tudomásul veszi és hozzájárul, hogy az üzenetekhez más banki alkalmazott is hozzáférhet az EBH folytonos munkamenetének biztosÃtása érdekében. This e-mail and any attached files are confidential and/...{{dropped:19}}
______________________________________________ R-help@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.