Christoph,
If I may expand on Bert's suggestion...
Try this sequence of uses of rmultinom().
rmultinom(5, 1, c(.1, .2, .7))
rmultinom(5, 10, c(.1, .2, .7))
rmultinom(5, 100, c(.1, .2, .7))
Hopefully the output will help explain how rmultinom() works.
For your application, I assume you would
... and presumably the probabilities for class memberships are given
by your function of the explanatory variable. So you just plug in your
(30?) values of x, no?
-- Bert
Bert Gunter
"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
-- Clifford S
Ye gods!
R has a search function. Please learn to use it before posting here.
??multinomial
Cheers,
Bert
Bert Gunter
"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
-- Clifford Stoll
On Mon, Jun 29, 2015 at 8:23 AM, Christoph Scherber wrote
Dear Don,
True, but what I need is a sample *for a given explanatory variable*, where
class memberships are
defined in response to an underlying variable x (and known regression
parameters a, b).
Have you had a look at the code and do you see a way to modify it for rmultinom?
Thanks a lot and
See the combinat package:
combinat::rmultinomial
Generate random samples from multinomial distributions
-Don
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
On 6/29/15, 8:23 AM, "R-help on behalf of Christoph Scherber"
w
5 matches
Mail list logo