NWW: Nadaraya-Watson weights

Description Usage Arguments Details Value Author(s) 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)

Gustavo Soutinho and Luis Meira-Machado

Examples

1
2
3
4
b3state2 <- multidf(time1=bladder4state$y1, event1=bladder4state$d1, 
time=bladder4state$y1+bladder4state$y2,status=bladder4state$d2, size=bladder4state$size)
obj0 <- b3state2[[1]]
NWW(covariate = obj0$size, x=3, kernel = "gaussian", bw = 3)

gsoutinho/survrec documentation built on Dec. 20, 2021, 1:46 p.m.