@@ -690,7 +690,7 @@ DoubleML = R6Class("DoubleML",
690690 message(" fit() not yet called." )
691691 } else {
692692 k = length(self $ coef )
693- table = matrix (NA , ncol = 4 , nrow = k )
693+ table = matrix (NA_real_ , ncol = 4 , nrow = k )
694694 rownames(table ) = names(self $ coef )
695695 colnames(table ) = c(" Estimate." , " Std. Error" , " t value" , " Pr(>|t|)" )
696696 table [, 1 ] = self $ coef
@@ -700,9 +700,8 @@ DoubleML = R6Class("DoubleML",
700700 private $ summary_table = table
701701
702702 if (length(k )) {
703- print(paste(
704- " Estimates and significance testing of the" ,
705- " effect of target variables" ))
703+ cat(" Estimates and significance testing of the" ,
704+ " effect of target variables\n " )
706705 res = as.matrix(printCoefmat(private $ summary_table ,
707706 digits = digits ,
708707 P.values = TRUE ,
@@ -755,9 +754,8 @@ DoubleML = R6Class("DoubleML",
755754 a = c(a , 1 - a )
756755 pct = format.perc(a , 3 )
757756 fac = qnorm(a )
758- ci = array (NA_real_ , dim = c(length(parm ), 2L ), dimnames = list (
759- parm ,
760- pct ))
757+ ci = array (NA_real_ , dim = c(length(parm ), 2L ),
758+ dimnames = list (parm , pct ))
761759 ci [] = self $ coef [parm ] + self $ se [parm ] %o% fac
762760 }
763761
@@ -766,7 +764,8 @@ DoubleML = R6Class("DoubleML",
766764 a = (1 - level )
767765 ab = c(a / 2 , 1 - a / 2 )
768766 pct = format.perc(ab , 3 )
769- ci = array (NA , dim = c(length(parm ), 2L ), dimnames = list (parm , pct ))
767+ ci = array (NA_real_ , dim = c(length(parm ), 2L ),
768+ dimnames = list (parm , pct ))
770769
771770 if (all(is.na(self $ boot_coef ))) {
772771 stop(paste(
@@ -970,8 +969,8 @@ DoubleML = R6Class("DoubleML",
970969 t_stat_ = NULL ,
971970 tuning_res_ = NULL ,
972971 n_rep_boot = NULL ,
973- i_rep = NA ,
974- i_treat = NA ,
972+ i_rep = NA_integer_ ,
973+ i_treat = NA_integer_ ,
975974 fold_specific_params = NULL ,
976975 summary_table = NULL ,
977976 learner_class = list (),
@@ -1168,47 +1167,49 @@ DoubleML = R6Class("DoubleML",
11681167 },
11691168 initialize_arrays = function () {
11701169
1171- private $ psi_ = array (NA , dim = c(
1170+ private $ psi_ = array (NA_real_ , dim = c(
11721171 self $ data $ n_obs , self $ n_rep ,
11731172 self $ data $ n_treat ))
1174- private $ psi_a_ = array (NA , dim = c(
1173+ private $ psi_a_ = array (NA_real_ , dim = c(
11751174 self $ data $ n_obs , self $ n_rep ,
11761175 self $ data $ n_treat ))
1177- private $ psi_b_ = array (NA , dim = c(
1176+ private $ psi_b_ = array (NA_real_ , dim = c(
11781177 self $ data $ n_obs , self $ n_rep ,
11791178 self $ data $ n_treat ))
11801179
1181- private $ coef_ = array (NA , dim = c(self $ data $ n_treat ))
1182- private $ se_ = array (NA , dim = c(self $ data $ n_treat ))
1180+ private $ coef_ = array (NA_real_ , dim = c(self $ data $ n_treat ))
1181+ private $ se_ = array (NA_real_ , dim = c(self $ data $ n_treat ))
11831182
1184- private $ all_coef_ = array (NA , dim = c(self $ data $ n_treat , self $ n_rep ))
1185- private $ all_se_ = array (NA , dim = c(self $ data $ n_treat , self $ n_rep ))
1183+ private $ all_coef_ = array (NA_real_ ,
1184+ dim = c(self $ data $ n_treat , self $ n_rep ))
1185+ private $ all_se_ = array (NA_real_ ,
1186+ dim = c(self $ data $ n_treat , self $ n_rep ))
11861187
11871188 if (self $ dml_procedure == " dml1" ) {
11881189 if (self $ apply_cross_fitting ) {
1189- private $ all_dml1_coef_ = array (NA , dim = c(
1190+ private $ all_dml1_coef_ = array (NA_real_ , dim = c(
11901191 self $ data $ n_treat , self $ n_rep ,
11911192 self $ n_folds ))
11921193 } else {
1193- private $ all_dml1_coef_ = array (NA , dim = c(
1194+ private $ all_dml1_coef_ = array (NA_real_ , dim = c(
11941195 self $ data $ n_treat , self $ n_rep ,
11951196 1 ))
11961197 }
11971198 }
11981199 },
11991200 initialize_boot_arrays = function (n_rep_boot ) {
12001201 private $ n_rep_boot = n_rep_boot
1201- private $ boot_coef_ = array (NA , dim = c(
1202+ private $ boot_coef_ = array (NA_real_ , dim = c(
12021203 self $ data $ n_treat ,
12031204 n_rep_boot * self $ n_rep ))
1204- private $ boot_t_stat_ = array (NA , dim = c(
1205+ private $ boot_t_stat_ = array (NA_real_ , dim = c(
12051206 self $ data $ n_treat ,
12061207 n_rep_boot * self $ n_rep ))
12071208 },
12081209 initialize_predictions = function () {
12091210 private $ predictions_ = sapply(self $ params_names(),
12101211 function (key ) {
1211- array (NA , dim = c(
1212+ array (NA_real_ , dim = c(
12121213 self $ data $ n_obs , self $ n_rep ,
12131214 self $ data $ n_treat ))
12141215 },
@@ -1243,7 +1244,7 @@ DoubleML = R6Class("DoubleML",
12431244 if (dml_procedure == " dml1" ) {
12441245 # Note that length(test_ids) is only not equal to self.n_folds
12451246 # if self$apply_cross_fitting ==False
1246- thetas = rep(NA , length(test_ids ))
1247+ thetas = rep(NA_real_ , length(test_ids ))
12471248 for (i_fold in seq_len(length(test_ids ))) {
12481249 test_index = test_ids [[i_fold ]]
12491250 thetas [i_fold ] = private $ orth_est(inds = test_index )
0 commit comments