Re: [R] Custom sampling method in R XXXX

2014-06-24 Thread Dan Abner
>> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] >> On Behalf Of Dan Abner >> Sent: Monday, June 23, 2014 3:19 PM >> To: Greg Snow >> Cc: r-help@r-project.org >> Subject: Re: [R] Custom sampling method in R >> >> Hi Greg, &

Re: [R] Custom sampling method in R XXXX

2014-06-23 Thread Daniel Nordlund
roject.org > Subject: Re: [R] Custom sampling method in R > > Hi Greg, > > Thanks, this makes sense. I can envision the call to the sample fn > like you are discribing. Any ideas on how to construct the vector? I > still am unclear about that. > > Thanks, > >

Re: [R] Custom sampling method in R XXXX

2014-06-23 Thread Dan Abner
Hi Greg, Thanks, this makes sense. I can envision the call to the sample fn like you are discribing. Any ideas on how to construct the vector? I still am unclear about that. Thanks, Dan On Mon, Jun 23, 2014 at 5:26 PM, Greg Snow <538...@gmail.com> wrote: > The sample function can be used to sam

Re: [R] Custom sampling method in R XXXX

2014-06-23 Thread Greg Snow
The sample function can be used to sample discrete values with designated probabilities. I would just construct your list of 5 values based on the selected value (duplicating end values if needed, so a choice of x=0 would be the vector c(0,0,0, 0.125, 0.25) ), then sample from this vector with the

[R] Custom sampling method in R XXXX

2014-06-23 Thread Dan Abner
Hi all, I have the following situation and a good efficient way to perform this operation in R has not come to me. Any suggestions/input are welcome. I have a user-defined parameter (let's call it x) whose value is selected from a set of possible values (j). Once the user selects one of the valu