|
25 | 25 | #' \dontrun{ |
26 | 26 | #' ## Version 1.0.0 |
27 | 27 | #' |
28 | | -#' # connecting to the Opal servers |
| 28 | +#' # First, set up the connection to the Opal server |
29 | 29 | #' builder <- DSI::newDSLoginBuilder() |
30 | 30 | #' builder$append(server = "study1", |
31 | 31 | #' 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") |
34 | 36 | #' logindata <- builder$build() |
35 | 37 | #' |
36 | 38 | #' connections <- DSI::datashield.login(logins = logindata, assign = TRUE, symbol = "D") |
37 | 39 | #' |
| 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 | +#' |
38 | 61 | #' # 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", |
41 | 64 | #' etype = 1, |
42 | 65 | #' newobj = "fg_data") |
43 | 66 | #' |
44 | 67 | #' # 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 | +#' |
49 | 72 | #' |
50 | | -#' # Clear the Datashield R sessions and logout |
| 73 | +#' # When finished, clear the session and logout |
51 | 74 | #' datashield.logout(connections) |
52 | 75 | #' } |
53 | 76 | #' |
|
0 commit comments