NWW: Nadaraya-Watson weights.

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/NWW.R

Description

Computes the Nadaraya-Watson weights.

Usage

1
NWW(covariate, x, kernel = "gaussian", bw)

Arguments

covariate

Covariate values for obtaining weights.

x

Covariate value to compute the weight at.

kernel

A character string specifying the desired kernel. See details below for possible options. Defaults to "gaussian" where the gaussian density kernel will be used.

bw

A single numeric value to compute a kernel density bandwidth.

Details

Possible options for argument window are "gaussian", "epanechnikov", "tricube", "boxcar", "triangular", "quartic" or "cosine".

Value

A vector with Nadaraya-Watson weights.

Author(s)

Luis Meira-Machado, Marta Sestelo and Gustavo Soutinho.

See Also

LLW

Examples

1
NWW(covariate = colonIDM$age, x=40, kernel = "gaussian", bw = 3)

Example output

  [1] 9.232009e-03 2.624286e-15 9.907033e-26 7.452001e-19 7.784669e-23
  [6] 1.620333e-09 1.418846e-35 2.840921e-07 2.059940e-03 1.847166e-21
 [11] 1.000455e-03 5.106080e-06 1.927614e-16 1.847166e-21 2.059940e-03
 [16] 1.847166e-21 3.197035e-14 3.051826e-39 2.059940e-03 5.884321e-05
 [21] 1.927614e-16 1.013470e-08 3.485208e-13 5.884321e-05 2.935752e-24
 [26] 8.084019e-29 2.935752e-24 1.847166e-21 1.013470e-08 3.788694e-41
 [31] 1.927614e-16 1.000455e-03 1.690901e-04 1.000455e-03 1.013470e-08
 [36] 2.991665e-27 3.051826e-39 1.927614e-16 3.485208e-13 2.318157e-10
 [41] 4.229521e-32 1.439846e-02 9.907033e-26 2.318157e-10 1.522101e-02
 [46] 2.624286e-15 2.967743e-11 2.967743e-11 2.967743e-11 3.399813e-12
 [51] 1.847166e-21 2.935752e-24 8.189187e-34 3.795392e-03 3.485208e-13
 [56] 8.189187e-34 1.273212e-06 2.624286e-15 1.266992e-17 1.620333e-09
 [61] 3.788694e-41 2.318157e-10 1.273212e-06 1.273212e-06 9.907033e-26
 [66] 7.452001e-19 1.690901e-04 3.399813e-12 2.935752e-24 1.522101e-02
 [71] 5.672342e-08 1.013470e-08 2.840921e-07 1.690901e-04 9.907033e-26
 [76] 3.922085e-20 1.847166e-21 2.624286e-15 5.884321e-05 3.795392e-03
 [81] 7.452001e-19 2.059940e-03 2.935752e-24 2.624286e-15 3.795392e-03
 [86] 1.690901e-04 3.197035e-14 2.967743e-11 3.788694e-41 8.084019e-29
 [91] 2.059940e-03 1.927614e-16 3.795392e-03 2.840921e-07 7.452001e-19
 [96] 3.922085e-20 1.266992e-17 1.954730e-30 9.907033e-26 2.318157e-10
