Description Usage Arguments Details Value Author(s) References See Also Examples

Similar to other predict methods, this function returns predictions from
a fitted `"grpsurv"`

object.

1 2 3 4 |

`object` |
Fitted |

`X` |
Matrix of values at which predictions are to be made. Not
used for |

`lambda` |
Values of the regularization parameter |

`which` |
Indices of the penalty parameter |

`type` |
Type of prediction: |

`...` |
Not used. |

Estimation of baseline survival function conditional on the estimated
values of `beta`

is carried out according to the method described in
Chapter 4.3 of Kalbfleish and Prentice. In particular, it agrees exactly
with the results returned by ```
survfit.coxph(...,
type='kalbfleisch-prentice')
```

in the `survival`

package.

The object returned depends on type.

Patrick Breheny

Kalbfleish JD and Prentice RL (2002). The Statistical Analysis of Failure Time Data, 2nd edition. Wiley.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ```
data(Lung)
X <- Lung$X
y <- Lung$y
group <- Lung$group
fit <- grpsurv(X, y, group)
coef(fit, lambda=0.05)
head(predict(fit, X, type="link", lambda=0.05))
head(predict(fit, X, type="response", lambda=0.05))
# Survival function
S <- predict(fit, X[1,], type="survival", lambda=0.05)
S(100)
S <- predict(fit, X, type="survival", lambda=0.05)
plot(S, xlim=c(0,200))
# Medians
predict(fit, X[1,], type="median", lambda=0.05)
M <- predict(fit, X, type="median")
M[1:10, 1:10]
# Nonzero coefficients
predict(fit, type="vars", lambda=c(0.1, 0.01))
predict(fit, type="nvars", lambda=c(0.1, 0.01))
``` |

```
Loading required package: Matrix
trt karno1 karno2 karno3 diagtime1 diagtime2
0.07652935 -6.19181104 0.78945438 -0.46953841 0.00000000 0.00000000
age1 age2 age3 prior squamous small
-0.29895766 0.29905276 -0.98300604 0.00000000 -0.37016343 0.16503970
adeno large
0.38628145 -0.17872796
1 2 3 4 5 6
-0.3587509 -0.5741486 -0.2395230 -0.3704099 -0.5685743 0.8096858
1 2 3 4 5 6
0.6985484 0.5631842 0.7870032 0.6904512 0.5663323 2.2472019
[1] 0.5094304
[1] 103
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 80 80 80 73 73 73 73 80 82 87
[2,] 80 80 80 82 82 84 87 92 95 99
[3,] 80 80 80 73 73 73 73 80 82 87
[4,] 80 80 80 73 73 73 73 80 82 87
[5,] 80 80 80 82 82 84 87 92 95 99
[6,] 80 61 54 52 49 44 36 35 33 31
[7,] 80 72 61 59 54 53 52 53 53 54
[8,] 80 82 87 90 92 95 99 100 105 111
[9,] 80 73 72 63 61 59 59 61 63 72
[10,] 80 80 80 82 82 84 87 92 95 99
$`0.1`
karno1 karno2 karno3 squamous small adeno large
2 3 4 11 12 13 14
$`0.01`
trt karno1 karno2 karno3 diagtime1 diagtime2 age1 age2
1 2 3 4 5 6 7 8
age3 prior squamous small adeno large
9 10 11 12 13 14
0.1 0.01
7 14
```

grpreg documentation built on Sept. 27, 2018, 5:03 p.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.