[R] kernel smoothing of disease rates at locations
Prof Brian Ripley
ripley at stats.ox.ac.uk
Wed May 10 14:52:28 CEST 2006
On Wed, 10 May 2006, Roger D. Peng wrote:
> It is certainly possible to get negative values when smoothing, especially on
> the edges. But we cannot reproduce your problem because you did not provide any
> code.
But kernel smoothing always reduces the range of the data, so kernel
smoothing of non-negative data cannot give a negative estimate. Roger's
comments apply to other smoothers, e.g. local polynomials.
We do need to see reproducible code (and also the posting guide advises
contacting the package maintainer about problems with contributed
packages).
>
> -roger
>
> Oarabile Molaodi wrote:
>> I want to do kernel smoothing on the standardised mortality rates at
>> specified location(x-y coordinates) and be able to produce contour map.
>> I've tried to use the package called fields in R (function smooth.2d)
>> but the problem is I get negative results after smoothing and I do not
>> understand why? Your contributions will be highly appreciated or if
>> there is any package that can do this I will be happy to know about it.
>> Thanks in advance for your comments.
>> Oarabile
>>
>> Below is how my data in R looks like
>> Xcoord Ycoord smr
>> 1 383894.70 653202.8 1.5816327
>> 2 339053.00 631770.9 1.0003473
>> 3 369164.50 609973.2 1.2943872
>> 4 313477.70 640382.8 0.9443508
>> 5 290748.80 695088.8 1.1662125
>> 6 287547.50 679829.6 0.9433962
>> 7 259031.90 704478.3 1.0184905
>> 8 329107.60 585753.3 1.0445860
>> 9 292170.20 578978.2 1.1287758
>> 10 268330.90 564281.7 0.9805996
>> 11 227395.50 561524.6 1.1947431
>> 12 310130.70 689395.0 1.0991957
>> 13 325756.00 696565.6 1.1734694
>> 14 339427.20 713217.2 0.8724100
>> 15 391752.10 805661.5 1.2483221
>> 16 385935.90 851044.5 1.0558140
>> 17 372471.20 826373.7 1.4220183
>> 18 354901.70 791107.2 0.9175084
>> 19 324944.10 842040.8 1.0447080
>> 20 275672.50 802570.4 0.9899329
>> 21 320750.00 954769.7 1.0866834
>> 22 243489.20 832748.8 1.0995658
>> 23 166559.70 786365.3 1.0401267
>> 24 288160.80 846054.4 1.0299003
>> 25 220347.00 869181.0 0.9529435
>> 26 175863.63 822593.9 0.9902252
>> 27 246114.40 938419.3 0.8909370
>> 28 359070.60 669738.3 0.9883721
>> 29 320614.70 670434.2 1.1288534
>> 30 331414.80 659972.3 0.9070866
>> 31 299336.90 666122.9 0.7969349
>> 32 156965.25 708047.7 1.1410460
>> 33 253867.30 674916.5 0.9256710
>> 34 249188.40 674272.8 1.0869565
>> 35 272463.00 679495.3 0.8576698
>> 36 252643.80 611378.4 0.8615611
>> 37 212637.35 643725.0 0.8596604
>> 38 234751.95 691803.4 0.9706546
>> 39 264856.20 644684.8 0.8468395
>> 40 253949.30 653042.5 0.8106169
>> 41 260412.35 663552.2 0.9253686
>> 42 270807.60 657454.0 0.9002826
>> 43 228477.30 670443.2 1.0782502
>> 44 248215.30 641897.3 0.9240407
>> 45 229797.50 596059.0 1.1579197
>> 46 291725.00 635771.8 0.8908766
>> 47 278012.80 667982.0 1.0240000
>> 48 279490.80 659761.6 0.9828301
>> 49 242791.70 662651.8 1.0230584
>> 50 263217.20 675295.2 0.9759817
>> 51 341138.80 754471.3 0.9505541
>> 52 334963.00 735075.4 0.9264498
>> 53 286139.70 733611.6 0.9052453
>> 54 354015.60 1025696.8 0.8905506
>> 55 455775.60 1201636.0 1.0862620
>> 56 88429.32 854994.4 0.9577015
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
More information about the R-help
mailing list