s-news
[Top] [All Lists]

CORRECTION to SUMMARY: weighted density estimates

To: s-news@wubios.wustl.edu
Subject: CORRECTION to SUMMARY: weighted density estimates
From: P.J.Wells@open.ac.uk
Date: Wed, 27 Jun 2001 16:58:12 +0100
In my original message I suggested:

>       density <- c(1:length(a))
>
>#creates vector of bin contents
>
>       for(i in 1:length(a)) {
>
>               density[i] <- sum( w8s[a[i] < x & x <= b[i] ] ) 
>/ sum(w8s)
>
>       }
>
>#weights data in bins

Had I been wider awake this morning I would have recalled that "density" is
an S-Plus function; the code I actually tested had the rather uninformative
"result" in its place.

Moral; if it ain't broke, don't fix it.

Julian Wells

OU Business School
The Open University
Walton Hall
Milton Keynes
MK7 6AA
United Kingdom
+44 1908 654658



<Prev in Thread] Current Thread [Next in Thread>
  • CORRECTION to SUMMARY: weighted density estimates, P . J . Wells <=