R : Copyright 2005, The R Foundation for Statistical Computing Version 2.1.1 (2005-06-20), ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for a HTML browser interface to help. Type 'q()' to quit R. > ### *
> ### > attach(NULL, name = "CheckExEnv") > assign(".CheckExEnv", as.environment(2), pos = length(search())) # base > ## add some hooks to label plot pages for base and grid graphics > setHook("plot.new", ".newplot.hook") > setHook("persp", ".newplot.hook") > setHook("grid.newpage", ".gridplot.hook") > > assign("cleanEx", + function(env = .GlobalEnv) { + rm(list = ls(envir = env, all.names = TRUE), envir = env) + RNGkind("default", "default") + set.seed(1) + options(warn = 1) + delayedAssign("T", stop("T used instead of TRUE"), + assign.env = .CheckExEnv) + delayedAssign("F", stop("F used instead of FALSE"), + assign.env = .CheckExEnv) + sch <- search() + newitems <- sch[! sch %in% .oldSearch] + for(item in rev(newitems)) + eval(substitute(detach(item), list(item=item))) + missitems <- .oldSearch[! .oldSearch %in% sch] + if(length(missitems)) + warning("items ", paste(missitems, collapse=", "), + " have been removed from the search path") + }, + env = .CheckExEnv) > assign("..nameEx", "__{must remake R-ex/*.R}__", env = .CheckExEnv) # for now > assign("ptime", proc.time(), env = .CheckExEnv) > grDevices::postscript("superpc-Examples.ps") > assign("par.postscript", graphics::par(no.readonly = TRUE), env = .CheckExEnv) > options(contrasts = c(unordered = "contr.treatment", ordered = "contr.poly")) > options(warn = 1) > library('superpc') > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "superpc.cv" > > ### * superpc.cv > > flush(stderr()); flush(stdout()) > > ### Name: superpc.cv > ### Title: Cross-validation for supervised principal components > ### Aliases: superpc.cv > ### Keywords: regression survival > > ### ** Examples > > set.seed(332) > x<-matrix(rnorm(1000*40),ncol=40) > y<-10+svd(x[1:60,])$v[,1]+ .1*rnorm(40) > censoring.status<- sample(c(rep(1,30),rep(0,10))) > > featurenames <- paste("feature",as.character(1:1000),sep="") > data<-list(x=x,y=y, censoring.status=censoring.status, featurenames=featurenames) > > a<- superpc.train(data, type="survival") > aa<-superpc.cv(a,data) fold= 1 1Loading required package: survival Loading required package: splines 234567891011121314151617181920 fold= 2 1234567891011121314151617181920 fold= 3 1234567891011121314151617181920 fold= 4 1234567891011121314151617181920 fold= 5 1234567891011121314151617181920 fold= 6 1234567891011121314151617181920 fold= 7 1234567891011121314151617181920 fold= 8 1234567891011121314151617181920 fold= 9 1234567891011121314151617181920 fold= 10 1234567891011121314151617181920 > > > > cleanEx(); ..nameEx <- "superpc.decorrelate" > > ### * superpc.decorrelate > > flush(stderr()); flush(stdout()) > > ### Name: superpc.decorrelate > ### Title: Decorrelate features with respect to competing predictors > ### Aliases: superpc.decorrelate > ### Keywords: regression survival > > ### ** Examples > > set.seed(332) > #generate some data > > x<-matrix(rnorm(1000*20),ncol=20) > y<-10+svd(x[1:30,])$v[,1]+ .1*rnorm(20) > ytest<-10+svd(x[1:30,])$v[,1]+ .1*rnorm(20) > censoring.status<- sample(c(rep(1,17),rep(0,3))) > censoring.status.test<- sample(c(rep(1,17),rep(0,3))) > competing.predictors=list(pred1=rnorm(20), pred2=as.factor(sample(c(1,2),replace=TRUE,size=20))) > featurenames <- paste("feature",as.character(1:1000),sep="") > > # decorrelate x > foo<-superpc.decorrelate(x,competing.predictors) > > xnew<-t(foo$res) > > # now use xnew in superpc > > data<-list(x=xnew,y=y, censoring.status=censoring.status, featurenames=featurenames) > > a<- superpc.train(data, type="survival") > > # etc. Remember to decorrelate test data in the same way, before making predictions. > > > > cleanEx(); ..nameEx <- "superpc.fit.to.outcome" > > ### * superpc.fit.to.outcome > > flush(stderr()); flush(stdout()) > > ### Name: superpc.fit.to.outcome > ### Title: Fit predictive model using outcome of supervised principal > ### components > ### Aliases: superpc.fit.to.outcome > ### Keywords: regression survival > > ### ** Examples > > set.seed(332) > #generate some data > > x<-matrix(rnorm(1000*20),ncol=20) > y<-10+svd(x[1:30,])$v[,1]+ .1*rnorm(20) > ytest<-10+svd(x[1:30,])$v[,1]+ .1*rnorm(20) > censoring.status<- sample(c(rep(1,17),rep(0,3))) > censoring.status.test<- sample(c(rep(1,17),rep(0,3))) > > > featurenames <- paste("feature",as.character(1:1000),sep="") > data<-list(x=x,y=y, censoring.status=censoring.status, featurenames=featurenames) > data.test<-list(x=x,y=ytest, censoring.status=censoring.status.test, featurenames= featurenames) > > > a<- superpc.train(data, type="survival") > > fit<- superpc.predict(a, data, data.test, threshold=1.0, n.components=1, prediction.type="continuous") Loading required package: survival Loading required package: splines Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge > > superpc.fit.to.outcome(a, data, fit$v.pred) Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge Call: coxph(formula = Surv(y, censoring.status) ~ ., data = temp.list, control = coxph.control(iter.max = iter.max)) n= 20 coef exp(coef) se(coef) z p score.1 6.13 460 1.58 3.89 1e-04 exp(coef) exp(-coef) lower .95 upper .95 score.1 460 0.00217 20.9 10128 Rsquare= 0.834 (max possible= 0.977 ) Likelihood ratio test= 35.9 on 1 df, p=2.04e-09 Wald test = 15.1 on 1 df, p=0.000101 Score (logrank) test = 21.7 on 1 df, p=3.18e-06 $results Call: coxph(formula = Surv(y, censoring.status) ~ ., data = temp.list, control = coxph.control(iter.max = iter.max)) coef exp(coef) se(coef) z p score.1 6.13 460 1.58 3.89 1e-04 Likelihood ratio test=35.9 on 1 df, p=2.04e-09 n= 20 $teststat.table test statistic df p-value [1,] 35.9 1 2.04e-09 $coeftable coef exp(coef) se(coef) z p score.1 6.13 460 1.58 3.89 1e-04 > > > > cleanEx(); ..nameEx <- "superpc.listfeatures" > > ### * superpc.listfeatures > > flush(stderr()); flush(stdout()) > > ### Name: superpc.listfeatures > ### Title: Return a list of the important predictors > ### Aliases: superpc.listfeatures > ### Keywords: regression survival > > ### ** Examples > > #generate some data > > x<-matrix(rnorm(1000*40),ncol=40) > y<-10+svd(x[1:60,])$v[,1]+ .1*rnorm(40) > ytest<-10+svd(x[1:60,])$v[,1]+ .1*rnorm(40) > censoring.status<- sample(c(rep(1,30),rep(0,10))) > censoring.status.test<- sample(c(rep(1,30),rep(0,10))) > featurenames <- paste("feature",as.character(1:1000),sep="") > data<-list(x=x,y=y, censoring.status=censoring.status, featurenames=featurenames) > data.test<-list(x=x,y=ytest, censoring.status=censoring.status.test, featurenames= featurenames) > > a<- superpc.train(data, type="survival") > > fit<- superpc.predict(a, data, data.test, threshold=1.0, n.components=1, prediction.type="continuous") Loading required package: survival Loading required package: splines Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge > > fit.red<- superpc.predict.red(a,data, data.test, .6) Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 1234567891011121314151617181920 > superpc.listfeatures(data, a, fit.red, num.features=20) Importance-score Raw-score Name [1,] "8.502" "1.816" "feature632" [2,] "-7.935" "-2.131" "feature59" [3,] "-7.367" "-1.884" "feature60" [4,] "-7.17" "-1.769" "feature732" [5,] "6.43" "1.801" "feature322" [6,] "-6.294" "-1.081" "feature294" [7,] "6.265" "1.262" "feature216" [8,] "5.981" "1.492" "feature2" [9,] "5.843" "1.31" "feature441" [10,] "5.642" "1.446" "feature874" [11,] "5.624" "1.091" "feature298" [12,] "5.368" "1.249" "feature133" [13,] "-5.248" "-1.071" "feature783" [14,] "5.223" "1.23" "feature291" [15,] "-5.098" "-0.985" "feature134" [16,] "5.097" "1.228" "feature218" [17,] "-5.076" "-0.977" "feature425" [18,] "4.916" "0.928" "feature847" [19,] "-4.907" "-1.255" "feature861" [20,] "4.891" "1.205" "feature507" > > > > > cleanEx(); ..nameEx <- "superpc.lrtest.curv" > > ### * superpc.lrtest.curv > > flush(stderr()); flush(stdout()) > > ### Name: superpc.lrtest.curv > ### Title: Compute values of likelihood ratio test from supervised > ### principal components fit > ### Aliases: superpc.lrtest.curv > ### Keywords: regression survival > > ### ** Examples > > set.seed(332) > #generate some data > > x<-matrix(rnorm(1000*20),ncol=20) > y<-10+svd(x[1:30,])$v[,1]+ .1*rnorm(20) > ytest<-10+svd(x[1:30,])$v[,1]+ .1*rnorm(20) > censoring.status<- sample(c(rep(1,17),rep(0,3))) > censoring.status.test<- sample(c(rep(1,17),rep(0,3))) > > featurenames <- paste("feature",as.character(1:1000),sep="") > data<-list(x=x,y=y, censoring.status=censoring.status, featurenames=featurenames) > data.test<-list(x=x,y=ytest, censoring.status=censoring.status.test, featurenames= featurenames) > > a<- superpc.train(data, type="survival") > > fit<- superpc.predict(a, data, data.test, threshold=1.0, n.components=1, prediction.type="continuous") Loading required package: survival Loading required package: splines Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge > > aa<- superpc.lrtest.curv(a, data, data.test) 1234Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 5Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 6Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 7Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 8Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 9Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 10Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 11Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 12Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 13Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 14Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 15Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 1617Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 181920 > superpc.plot.lrtest(aa) > > > > cleanEx(); ..nameEx <- "superpc.plot.lrtest" > > ### * superpc.plot.lrtest > > flush(stderr()); flush(stdout()) > > ### Name: superpc.plot.lrtest > ### Title: Plot likelhiood ratio test statistics > ### Aliases: superpc.plot.lrtest > ### Keywords: regression survival > > ### ** Examples > > > set.seed(332) > #generate some data > > x<-matrix(rnorm(1000*40),ncol=40) > y<-10+svd(x[1:60,])$v[,1]+ .1*rnorm(40) > ytest<-10+svd(x[1:60,])$v[,1]+ .1*rnorm(40) > censoring.status<- sample(c(rep(1,30),rep(0,10))) > censoring.status.test<- sample(c(rep(1,30),rep(0,10))) > > featurenames <- paste("feature",as.character(1:1000),sep="") > data<-list(x=x,y=y, censoring.status=censoring.status, featurenames=featurenames) > data.test<-list(x=x,y=ytest, censoring.status=censoring.status.test, featurenames= featurenames) > > > a<- superpc.train(data, type="survival") > aa<-superpc.cv(a, data) fold= 1 1Loading required package: survival Loading required package: splines 234567891011121314151617181920 fold= 2 1234567891011121314151617181920 fold= 3 1234567891011121314151617181920 fold= 4 1234567891011121314151617181920 fold= 5 1234567891011121314151617181920 fold= 6 1234567891011121314151617181920 fold= 7 1234567891011121314151617181920 fold= 8 1234567891011121314151617181920 fold= 9 1234567891011121314151617181920 fold= 10 1234567891011121314151617181920 > > fit<- superpc.predict(a, data, data.test, threshold=1.0, n.components=1, prediction.type="continuous") Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge > > bb<-superpc.lrtest.curv(a,data,data.test) 12345Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 6Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 7Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 8Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 9Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 10Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 11Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 12Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 13Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 14Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 151617181920 > > superpc.plot.lrtest(bb) > > > > > cleanEx(); ..nameEx <- "superpc.plotcv" > > ### * superpc.plotcv > > flush(stderr()); flush(stdout()) > > ### Name: superpc.plotcv > ### Title: Plot output from superpc.cv > ### Aliases: superpc.plotcv > ### Keywords: regression survival > > ### ** Examples > > set.seed(332) > x<-matrix(rnorm(1000*40),ncol=40) > y<-10+svd(x[1:60,])$v[,1]+ .1*rnorm(40) > censoring.status<- sample(c(rep(1,30),rep(0,10))) > > featurenames <- paste("feature",as.character(1:1000),sep="") > data<-list(x=x,y=y, censoring.status=censoring.status, featurenames=featurenames) > > a<- superpc.train(data, type="survival") > aa<-superpc.cv(a,data) fold= 1 1Loading required package: survival Loading required package: splines 234567891011121314151617181920 fold= 2 1234567891011121314151617181920 fold= 3 1234567891011121314151617181920 fold= 4 1234567891011121314151617181920 fold= 5 1234567891011121314151617181920 fold= 6 1234567891011121314151617181920 fold= 7 1234567891011121314151617181920 fold= 8 1234567891011121314151617181920 fold= 9 1234567891011121314151617181920 fold= 10 1234567891011121314151617181920 > > superpc.plotcv(aa) [1] TRUE > > > > > cleanEx(); ..nameEx <- "superpc.plotred.lrtest" > > ### * superpc.plotred.lrtest > > flush(stderr()); flush(stdout()) > > ### Name: superpc.plotred.lrtest > ### Title: Plot likelihood ratio test statistics from supervised principal > ### components predictor > ### Aliases: superpc.plotred.lrtest > ### Keywords: regression survival > > ### ** Examples > > set.seed(332) > #generate some data > > x<-matrix(rnorm(1000*40),ncol=40) > y<-10+svd(x[1:60,])$v[,1]+ .1*rnorm(40) > ytest<-10+svd(x[1:60,])$v[,1]+ .1*rnorm(40) > censoring.status<- sample(c(rep(1,30),rep(0,10))) > censoring.status.test<- sample(c(rep(1,30),rep(0,10))) > > featurenames <- paste("feature",as.character(1:1000),sep="") > data<-list(x=x,y=y, censoring.status=censoring.status, featurenames=featurenames) > data.test<-list(x=x,y=ytest, censoring.status=censoring.status.test, featurenames= featurenames) > > a<- superpc.train(data, type="survival") > aa<-superpc.cv(a, data) fold= 1 1Loading required package: survival Loading required package: splines 234567891011121314151617181920 fold= 2 1234567891011121314151617181920 fold= 3 1234567891011121314151617181920 fold= 4 1234567891011121314151617181920 fold= 5 1234567891011121314151617181920 fold= 6 1234567891011121314151617181920 fold= 7 1234567891011121314151617181920 fold= 8 1234567891011121314151617181920 fold= 9 1234567891011121314151617181920 fold= 10 1234567891011121314151617181920 > > fit<- superpc.predict(a, data, data.test, threshold=1.0, n.components=1, prediction.type="continuous") Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge > > fit.red<- superpc.predict.red(a, data, data.test, .6) Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 1234567891011121314151617181920 > > fit.redcv<- superpc.predict.red.cv(fit.red, aa, data, .6) 1 Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 1234567891011121314151617181920 2 Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 1234567891011121314151617181920 3 Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 1234567891011121314151617181920 4 Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 1234567891011121314151617181920 5 Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 1234567891011121314151617181920 6 Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 1234567891011121314151617181920 7 Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 1234567891011121314151617181920 8 Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 1234567891011121314151617181920 9 Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 1234567891011121314151617181920 10 Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 1234567891011121314151617181920 > > superpc.plotred.lrtest(fit.redcv) [1] TRUE > > > > > cleanEx(); ..nameEx <- "superpc.predict" > > ### * superpc.predict > > flush(stderr()); flush(stdout()) > > ### Name: superpc.predict > ### Title: Form principal components predictor from a trained superpc > ### object > ### Aliases: superpc.predict > ### Keywords: regression survival > > ### ** Examples > > set.seed(332) > #generate some data > > x<-matrix(rnorm(1000*20),ncol=20) > y<-10+svd(x[1:30,])$v[,1]+ .1*rnorm(20) > ytest<-10+svd(x[1:30,])$v[,1]+ .1*rnorm(20) > censoring.status<- sample(c(rep(1,17),rep(0,3))) > censoring.status.test<- sample(c(rep(1,17),rep(0,3))) > > featurenames <- paste("feature",as.character(1:1000),sep="") > data<-list(x=x,y=y, censoring.status=censoring.status, featurenames=featurenames) > data.test<-list(x=x,y=ytest, censoring.status=censoring.status.test, featurenames= featurenames) > > a<- superpc.train(data, type="survival") > > fit<- superpc.predict(a, data, data.test, threshold=1.0, n.components=1) Loading required package: survival Loading required package: splines Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge > > plot(fit$v.pred,ytest) > > > > > cleanEx(); ..nameEx <- "superpc.predict.red" > > ### * superpc.predict.red > > flush(stderr()); flush(stdout()) > > ### Name: superpc.predict.red > ### Title: Feature selection for supervised principal components > ### Aliases: superpc.predict.red > ### Keywords: regression survival > > ### ** Examples > > > set.seed(332) > #generate some data > > x<-matrix(rnorm(1000*40),ncol=40) > y<-10+svd(x[1:60,])$v[,1]+ .1*rnorm(40) > ytest<-10+svd(x[1:60,])$v[,1]+ .1*rnorm(40) > censoring.status<- sample(c(rep(1,30),rep(0,10))) > censoring.status.test<- sample(c(rep(1,30),rep(0,10))) > > featurenames <- paste("feature",as.character(1:1000),sep="") > data<-list(x=x,y=y, censoring.status=censoring.status, featurenames=featurenames) > data.test<-list(x=x,y=ytest, censoring.status=censoring.status.test, featurenames= featurenames) > > > a<- superpc.train(data, type="survival") > > fit<- superpc.predict(a, data, data.test, threshold=1.0, n.components=1, prediction.type="continuous") Loading required package: survival Loading required package: splines Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge > > fit.red<- superpc.predict.red(a,data, data.test, threshold=.6) Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 1234567891011121314151617181920 > superpc.plotred.lrtest(fit.red) [1] TRUE > > > > > cleanEx(); ..nameEx <- "superpc.predict.red.cv" > > ### * superpc.predict.red.cv > > flush(stderr()); flush(stdout()) > > ### Name: superpc.predict.red.cv > ### Title: Cross-validation of feature selection for supervised principal > ### components > ### Aliases: superpc.predict.red.cv > ### Keywords: regression survival > > ### ** Examples > > > set.seed(332) > #generate some data > > x<-matrix(rnorm(1000*40),ncol=40) > y<-10+svd(x[1:60,])$v[,1]+ .1*rnorm(40) > ytest<-10+svd(x[1:60,])$v[,1]+ .1*rnorm(40) > censoring.status<- sample(c(rep(1,30),rep(0,10))) > censoring.status.test<- sample(c(rep(1,30),rep(0,10))) > > featurenames <- paste("feature",as.character(1:1000),sep="") > data<-list(x=x,y=y, censoring.status=censoring.status, featurenames=featurenames) > data.test<-list(x=x,y=ytest, censoring.status=censoring.status.test, featurenames= featurenames) > > > a<- superpc.train(data, type="survival") > aa<-superpc.cv(a, data) fold= 1 1Loading required package: survival Loading required package: splines 234567891011121314151617181920 fold= 2 1234567891011121314151617181920 fold= 3 1234567891011121314151617181920 fold= 4 1234567891011121314151617181920 fold= 5 1234567891011121314151617181920 fold= 6 1234567891011121314151617181920 fold= 7 1234567891011121314151617181920 fold= 8 1234567891011121314151617181920 fold= 9 1234567891011121314151617181920 fold= 10 1234567891011121314151617181920 > > fit<- superpc.predict(a, data, data.test, threshold=1.0, n.components=1, prediction.type="continuous") Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge > > fit.red<- superpc.predict.red(a,data, data.test, threshold= .6) Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 1234567891011121314151617181920 > > fit.redcv<- superpc.predict.red.cv(fit.red, aa, data, threshold= .6) 1 Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 1234567891011121314151617181920 2 Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 1234567891011121314151617181920 3 Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 1234567891011121314151617181920 4 Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 1234567891011121314151617181920 5 Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 1234567891011121314151617181920 6 Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 1234567891011121314151617181920 7 Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 1234567891011121314151617181920 8 Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 1234567891011121314151617181920 9 Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 1234567891011121314151617181920 10 Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge 1234567891011121314151617181920 > > superpc.plotred.lrtest(fit.redcv) [1] TRUE > > > > > cleanEx(); ..nameEx <- "superpc.predictionplot" > > ### * superpc.predictionplot > > flush(stderr()); flush(stdout()) > > ### Name: superpc.predictionplot > ### Title: Plot outcome predictions from superpc > ### Aliases: superpc.predictionplot > ### Keywords: regression survival > > ### ** Examples > > set.seed(332) > x<-matrix(rnorm(1000*40),ncol=40) > y<-10+svd(x[1:60,])$v[,1]+ .1*rnorm(40) > censoring.status<- sample(c(rep(1,30),rep(0,10))) > > featurenames <- paste("feature",as.character(1:1000),sep="") > data<-list(x=x,y=y, censoring.status=censoring.status, featurenames=featurenames) > > a<- superpc.train(data, type="survival") > > superpc.predictionplot(a,data,data,threshold=1) Loading required package: survival Loading required package: splines Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge > > > > > cleanEx(); ..nameEx <- "superpc.rainbowplot" > > ### * superpc.rainbowplot > > flush(stderr()); flush(stdout()) > > ### Name: superpc.rainbowplot > ### Title: Make rainbow plot of superpc and compeiting predictors > ### Aliases: superpc.rainbowplot > ### Keywords: regression survival > > ### ** Examples > > set.seed(332) > x<-matrix(rnorm(1000*40),ncol=40) > y<-10+svd(x[1:60,])$v[,1]+ 5*rnorm(40) > censoring.status<- sample(c(rep(1,30),rep(0,10))) > > ytest<- 10+svd(x[1:60,])$v[,1]+ 5*rnorm(40) > censoring.status.test<- sample(c(rep(1,30),rep(0,10))) > > competing.predictors.test=list(pred1=rnorm(40), pred2=as.factor(sample(c(1,2),replace + =TRUE,size=40))) > > featurenames <- paste("feature",as.character(1:1000),sep="") > data<-list(x=x,y=y, censoring.status=censoring.status, featurenames=featurenames) > > data.test=list(x=x,y=ytest, censoring.status=censoring.status.test, featurenames=featurenames) > > sample.labels=paste("te",as.character(1:40),sep="") > > a<- superpc.train(data, type="survival") > pred=superpc.predict(a,data,data.test,threshold=.25, n.components=1)$v.pred Loading required package: survival Loading required package: splines > > superpc.rainbowplot(data,pred, sample.labels,competing.predictors=competing.predictors.test) NULL > > > > > cleanEx(); ..nameEx <- "superpc.train" > > ### * superpc.train > > flush(stderr()); flush(stdout()) > > ### Name: superpc.train > ### Title: Prediction by supervised principal components > ### Aliases: superpc.train > ### Keywords: regression survival > > ### ** Examples > > #generate some example data > set.seed(332) > x<-matrix(rnorm(1000*40),ncol=40) > y<-10+svd(x[1:60,])$v[,1]+ .1*rnorm(40) > censoring.status<- sample(c(rep(1,30),rep(0,10))) > > featurenames <- paste("feature",as.character(1:1000),sep="") > data<-list(x=x,y=y, censoring.status=censoring.status, featurenames=featurenames) > > a<- superpc.train(data, type="survival") > > > > ### *