Learn R Programming

PHeval (version 1.1)

plotscore: Plot of the standardized score process

Description

The function plots the standardized score process. This process is a list resulting of a call to the function standscore.

Usage

plotscore(s, printCB = FALSE , component.num = 1:dim(s[[1]])[2], 
main = "" , xlab = "Time", ylab = "Standardized score", ylim)

Arguments

s

A list resulting from a call to the function standscore which corresponds to the standardized score process and, possibly, its confidence bands.

printCB

Set printCB = TRUE for plotting the confidence bands. Default is printCB = FALSE.

component.num

A vector of length equals to or lower than the number of covariates. It indicates which components of the process to plot. For example, set component.num=c(2,3) for plotting the second and third components. By default, all components are plotted.

main,xlab,ylab,ylim

Usual arguments for plotting. See help(plot).

Author

Cecile Chauvel

See Also

standscore

Examples

Run this code
library(survival)
data(ovarian)

#############################################
# Evaluation and plot of the standardized score process at parameter beta0 = 0
score1=standscore(futime+fustat~age+rx,data=ovarian)
plotscore(score1,printCB=TRUE)


#############################################
# Evaluation of the standardized score process at parameter
# beta0 = maximum partial likelihood estimator of beta
beta=coxph(Surv(futime,fustat)~age+rx,data=ovarian)$coeff
score2=standscore(futime+fustat~age+rx,data=ovarian,beta0=beta)

# Separated plots for each regression effect
par(mfrow=c(1,2))
plotscore(score2,printCB=TRUE,component.num=1,main="age")
plotscore(score2,printCB=TRUE,component.num=2,main="rx")

#############################################
# Evaluation and plot of the standardized score process at parameter beta0 = 0
# without global standardization 
score3=standscore(futime+fustat~age+rx,data=ovarian,globstan=FALSE)
plotscore(score3)	

Run the code above in your browser using DataLab