Description Usage See Also Examples

`pgsfit.obj`

is a S3 class to store PGS fitting results. Internally used by `pgsfit`

. `pgsfit.obj`

contains:

`grid.err`

: cross-validation error grid`lam.sel.vect`

: vector of selected lambda for each Pm`beta.shrink`

: list of beta after shrinkage for each Pm`var.sand`

: list of sandwich variance of beta for each Pm`hat.R`

: list of estimated working correlation matrix for each Pm`convergenceError`

: convergence error when iteration stopped for each Pm`iterationNumber`

: iteration times when converged for each Pm`which.best`

: index of the best Pm and lambda among convergent results`which.bestGlobal`

: index of the best Pm and lambda among all results (including non-convergent results)`convergenceThreshold`

: threshold of convergence error (i.e.`eps`

)`maxIteration`

: maximum iteration number allowed (i.e.`iter.n`

)`Pm.vect`

: working vector of tunning parameter Pm`lam.vect`

: working vector of tunning parameter lambda`scale.info`

: scaling information of y.vect, M, and COV to transfer beta estimate back to original scale`sis.name`

: name (id) of genomic mark from sure independent screening results, truncated at`pm.max`

`convergeMessage`

: "Converged!", "Not converged!", or "Conditionally converged!

1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ```
pgsfit.obj(grid.err, lam.sel.vect, beta.shrink.corr.list, var.sand.corr.list,
hat.R.list, flag.stop.corr.vect, iter.n.corr.vect, best.ind, bestall.ind, eps,
iter.n, Pm.vect, lam.vect, scale.info, sis.dn, ConvergeMessage)
## S3 method for class 'pgsfit.obj'
print(pgsfit.obj)
## S3 method for class 'pgsfit.obj'
plot(pgsfit.obj, IQR.times = 1.5, text.size = 4,
xlab.size = 14, ylab.size = 14)
## S3 method for class 'pgsfit.obj'
coef(pgsfit.obj, pm.ind = NULL, p.threshold = 0.05,
nonzero = TRUE)
``` |

see `pgsfit`

to run PGS algorithm and obtain `pgsfit.obj`

object.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ```
## Print PGS object:
pgsfit.obj
## Plot PGS object (a heat map visualizes the grid search errors):
plot(pgsfit.obj)
#Other parameters:
#IQR.times: cross-validation errors greater than IQR.times * IQR of the errors will be replaced by "NA" (represented by grey blocks). Default = 1.5.
#text.size: size of the text in grid. Default = 4.
#xlab.size: size of the x-axis labels. Default = 14.
#ylab.size: size of the y-axis labels. Default = 14.
## Return coefficients from PGS object:
coef(pgsfit.obj)
#Other parameters:
#whcih: an interger between 1 to pm.n specifying results at which Pm level to be returned. Defaul = NULL. If NULL, return the best results.
#p.threshold: threshold of p-values to filter out non-significant variables. Default = 0.05.
#nonzero: logical. If TRUE, only variables with non-zero beta results are returned. Default = TRUE.
#For more information, please visit: https://github.com/YinanZheng/PGS/wiki/Example:-miRNA-expression-and-lung-function
``` |

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.