predict.pact: Predictions from a predictive model fit

Description Usage Arguments Details Value Author(s) Examples

View source: R/pact.R

Description

Predicts the scores for new subjects from a previously developed object of class 'pact'

Usage

1
2
## S3 method for class 'pact'
predict(object, newxv, ...)

Arguments

object

The object returned from pact.fit

newxv

The dataframe Xv of covariates for the new subjects for whom predictions are to be made

...

Other arguments to 'predict'

Details

Returns the scores for new subjects from an object of class 'pact', given their covariate values and treatment assignment.

Value

A numeric vector containing the predicted scores for the new subjects from the fitted model is returned

Author(s)

Jyothi Subramanian and Richard Simon
Maintainer: Jyothi Subramanian <subramanianj01@gmail.com>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
### Survival response
data(prostateCancer)
Y <- prostateCancer[1:400,3:4]
Xf <- prostateCancer[1:400,7:8]
Xv <- prostateCancer[1:400,c(5:6,9)]
Treatment <- as.factor(prostateCancer[1:400,2])
p <- pact.fit(Y=Y, Xf=Xf, Xv=Xv, Treatment=Treatment, family="cox", varSelect="univar")

newxv <- prostateCancer[401:410,c(5:6,9)]
predict(p, newxv)

### Binary response
data(EORTC10994)
Y <- as.factor(EORTC10994[1:120,4])
Xv <- EORTC10994[1:120,c(2,5:7)]
Treatment <- as.factor(EORTC10994[1:120,3])
p <- pact.fit(Y=Y,Xv=Xv,Treatment=Treatment,family="binomial",varSelect="none")

newxv <- EORTC10994[121:125,c(2,5:7)]
predict(p, newxv)

pact documentation built on May 2, 2019, 1:48 a.m.