The mean of a normal distribution is equal to the median.
The upper quartile falls at z = qnorm(0.75) on a standard normal distribution
(mean=0, sd=1), thus you can calculate yoursd = z * (yourupperquartile -
yourmedian).
yoursd <- qnorm(0.75) * (yourupperquartile - yourmedian)
x <- rnorm(100, yourmedian, yoursd)
----- Original Message -----
From: "Dr. Takashi Kikuchi" <mhs208@bangor.ac.uk>
To: <s-news@lists.biostat.wustl.edu>
Sent: Thursday, May 04, 2006 4:02 PM
Subject: [S] Generate random numbers knowing median and
inter-quartiles only
> Dear S-Plus users
>
> Dose anyone have S-plus codes to generate random numbers knowing
> median and inter-quartiles only. Let's assume a normal distribution
> for the samples.
>
> Regards,
>
> Takashi
>
>
> --
> mhs208@bangor.ac.uk
>
>
> --
> Gall y neges e-bost hon, ac unrhyw atodiadau a anfonwyd gyda hi,
> gynnwys deunydd cyfrinachol ac wedi eu bwriadu i'w defnyddio'n unig
> gan y sawl y cawsant eu cyfeirio ato (atynt). Os ydych wedi derbyn y
> neges e-bost hon trwy gamgymeriad, rhowch wybod i'r anfonwr ar
> unwaith a dilëwch y neges. Os na fwriadwyd anfon y neges atoch chi,
> rhaid i chi beidio â defnyddio, cadw neu ddatgelu unrhyw wybodaeth a
> gynhwysir ynddi. Mae unrhyw farn neu safbwynt yn eiddo i'r sawl a'i
> hanfonodd yn unig ac nid yw o anghenraid yn cynrychioli barn
> Prifysgol Cymru, Bangor. Nid yw Prifysgol Cymru, Bangor yn gwarantu
> bod y neges e-bost hon neu unrhyw atodiadau yn rhydd rhag firysau
> neu
> 100% yn ddiogel. Oni bai fod hyn wedi ei ddatgan yn uniongyrchol yn
> nhestun yr e-bost, nid bwriad y neges e-bost hon yw ffurfio contract
> rhwymol - mae rhestr o lofnodwyr awdurdodedig ar gael o Swyddfa
> Cyllid Prifysgol Cymru, Bangor. www.bangor.ac.uk
>
> This email and any attachments may contain confidential material and
> is solely for the use of the intended recipient(s). If you have
> received this email in error, please notify the sender immediately
> and delete this email. If you are not the intended recipient(s),
> you
> must not use, retain or disclose any information contained in this
> email. Any views or opinions are solely those of the sender and do
> not necessarily represent those of the University of Wales, Bangor.
> The University of Wales, Bangor does not guarantee that this email
> or
> any attachments are free from viruses or 100% secure. Unless
> expressly stated in the body of the text of the email, this email is
> not intended to form a binding contract - a list of authorised
> signatories is available from the University of Wales, Bangor
> Finance
> Office. www.bangor.ac.uk
>
> --------------------------------------------------------------------
> This message was distributed by s-news@lists.biostat.wustl.edu. To
> unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu
> with
> the BODY of the message: unsubscribe s-news
>
Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
--------------------------------------------------------------------
This message was distributed by s-news@lists.biostat.wustl.edu. To
unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
the BODY of the message: unsubscribe s-news
|