Description Usage Arguments Details Value Author(s) See Also Examples
Obtains predictions and prediction probabilities from a fitted LS-PCR object.
1 2 |
object |
results from |
newX |
new matrix of genetic data. |
newD |
new matrix of clinical data. |
... |
further arguments. Currently not used. |
This function is used to obtained predicted values using a model fitting with fit.lspcr.glm
. It returns predictions and prediction probabilites in case that the user wants to choose his own decision rule. By default (in the prediction vector) if probabilities are under 0.5 observations are in the 0 class and if probabilities are upper than 0.5 observations are in the 1 class.
newY |
the |
newPi |
the |
cvg |
the 0-1 value indicating convergence of the algorithm (1 for convergence, 0 otherwise). |
Caroline Bazzoli, Thomas Bouleau, Sophie Lambert-Lacroix
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #Data
data(BreastCancer)
#Vector of response
Y<-BreastCancer$Y
#Genetic data
X<-BreastCancer$X
#Clinical data
D<-BreastCancer$D
#Learn dataset and test dataset (80/20)
index<-preselected.sample(Y,round(length(Y)*0.8))
XL<-X[index,]
XT<-X[-index,]
DL<-D[index,]
DT<-D[-index,]
YL<-Y[index]
#Apply fit.lspcr.glm with 5 components
fit<-fit.lspcr.glm(Y=YL,X=XL,D=DL,ncomp=5)
#predictions
pred<-predict.lspcr.glm(fit,newD=DT,newX=XT)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.