ds.survfit | R Documentation |
Creates a server side Survival fit (survfit) object,
ds.survfit(formula = NULL, objectname = NULL, datasources = NULL)
formula |
character string specifying the formula to be used in survival::survfit() on the server-side. For more information see Details. |
objectname |
character string of name of new server-side object which will store object of class survival::Surv() |
datasources |
a list of |
This is a function that creates a server side survfit object. This is to be used in plotting results from survival analysis using the Cox proportional hazards model.
Server function called: survfitDS
.
SurvDS
returns to the client-side a Surv() obejct for use in
the Cox proportional hazards model
Soumya Banerjee and Tom Bishop, 2021
## Not run:
## Version 2.0
# connecting to the Opal servers
require('DSI')
require('DSOpal')
require('dsBaseClient')
builder <- DSI::newDSLoginBuilder()
builder$append(server = "study1",
url = "http://192.168.56.100:8080/",
user = "administrator", password = "datashield_test&",
table = "SURVIVAL.EXPAND_NO_MISSING1", driver = "OpalDriver")
builder$append(server = "study2",
url = "http://192.168.56.100:8080/",
user = "administrator", password = "datashield_test&",
table = "SURVIVAL.EXPAND_NO_MISSING2", driver = "OpalDriver")
builder$append(server = "study3",
url = "http://192.168.56.100:8080/",
user = "administrator", password = "datashield_test&",
table = "SURVIVAL.EXPAND_NO_MISSING3", driver = "OpalDriver")
logindata <- builder$build()
connections <- DSI::datashield.login(logins = logindata, assign = TRUE, symbol = "D")
# make sure that the outcome is numeric
ds.asNumeric(x.name = "D$cens",
newobj = "EVENT",
datasources = connections)
ds.asNumeric(x.name = "D$survtime",
newobj = "SURVTIME",
datasources = connections)
dsSurvivalClient::ds.Surv('SURVTIME', 'EVENT', 'surv_object')
dsSurvivalClient::ds.coxph.SLMA(formula = 'surv_object~D$age+D$female')
dsSurvivalClient::ds.survfit(formula='surv_object',object='survfit_object')
# clear the Datashield R sessions and logout
datashield.logout(connections)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.