You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here the parameters **num_cf** is the number of repeatation, **n_split** is the number of splits and **seed** can be usefull for comparing different methods.
The parallelization is very usefull while simulation study is conducted for large number of times. The steps are similar to case 1, except some additional steps-
61
99
100
+
1. Do the steps 1-3 that is described in case 1 under parallel packages.
62
101
63
102
103
+
```{r}
64
104
############### With parallelization ##############
65
105
library(parallel)
66
106
cl <- makeCluster(detectCores())
@@ -73,61 +113,24 @@ parallel::clusterEvalQ(cl, {
73
113
require(tibble)
74
114
require(SuperLearner)
75
115
76
-
#Logistic Regression
77
-
78
-
SL.glm.DCDR <- function(...){
79
-
SL.glm(...)
80
-
}
81
-
82
-
#4 degree GAM
83
-
SL.gam4.DCDR <- function(...){
84
-
SL.gam(..., deg.gam=4)
85
-
}
86
-
87
-
df = data # data is from Crossfit package
88
-
89
-
exposure="statin"
90
-
outcome="Y"
91
-
92
-
93
-
covarsT <- c("age", "ldl_log", "risk_score") # covariate for exposure
94
-
covarsO <- c("age", "ldl_log", "risk_score") # covariate for outcome
0 commit comments