Summarize SSI results | R Documentation |
Useful methods for retrieving and summarizing important results from the 'SSI' function's output
## S3 method for class 'SSI'
coef(object, ...)
## S3 method for class 'SSI'
fitted(object, ...)
## S3 method for class 'SSI'
summary(object, ...)
object |
An object of the class 'SSI' |
... |
Other arguments to be passed to
For
|
Method fitted
returns a matrix with the predicted values for each individual in the testing set (in rows) for each value of lambda (in columns).
Method coef
(list of matrices) returns the regression coefficients for each testing set individual (elements of the list). Each matrix contains the coefficients for each value of lambda (in rows) associated to each training set individual (in columns).
Method summary
returns a list object containing:
lambda
: (vector) sequence of values of lambda used in the coefficients' estimation.
nsup
: (vector) Number of non-zero coefficients (across testing individuals) at each solution associated to each value of lambda.
accuracy
: (vector) correlation between observed and predicted values associated to each value of lambda.
MSE
: (vector) mean squared error associated to each value of lambda.
optCOR
: (vector) summary of the SSI with maximum accuracy.
optMSE
: (vector) summary of the SSI with minimum MSE.
require(SFSI)
data(wheatHTP)
index = which(Y$trial %in% 1:6) # Use only a subset of data
Y = Y[index,]
M = scale(M[index,])/sqrt(ncol(M)) # Subset and scale markers
G = tcrossprod(M) # Genomic relationship matrix
y = as.vector(scale(Y[,"E1"])) # Scale response variable
# Sets (testing=0, training=1)
trn_tst = ifelse(Y$trial == 2, 0, 1)
fm = SSI(y,K=G,varU=0.4,varE=0.6,b=0,trn_tst=trn_tst)
uHat = fitted(fm) # Predicted values for each testing element
out = summary(fm) # Useful function to get results
corTST = out$accuracy # Testing set accuracy (correlation cor(y,yHat))
out$optCOR # SSI with maximum accuracy
out$optMSE # SSI with minimum MSE
B = coef(fm) # Regression coefficients for all tst
B = coef(fm, iy=1) # Coefficients for first tst (tst[1])
B = coef(fm, ilambda=10) # Coefficients associated to the 10th lambda
B = coef(fm, nsup=10) # Coefficients for which nsup=10
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.