Description Usage Arguments Details Value References See Also Examples
Computes pseudo-observations for modeling survival function based on the Kaplan-Meier estimator.
1 | pseudosurv(time,event, tmax)
|
time |
the follow up time. |
event |
the status indicator: 0=alive, 1=dead. |
tmax |
a vector of time points at which the pseudo-observations are to be computed. If missing, the pseudo-observations are reported at each event time. |
The function calculates the pseudo-observations for the value of the survival function at prespecified time-points for each individual.
The pseudo-observations can be used for fitting a regression model with a generalized estimating equation.
No missing values in either time
or event
vector are allowed.
Please note that the output of the function has changed and the usage is thus no longer the same as in the reference paper - the new usage is described in the example below.
Similar (faster) version of the function is available in the R-package prodlim (jackknife
).
A list containing the following objects:
time |
The ordered time points at which the pseudo-observations are evaluated. |
pseudo |
A matrix. Each row belongs to one individual (ordered as in the original data set), each column presents a time point (ordered in time). |
Klein J.P., Gerster M., Andersen P.K., Tarima S., POHAR PERME, M.: "SAS and R Functions to Compute Pseudo-values for Censored Data Regression." Comput. methods programs biomed., 2008, 89 (3): 289-300
pseudomean
,
pseudoci
,
pseudoyl
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | library(KMsurv)
data(bmt)
#calculate the pseudo-observations
cutoffs <- c(50,105,170,280,530)
pseudo <- pseudosurv(time=bmt$t2,event=bmt$d3,tmax=cutoffs)
#rearrange the data into a long data set
b <- NULL
for(it in 1:length(pseudo$time)){
b <- rbind(b,cbind(bmt,pseudo = pseudo$pseudo[,it],
tpseudo = pseudo$time[it],id=1:nrow(bmt)))
}
b <- b[order(b$id),]
#fit a Cox model using GEE
library(geepack)
summary(fit <- geese(pseudo~as.factor(tpseudo)+as.factor(group)+
as.factor(z8)+z1,data=b,scale.fix=TRUE,family=gaussian,
jack=TRUE, mean.link="cloglog",corstr="independence"))
#The results using the AJ variance estimate
round(cbind(mean = fit$beta,SD = sqrt(diag(fit$vbeta.ajs)),
Z = fit$beta/sqrt(diag(fit$vbeta.ajs)), PVal =
2-2*pnorm(abs(fit$beta/sqrt(diag(fit$vbeta.ajs))))),4)
|
Loading required package: KMsurv
Loading required package: geepack
Call:
geese(formula = pseudo ~ as.factor(tpseudo) + as.factor(group) +
as.factor(z8) + z1, data = b, family = gaussian, mean.link = "cloglog",
scale.fix = TRUE, corstr = "independence", jack = TRUE)
Mean Model:
Mean Link: cloglog
Variance to Mean Relation: gaussian
Coefficients:
estimate san.se ajs.se wald
(Intercept) 1.53873091 0.40552248 0.40704695 14.39777853
as.factor(tpseudo)105 -0.64830689 0.17692194 0.17426233 13.42758499
as.factor(tpseudo)170 -1.05469355 0.20215327 0.19887879 27.22018279
as.factor(tpseudo)280 -1.38359029 0.21691752 0.21308520 40.68419860
as.factor(tpseudo)530 -1.83329791 0.23366694 0.22902299 61.55616409
as.factor(group)2 0.88686447 0.29858325 0.29682899 8.82233658
as.factor(group)3 -0.09759922 0.30930608 0.31221302 0.09956708
as.factor(z8)1 -0.57002709 0.25593298 0.25723750 4.96064879
z1 -0.01141921 0.01152905 0.01176953 0.98103516
p
(Intercept) 1.479768e-04
as.factor(tpseudo)105 2.479511e-04
as.factor(tpseudo)170 1.815535e-07
as.factor(tpseudo)280 1.789282e-10
as.factor(tpseudo)530 4.329870e-15
as.factor(group)2 2.975654e-03
as.factor(group)3 7.523498e-01
as.factor(z8)1 2.593048e-02
z1 3.219434e-01
Scale is fixed.
Correlation Model:
Correlation Structure: independence
Returned Error Value: 0
Number of clusters: 137 Maximum cluster size: 5
mean SD Z PVal
(Intercept) 1.5387 0.4070 3.7802 0.0002
as.factor(tpseudo)105 -0.6483 0.1743 -3.7203 0.0002
as.factor(tpseudo)170 -1.0547 0.1989 -5.3032 0.0000
as.factor(tpseudo)280 -1.3836 0.2131 -6.4931 0.0000
as.factor(tpseudo)530 -1.8333 0.2290 -8.0049 0.0000
as.factor(group)2 0.8869 0.2968 2.9878 0.0028
as.factor(group)3 -0.0976 0.3122 -0.3126 0.7546
as.factor(z8)1 -0.5700 0.2572 -2.2160 0.0267
z1 -0.0114 0.0118 -0.9702 0.3319
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.