[101] 2.967743e-11 3.485208e-13 1.690901e-04 5.884321e-05 4.229521e-32
[106] 1.847166e-21 3.399813e-12 1.266992e-17 1.954730e-30 5.106080e-06
[111] 1.927614e-16 1.000455e-03 3.795392e-03 3.485208e-13 1.273212e-06
[116] 3.399813e-12 3.399813e-12 1.832396e-05 3.399813e-12 1.927614e-16
[121] 5.106080e-06 1.266992e-17 2.935752e-24 5.672342e-08 9.907033e-26
[126] 5.884321e-05 1.522101e-02 1.690901e-04 1.273212e-06 3.922085e-20
[131] 2.318157e-10 3.051826e-39 5.672342e-08 2.624286e-15 5.672342e-08
[136] 1.218803e-02 1.013470e-08 1.927614e-16 5.672342e-08 5.672342e-08
[141] 2.967743e-11 5.106080e-06 1.690901e-04 5.106080e-06 1.927614e-16
[146] 1.000455e-03 8.189187e-34 1.218803e-02 1.273212e-06 2.991665e-27
[151] 2.059940e-03 7.784669e-23 9.232009e-03 2.991665e-27 8.084019e-29
[156] 1.847166e-21 5.106080e-06 8.084019e-29 7.452001e-19 4.229521e-32
[161] 9.232009e-03 1.620333e-09 1.954730e-30 3.922085e-20 7.452001e-19
[166] 1.620333e-09 4.208859e-43 5.884321e-05 3.197035e-14 4.347958e-04
[171] 3.795392e-03 2.059940e-03 2.991665e-27 5.672342e-08 3.922085e-20
[176] 1.439846e-02 1.013470e-08 5.884321e-05 1.266992e-17 1.954730e-30
[181] 1.954730e-30 2.318157e-10 1.013470e-08 4.229521e-32 3.922085e-20
[186] 2.318157e-10 2.318157e-10 1.439846e-02 2.991665e-27 4.347958e-04
[191] 7.784669e-23 1.620333e-09 3.795392e-03 8.189187e-34 2.967743e-11
[196] 7.452001e-19 1.266992e-17 7.784669e-23 4.347958e-04 1.013470e-08
[201] 9.907033e-26 4.229521e-32 2.318157e-10 1.522101e-02 1.439846e-02
[206] 1.218803e-02 1.273212e-06 9.232009e-03 1.832396e-05 1.418846e-35
[211] 3.922085e-20 1.439846e-02 2.624286e-15 2.624286e-15 2.624286e-15
[216] 2.318157e-10 3.922085e-20 5.672342e-08 2.624286e-15 1.418846e-35
[221] 9.232009e-03 2.199759e-37 1.832396e-05 3.922085e-20 7.452001e-19
[226] 1.927614e-16 4.229521e-32 1.273212e-06 4.347958e-04 2.967743e-11
[231] 3.399813e-12 1.218803e-02 3.399813e-12 2.318157e-10 2.967743e-11
[236] 2.935752e-24 4.229521e-32 8.084019e-29 8.189187e-34 1.847166e-21
[241] 3.485208e-13 8.189187e-34 1.013470e-08 5.672342e-08 3.399813e-12
[246] 2.991665e-27 1.954730e-30 3.197035e-14 8.189187e-34 2.991665e-27
[251] 1.620333e-09 1.439846e-02 3.485208e-13 3.197035e-14 2.935752e-24
[256] 2.935752e-24 1.620333e-09 1.266992e-17 1.266992e-17 9.907033e-26
[261] 2.935752e-24 6.257544e-03 4.347958e-04 1.273212e-06 2.840921e-07
[266] 2.318157e-10 3.922085e-20 2.967743e-11 3.922085e-20 3.399813e-12
[271] 2.935752e-24 8.189187e-34 3.399813e-12 3.922085e-20 1.273212e-06
[276] 8.189187e-34 1.954730e-30 1.013470e-08 1.266992e-17 2.624286e-15
[281] 1.013470e-08 2.935752e-24 4.347958e-04 3.795392e-03 1.847166e-21
[286] 1.620333e-09 2.935752e-24 1.439846e-02 2.059940e-03 1.418846e-35
[291] 2.967743e-11 2.318157e-10 1.013470e-08 1.847166e-21 1.620333e-09
[296] 6.257544e-03 1.013470e-08 3.922085e-20 3.197035e-14 1.847166e-21
[301] 3.485208e-13 6.257544e-03 5.106080e-06 1.832396e-05 2.967743e-11
[306] 3.485208e-13 1.620333e-09 1.266992e-17 8.084019e-29 7.784669e-23
[311] 2.624286e-15 4.229521e-32 1.927614e-16 1.013470e-08 7.784669e-23
[316] 1.927614e-16 1.954730e-30 2.991665e-27 2.318157e-10 1.954730e-30
[321] 3.485208e-13 1.954730e-30 1.927614e-16 9.907033e-26 7.452001e-19
[326] 1.273212e-06 8.189187e-34 4.229521e-32 1.927614e-16 1.266992e-17
[331] 1.620333e-09 1.266992e-17 1.273212e-06 1.954730e-30 1.954730e-30
[336] 1.954730e-30 4.347958e-04 2.318157e-10 1.954730e-30 9.907033e-26
[341] 2.840921e-07 3.788694e-41 2.935752e-24 2.935752e-24 2.935752e-24
[346] 9.907033e-26 2.967743e-11 1.000455e-03 2.624286e-15 7.784669e-23
[351] 8.084019e-29 3.922085e-20 5.672342e-08 3.795392e-03 2.199759e-37
[356] 3.788694e-41 5.672342e-08 1.927614e-16 3.399813e-12 1.954730e-30
[361] 3.485208e-13 1.927614e-16 4.347958e-04 8.189187e-34 8.189187e-34
[366] 5.884321e-05 1.013470e-08 1.218803e-02 2.991665e-27 1.847166e-21
[371] 1.690901e-04 1.927614e-16 2.935752e-24 5.884321e-05 1.954730e-30
[376] 9.232009e-03 4.229521e-32 1.013470e-08 1.954730e-30 2.624286e-15
[381] 1.013470e-08 1.218803e-02 2.624286e-15 3.197035e-14 1.000455e-03
[386] 5.884321e-05 8.084019e-29 3.485208e-13 2.935752e-24 1.218803e-02
[391] 1.927614e-16 1.439846e-02 1.000455e-03 8.189187e-34 1.266992e-17
[396] 9.232009e-03 2.991665e-27 1.000455e-03 7.452001e-19 1.954730e-30
[401] 2.840921e-07 6.257544e-03 4.229521e-32 2.318157e-10 4.347958e-04
[406] 1.927614e-16 1.690901e-04 5.672342e-08 3.399813e-12 3.922085e-20
[411] 3.051826e-39 1.620333e-09 2.318157e-10 2.967743e-11 7.452001e-19
[416] 2.840921e-07 2.318157e-10 6.257544e-03 5.106080e-06 3.485208e-13
[421] 8.189187e-34 2.318157e-10 5.106080e-06 2.991665e-27 1.954730e-30
[426] 3.197035e-14 2.059940e-03 7.452001e-19 5.106080e-06 1.218803e-02
[431] 3.485208e-13 3.399813e-12 1.847166e-21 1.273212e-06 2.318157e-10
[436] 1.927614e-16 1.847166e-21 3.197035e-14 2.935752e-24 1.620333e-09
[441] 7.452001e-19 2.967743e-11 4.229521e-32 1.418846e-35 1.620333e-09
[446] 2.991665e-27 1.927614e-16 1.000455e-03 3.197035e-14 2.935752e-24
[451] 5.672342e-08 4.347958e-04 1.927614e-16 4.347958e-04 1.847166e-21
[456] 2.967743e-11 1.847166e-21 5.884321e-05 1.439846e-02 7.784669e-23
[461] 2.059940e-03 9.232009e-03 1.847166e-21 8.084019e-29 7.452001e-19
[466] 3.399813e-12 1.954730e-30 1.847166e-21 3.399813e-12 9.907033e-26
[471] 8.189187e-34 1.620333e-09 1.000455e-03 2.840921e-07 1.847166e-21
[476] 2.935752e-24 7.452001e-19 3.795392e-03 3.485208e-13 1.954730e-30
[481] 1.000455e-03 2.318157e-10 8.084019e-29 3.485208e-13 6.257544e-03
[486] 1.013470e-08 7.452001e-19 5.884321e-05 3.922085e-20 1.954730e-30
[491] 1.954730e-30 1.013470e-08 3.399813e-12 2.840921e-07 1.954730e-30
[496] 3.795392e-03 4.208859e-43 8.084019e-29 9.907033e-26 2.935752e-24
[501] 7.452001e-19 9.907033e-26 4.347958e-04 5.672342e-08 2.991665e-27
[506] 1.620333e-09 1.620333e-09 1.218803e-02 5.106080e-06 1.620333e-09
[511] 1.000455e-03 1.439846e-02 3.485208e-13 9.907033e-26 2.318157e-10
[516] 7.452001e-19 2.967743e-11 9.232009e-03 7.452001e-19 4.347958e-04
[521] 1.847166e-21 2.991665e-27 1.418846e-35 1.847166e-21 6.257544e-03
[526] 2.624286e-15 7.452001e-19 5.884321e-05 2.991665e-27 1.522101e-02
[531] 1.690901e-04 1.013470e-08 3.485208e-13 1.266992e-17 1.266992e-17
[536] 2.991665e-27 1.847166e-21 2.967743e-11 2.967743e-11 9.907033e-26
[541] 1.690901e-04 2.935752e-24 5.672342e-08 2.059940e-03 1.418846e-35
[546] 1.620333e-09 1.847166e-21 3.197035e-14 6.257544e-03 2.318157e-10
[551] 4.229521e-32 2.935752e-24 4.183928e-45 3.485208e-13 5.106080e-06
[556] 1.000455e-03 3.485208e-13 1.439846e-02 7.784669e-23 5.672342e-08
[561] 1.013470e-08 3.788694e-41 9.232009e-03 3.721767e-47 2.110154e-51
[566] 3.485208e-13 1.000455e-03 8.189187e-34 2.318157e-10 2.967743e-11
[571] 3.399813e-12 4.347958e-04 1.013470e-08 4.229521e-32 3.197035e-14
[576] 7.784669e-23 2.991665e-27 2.840921e-07 2.991665e-27 1.273212e-06
[581] 3.197035e-14 1.439846e-02 3.399813e-12 5.672342e-08 1.927614e-16
[586] 1.847166e-21 1.266992e-17 7.452001e-19 1.439846e-02 2.840921e-07
[591] 2.059940e-03 1.954730e-30 4.208859e-43 1.218803e-02 2.967743e-11
[596] 3.197035e-14 3.485208e-13 2.059940e-03 5.672342e-08 1.620333e-09
[601] 1.218803e-02 7.784669e-23 3.051826e-39 9.907033e-26 1.954730e-30
[606] 5.884321e-05 2.991665e-27 1.847166e-21 7.452001e-19 2.624286e-15
[611] 5.106080e-06 1.927614e-16 1.847166e-21 1.954730e-30 4.347958e-04
[616] 3.399813e-12 1.439846e-02 8.189187e-34 3.197035e-14 1.439846e-02
[621] 3.795392e-03 2.967743e-11 5.106080e-06 1.266992e-17 3.485208e-13
[626] 3.485208e-13 2.967743e-11 2.967743e-11 9.907033e-26 1.439846e-02
[631] 1.266992e-17 2.059940e-03 1.832396e-05 5.672342e-08 1.266992e-17
[636] 9.907033e-26 1.847166e-21 2.967743e-11 7.452001e-19 3.197035e-14
[641] 1.522101e-02 1.927614e-16 1.522101e-02 2.935752e-24 7.452001e-19
[646] 8.084019e-29 7.784669e-23 2.318157e-10 5.672342e-08 1.273212e-06
[651] 5.106080e-06 3.197035e-14 3.485208e-13 7.784669e-23 1.439846e-02
[656] 1.927614e-16 2.967743e-11 1.266992e-17 7.452001e-19 3.399813e-12
[661] 9.232009e-03 1.954730e-30 3.922085e-20 2.059940e-03 1.000455e-03
[666] 7.452001e-19 6.257544e-03 3.197035e-14 7.784669e-23 8.189187e-34
[671] 6.257544e-03 8.084019e-29 2.991665e-27 3.485208e-13 2.318157e-10
[676] 5.106080e-06 7.452001e-19 9.232009e-03 3.399813e-12 3.485208e-13
[681] 3.485208e-13 2.059940e-03 8.084019e-29 1.266992e-17 3.485208e-13
[686] 1.266992e-17 1.847166e-21 2.624286e-15 2.991665e-27 1.954730e-30
[691] 3.795392e-03 7.452001e-19 1.218803e-02 2.059940e-03 1.832396e-05
[696] 1.266992e-17 5.672342e-08 2.318157e-10 1.266992e-17 2.059940e-03
[701] 1.620333e-09 3.922085e-20 4.229521e-32 1.927614e-16 2.624286e-15
[706] 1.927614e-16 2.967743e-11 2.199759e-37 2.624286e-15 1.620333e-09
[711] 5.106080e-06 5.884321e-05 6.257544e-03 5.884321e-05 1.273212e-06
[716] 4.347958e-04 5.672342e-08 1.000455e-03 1.954730e-30 1.273212e-06
[721] 5.672342e-08 1.273212e-06 3.922085e-20 1.013470e-08 5.884321e-05
[726] 1.013470e-08 2.059940e-03 3.399813e-12 3.399813e-12 1.620333e-09
[731] 1.218803e-02 2.318157e-10 1.273212e-06 8.084019e-29 8.084019e-29
[736] 1.620333e-09 1.418846e-35 3.399813e-12 1.954730e-30 2.935752e-24
[741] 1.273212e-06 1.847166e-21 2.967743e-11 1.832396e-05 1.620333e-09
[746] 3.485208e-13 1.847166e-21 1.690901e-04 2.935752e-24 1.273212e-06
[751] 1.620333e-09 8.189187e-34 2.967743e-11 1.013470e-08 1.218803e-02
[756] 3.485208e-13 1.690901e-04 7.784669e-23 1.273212e-06 2.991665e-27
[761] 1.620333e-09 8.084019e-29 2.318157e-10 7.784669e-23 7.784669e-23
[766] 1.000455e-03 3.788694e-41 3.922085e-20 2.840921e-07 2.624286e-15
[771] 1.266992e-17 1.266992e-17 4.347958e-04 5.106080e-06 3.922085e-20
[776] 2.935752e-24 1.832396e-05 4.347958e-04 2.624286e-15 4.208859e-43
[781] 7.452001e-19 3.399813e-12 4.208859e-43 7.452001e-19 2.199759e-37
[786] 2.059940e-03 1.620333e-09 1.620333e-09 3.922085e-20 1.847166e-21
[791] 1.218803e-02 2.935752e-24 7.452001e-19 2.624286e-15 2.991665e-27
[796] 3.485208e-13 2.059940e-03 6.257544e-03 7.784669e-23 4.229521e-32
[801] 1.927614e-16 1.418846e-35 1.832396e-05 6.257544e-03 1.013470e-08
[806] 2.624286e-15 1.927614e-16 6.257544e-03 8.084019e-29 2.840921e-07
[811] 6.257544e-03 5.884321e-05 1.266992e-17 1.847166e-21 1.013470e-08
[816] 3.197035e-14 6.257544e-03 1.620333e-09 1.690901e-04 1.439846e-02
[821] 1.273212e-06 3.399813e-12 1.266992e-17 3.485208e-13 1.418846e-35
[826] 4.347958e-04 1.418846e-35 7.784669e-23 6.257544e-03 1.927614e-16
[831] 2.935752e-24 1.954730e-30 2.624286e-15 5.106080e-06 2.840921e-07
[836] 2.840921e-07 1.439846e-02 3.485208e-13 2.059940e-03 2.967743e-11
[841] 1.620333e-09 1.439846e-02 1.954730e-30 3.795392e-03 7.452001e-19
[846] 3.399813e-12 8.084019e-29 8.189187e-34 3.051826e-39 1.000455e-03
[851] 3.399813e-12 3.197035e-14 3.197035e-14 4.229521e-32 1.013470e-08
[856] 2.935752e-24 2.840921e-07 1.927614e-16 2.624286e-15 5.106080e-06
[861] 9.907033e-26 2.840921e-07 1.273212e-06 1.847166e-21 1.690901e-04
[866] 3.485208e-13 1.522101e-02 1.218803e-02 1.013470e-08 3.051826e-39
[871] 5.672342e-08 2.967743e-11 6.257544e-03 2.624286e-15 1.273212e-06
[876] 7.452001e-19 2.624286e-15 1.927614e-16 2.199759e-37 7.452001e-19
[881] 1.927614e-16 1.847166e-21 3.795392e-03 1.927614e-16 3.399813e-12
[886] 5.672342e-08 1.439846e-02 3.922085e-20 5.672342e-08 3.485208e-13
[891] 3.922085e-20 3.197035e-14 5.106080e-06 3.788694e-41 1.832396e-05
[896] 1.954730e-30 2.935752e-24 8.084019e-29 1.013470e-08 2.935752e-24
[901] 1.847166e-21 1.832396e-05 1.013470e-08 9.907033e-26 2.624286e-15
[906] 4.183928e-45 1.847166e-21 5.672342e-08 9.907033e-26 1.847166e-21
[911] 3.399813e-12 2.991665e-27 7.784669e-23 2.059940e-03 1.218803e-02
[916] 9.232009e-03 9.907033e-26 5.884321e-05 2.935752e-24 2.935752e-24
[921] 2.318157e-10 2.935752e-24 5.672342e-08 1.927614e-16 9.907033e-26
[926] 2.991665e-27 8.189187e-34 4.347958e-04 7.452001e-19

survidm documentation built on June 25, 2021, 1:07 a.m.