Title: | Sieve Maximum Full Likelihood Estimation for the Right-censored Proportional Hazards Model |
---|---|
Description: | Fitting the full likelihood proportional hazards model and extracting the residuals. |
Authors: | Susan Halabi [aut], Taehwa Choi [aut, cre], Yuan Wu [aut] |
Maintainer: | Taehwa Choi <[email protected]> |
License: | GPL-3 |
Version: | 0.1.0 |
Built: | 2025-02-12 04:56:17 UTC |
Source: | https://github.com/taehwa015/smleph |
Fit the proportional hazards model with maximum full likelihood estimation. Sieve estimation is used for estimating the baseline hazard function.
smle_ph(y, d, x)
smle_ph(y, d, x)
y |
survival time (> 0). |
d |
right-censoring indicator, |
x |
p-dimensional covariates matrix. |
see Halabi et al., (2024+) for detailed method explanation.
smle_ph
returns a list containing the following components:
Coef
: regression estimator and its inferential results.
Cum.hazard
: baseline cumulative hazard function estimates.
Halabi et al., (2024+) Sieve maximum full likelihood estimation for the proportional hazards model
library(smlePH) set.seed(111) n = 200 beta = c(1, -1, 0.5, -0.5, 1) p = length(beta) beta = matrix(beta, ncol = 1) R = matrix(c(rep(0, p^2)), ncol = p) diag(R) = 1 mu = rep(0, p) SD = rep(1, p) S = R * (SD %*% t(SD)) x = MASS::mvrnorm(n, mu, S) T = (-log(runif(n)) / (2 * exp(x %*% beta)))^(1/2) C = runif(n, min = 0, max = 2.9) y = apply(cbind(T,C), 1, min) d = (T <= C)+0 ord = order(y) y = y[ord]; x = x[ord,]; d = d[ord] smle_ph(y = y, d = d, x = x)
library(smlePH) set.seed(111) n = 200 beta = c(1, -1, 0.5, -0.5, 1) p = length(beta) beta = matrix(beta, ncol = 1) R = matrix(c(rep(0, p^2)), ncol = p) diag(R) = 1 mu = rep(0, p) SD = rep(1, p) S = R * (SD %*% t(SD)) x = MASS::mvrnorm(n, mu, S) T = (-log(runif(n)) / (2 * exp(x %*% beta)))^(1/2) C = runif(n, min = 0, max = 2.9) y = apply(cbind(T,C), 1, min) d = (T <= C)+0 ord = order(y) y = y[ord]; x = x[ord,]; d = d[ord] smle_ph(y = y, d = d, x = x)
This function extracts residuals of the full likelihood proportional hazards model estimated by the sieve estimation. Deviance-type and score-type residuals are available.
smle_resid(y, d, x, fit, type = c("score", "deviance"))
smle_resid(y, d, x, fit, type = c("score", "deviance"))
y |
survival time (> 0). |
d |
right-censoring indicator, |
x |
p-dimensional covariates matrix. |
fit |
an object comes from the function |
type |
type of residual, either |
see Halabi et al., (2024+) for detailed method explanation.
smle_resid
returns a numeric vector (if type = "deviance"
) or a matrix (if type = "score"
) of residuals extracted from the object
.
Halabi et al., (2024+) Sieve maximum full likelihood estimation for the proportional hazards model
library(smlePH) # The 'fit' comes from an example description of smle_ph() smle_resid(y = y, d = d, x = x, fit = fit, type = "deviance") smle_resid(y = y, d = d, x = x, fit = fit, type = "score")
library(smlePH) # The 'fit' comes from an example description of smle_ph() smle_resid(y = y, d = d, x = x, fit = fit, type = "deviance") smle_resid(y = y, d = d, x = x, fit = fit, type = "score")