README.md

KMforCSD

KMforCSD is an R package containing the algorithm and the simulated data examples from the paper Kernel Machines for Current Status Data. The package also contains the artificially censored data from Section 6.2.

Installation

You can install the package from its GitHub repository. You first need to install the devtools package.

install.packages("devtools")

Then install KMforCSD using the install_github function in the devtools package.

library(devtools)
install_github("Yael-Travis-Lumer/KMforCSD")

Example

  1. Generate simulated current status data from weibull distribution (Setting 2 in paper):
library(KMforCSD)
n=500 #size of dataset
data_list = weibull_data(n=500)
sim_data = data_list[[1]]
train_ind = sample(seq_len(n), size = 0.8*n)
train_data = sim_data[train_ind, ]
test_data = sim_data[-train_ind, ]
  1. Train the KM-CSD:
sol = KMforCSD(train_data)
  1. Predicted values on test set:
pred = predict(sol, test_data) #prediction
decision_function = pred$response #estimated conditional expectation


Yael-Travis-Lumer/KMforCSD documentation built on June 3, 2021, 6:54 a.m.