Skip to content
Back to formatted view

Raw Message

Message-ID: <Pine.LNX.4.61.0503111610190.3043@stat12.stat.auckland.ac.nz>
Date: 2005-03-11T03:13:01Z
From: David Scott
Subject: sample function
In-Reply-To: <BAY10-F303206AF04A6B0EE46602FC7530@phx.gbl>

On Thu, 10 Mar 2005, mirage sell wrote:

> Hi everyone, I need help.
> I want to have a "uniform" kind distribution. When I used sample function I 
> got almost twice many zeros compared to other numbers. What's wrong with my 
> command ?
>

Nothing is wrong with your sampling, it is the display in the histogram.

Try
temp <-sample(0:12, 2000, replace=T,prob=(rep(1/13,13)))
table(temp)

David Scott

_________________________________________________________________
David Scott	Department of Statistics, Tamaki Campus
 		The University of Auckland, PB 92019
 		Auckland	NEW ZEALAND
Phone: +64 9 373 7599 ext 86830		Fax: +64 9 373 7000
Email:	d.scott at auckland.ac.nz


Graduate Officer, Department of Statistics