Skip to content

Commit 9ae8a92

Browse files
Merge pull request neelsoumya#17 from ESCRI11/v2.3.0task4
ds.finegray correct example
2 parents c5fc1df + 8aefa2d commit 9ae8a92

File tree

2 files changed

+66
-20
lines changed

2 files changed

+66
-20
lines changed

R/ds.finegray.R

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,29 +25,52 @@
2525
#' \dontrun{
2626
#' ## Version 1.0.0
2727
#'
28-
#' # connecting to the Opal servers
28+
#' # First, set up the connection to the Opal server
2929
#' builder <- DSI::newDSLoginBuilder()
3030
#' builder$append(server = "study1",
3131
#' url = "http://192.168.56.100:8080/",
32-
#' user = "administrator", password = "datashield_test&",
33-
#' table = "SURVIVAL.EXPAND_NO_MISSING1", driver = "OpalDriver")
32+
#' user = "administrator",
33+
#' password = "datashield_test&",
34+
#' table = "SURVIVAL.EXPAND_WITH_MISSING1",
35+
#' driver = "OpalDriver")
3436
#' logindata <- builder$build()
3537
#'
3638
#' connections <- DSI::datashield.login(logins = logindata, assign = TRUE, symbol = "D")
3739
#'
40+
#' ds.mice(data = 'D', m = 5, method = 'rf', newobj_df = 'D2', seed = 'fixed', newobj_mids = "imputed_mids")
41+
#'
42+
#' ds.asNumeric(x.name = "D2.1$cens",
43+
#' newobj = "EVENT",
44+
#' datasources = connections)
45+
#'
46+
#' ds.asNumeric(x.name = "D2.1$survtime",
47+
#' newobj = "SURVTIME",
48+
#' datasources = connections)
49+
#'
50+
#' ds.asNumeric(x.name = "D2.1$starttime",
51+
#' newobj = "STARTTIME",
52+
#' datasources = connections)
53+
#'
54+
#' ds.asNumeric(x.name = "D2.1$endtime",
55+
#' newobj = "ENDTIME",
56+
#' datasources = connections)
57+
#'
58+
#' dsSurvivalClient::ds.Surv(time='STARTTIME', time2='ENDTIME',
59+
#' event = 'EVENT', objectname='surv_object')
60+
#'
3861
#' # Create a Fine-Gray dataset for competing risks analysis
39-
#' ds.finegray(formula = "Surv(time, status) ~ age + sex",
40-
#' data = "D",
62+
#' ds.finegray(formula = "Surv(endtime, cens) ~ age.60 + female",
63+
#' data = "D2.1",
4164
#' etype = 1,
4265
#' newobj = "fg_data")
4366
#'
4467
#' # Now use the created dataset for a weighted Cox model
45-
#' ds.coxph.SLMAassign("Surv(fgstart, fgstop, fgstatus) ~ age + sex",
46-
#' weights = "fgwt",
47-
#' data = "fg_data",
48-
#' newobj = "coxph_model")
68+
#' ds.coxphSLMAassign(formula = "survival::Surv(fgstart, fgstop, fgstatus) ~ age.60 + female",
69+
#' dataName = "fg_data",
70+
#' objectname = "coxph_model")
71+
#'
4972
#'
50-
#' # Clear the Datashield R sessions and logout
73+
#' # When finished, clear the session and logout
5174
#' datashield.logout(connections)
5275
#' }
5376
#'

man/ds.finegray.Rd

Lines changed: 33 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)