[19168] in s-news-athena
[S] weighted histogram
daemon@ATHENA.MIT.EDU (Christian Hoffmann)
Thu Sep 9 10:46:21 1999
Message-Id: <3.0.5.32.19990909164139.00a17550@mail.wsl.ch>
Date: Thu, 09 Sep 1999 16:41:39 +0200
To: s-news@wubios.wustl.edu
From: Christian Hoffmann <christian.hoffmann@lagonda.wsl.ch>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Hi there,
For the evaluation of data of a stratified survey I would like to extend
the function "histogram" so that its bars represent the weighted sum of
occurrences of the data in the bins. This is because the probability for an
individual to be represented in the survey is a different constant for each
stratum. ( => "weights" <- 1/probability). If all "weights" == 1, then the
resulting plot should reproduce the plot generated by the original version
of "histogram".
An analysis of the code of "histogram" shows that "tabulate" is used in the
crucial step. Unfortunately this function is only given as
".C("tabulate",ans = integer(nbins),as.integer(bin) -
as.integer(1),n)$ans". Instead of "tabulate" I need an analogous function
summing for each bin the values of the "weights" which correspond to the x
going into that respective bin.
Does anyone have a hint?
Thanks
--Christian
Christian W. Hoffmann
Swiss Federal Institute for Forest, Snow and Landscape Research
CH-8903 Birmensdorf, Switzerland
phone: ++41-1-739 22 77 fax : ++41-1-737 40 80 e-mail: Hoffmann@WSL.CH
WWW: http://www.wsl.ch/land/dynamics/modeling/hoffmann.htm
FTP: ftp://ftp.wsl.ch/pub/hoffmann/
I prefer WWW pages which can be viewed best with *any* browser, contain
*no* cookies, *no* Java, *no* frames, and *no* required images !
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news