R version 4.5.0 RC (2025-04-04 r88113 ucrt) -- "How About a Twenty-Six" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 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 an HTML browser interface to help. Type 'q()' to quit R. > library(plasma) > # Repeat basic stuff from first test > fls <- try(loadESCAdata()) > if (inherits(fls, "try-error")) { + stop("Unable to load data from remote server.") + } > ls() [1] "fls" > MO <- with(plasmaEnv, prepareMultiOmics(assemble, Outcome)) > train <- rep(c(TRUE, FALSE), times = c(112, 185-112)) > MO2 <- MO[, train] > ## Fit a survival model on a single data set on the MultiOmics object > fitted <- fitSingleModel(MO2, "ClinicalBin", "Days", "vital_status", "dead") ____************************************************____ ____There are some NAs in X but not in Y____ ____Component____ 1 ____ ____Component____ 2 ____ ____Component____ 3 ____ ____Predicting X with NA in X and not in Y____ ****________________________________________________**** > summary(fitted) Risk Model: Call: coxph(formula = formula(paste("Surv(", timevar, ",", eventvar, "== \"", eventvalue, "\") ~ Risk", sep = "")), data = Xout) n= 112, number of events= 49 coef exp(coef) se(coef) z Pr(>|z|) Risk 1.0000 2.7183 0.1319 7.582 3.4e-14 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 exp(coef) exp(-coef) lower .95 upper .95 Risk 2.718 0.3679 2.099 3.52 Concordance= 0.814 (se = 0.034 ) Likelihood ratio test= 63.67 on 1 df, p=1e-15 Wald test = 57.49 on 1 df, p=3e-14 Score (logrank) test = 52.22 on 1 df, p=5e-13 SplitModel: Call: coxph(formula = formula(paste("Surv(", timevar, ",", eventvar, "==\"", eventvalue, "\") ~ Split", sep = "")), data = Xout) n= 112, number of events= 49 coef exp(coef) se(coef) z Pr(>|z|) Split 2.3571 10.5606 0.4286 5.5 3.8e-08 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 exp(coef) exp(-coef) lower .95 upper .95 Split 10.56 0.09469 4.559 24.46 Concordance= 0.725 (se = 0.029 ) Likelihood ratio test= 44.08 on 1 df, p=3e-11 Wald test = 30.25 on 1 df, p=4e-08 Score (logrank) test = 42.95 on 1 df, p=6e-11 PLS Model: n= 112, number of events= 49 coef exp(coef) se(coef) z Pr(>|z|) tt.1 0.75268 2.12269 0.11444 6.577 4.79e-11 *** tt.2 0.61475 1.84920 0.11538 5.328 9.92e-08 *** tt.3 0.22720 1.25508 0.08479 2.679 0.00737 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 exp(coef) exp(-coef) lower .95 upper .95 tt.1 2.123 0.4711 1.696 2.656 tt.2 1.849 0.5408 1.475 2.318 tt.3 1.255 0.7968 1.063 1.482 Concordance= 0.814 (se = 0.034 ) Likelihood ratio test= 63.67 on 3 df, p=1e-13 Wald test = 57.49 on 3 df, p=2e-12 Score (logrank) test = 52.58 on 3 df, p=2e-11 > p <- predict(fitted) > summary(p) Min. 1st Qu. Median Mean 3rd Qu. Max. -4.6400 -0.9655 0.1312 0.0000 0.8547 4.5559 > plot(fitted, xlab = "Time (Days)", legloc = "topright", main = "Training Data") > ## Make sure we can predict on new data > testobj <- MO[, !train] > summary(testobj) Datasets: ClinicalBin ClinicalCont MAF Meth450 miRSeq mRNASeq RPPA [1,] 53 6 566 1454 926 2520 192 [2,] 73 73 73 73 73 73 73 Outcomes: patient_id vital_status days_to_death days_to_last_followup a4a1 : 1 alive:45 Min. : 47.0 Min. : 4.0 a4a2 : 1 dead :28 1st Qu.: 208.0 1st Qu.: 365.0 a4a3 : 1 Median : 317.0 Median : 388.0 a4a4 : 1 Mean : 402.8 Mean : 497.2 a4a5 : 1 3rd Qu.: 554.0 3rd Qu.: 549.0 a4a6 : 1 Max. :1405.0 Max. :1641.0 (Other):67 NA's :45 NA's :28 Days Min. : 4 1st Qu.: 247 Median : 383 Mean : 461 3rd Qu.: 553 Max. :1641 > ## How do we get rid of the "Missing value" information? > pre <- predict(fitted, newdata = testobj) > prer <- predict(fitted, newdata = testobj, type = "risk") > pres <- predict(fitted, newdata = testobj, type = "split") > pairs(cbind(pre, prer, pres)) > > ## Things that should fail: > p <- try( predict(fitted, "risk") ) Error in newdata@data : no applicable method for `@` applied to an object of class "character" > p <- try( predict(fitted, type = "riak") ) Error in match.arg(type) : 'arg' should be one of "components", "risk", "split", "survfit" > > proc.time() user system elapsed 7.00 1.46 9.82