Skip to content
Prev 388550 / 398513 Next

zero weights in weighted.mean

Gentlemen,

At the risk of beating a dead horse, but in he spirit of learning more about R, aren't the two expressions functionally the same? One drops values where weight is zero. The other (in the case where we and infinity * 0, something one would not expect to see in data) also drops data as in R infinity * 0 = Nan. In either case the observation would be dropped. I am certain I am missing something, but I don't know what I am missing.

John

John David Sorkin M.D., Ph.D.
Professor of Medicine
University of Maryland School of Medicine
Associate Director for Biostatistics and Informatics Baltimore VA Medical Center
Geriatrics, Research, Education, and Clinical Center
Chief, Biostatistics and Informatics
University of Maryland School of Medicine Division of Gerontology, Geriatrics and Palliative Care
Senior Statistician
University of Maryland Center for Vascular Research
10 North Greene Street
GRECC (BT/18/GR)
Baltimore, MD 21201-1524
(Phone) 410-605-7119
(Fax) 410-605-7913 (Please call phone number above prior to faxing)