+17
-11
lines changedFilter options
+17
-11
lines changed Original file line number Diff line number Diff line change
@@ -207,7 +207,7 @@ estimate <- function(Y,
207
207
iter = 5000,
208
208
impute = FALSE,
209
209
progress = TRUE,
210
-
seed = 1,
210
+
seed = NULL,
211
211
...){
212
212
213
213
# temporary warning until missing data is fully implemented
@@ -220,10 +220,10 @@ estimate <- function(Y,
220
220
}
221
221
}
222
222
223
-
# removed per CRAN (8/12/21)
224
-
#old <- .Random.seed
225
-
226
-
set.seed(seed)
223
+
## Random seed unless user provided
224
+
if(!is.null(seed) ) {
225
+
set.seed(seed)
226
+
}
227
227
228
228
# delta rho ~ beta(delta/2, delta/2)
229
229
delta <- delta_solve(prior_sd)
@@ -506,11 +506,17 @@ estimate <- function(Y,
506
506
507
507
} else {
508
508
509
-
## If z0_Start has missing, fill with rnorm
510
-
Y_missing <- ifelse(is.na(Y), 1, 0)
511
-
rank_vars$z0_start[is.na(rank_vars$z0_start)] <- rnorm(sum(Y_missing))
512
-
513
-
Y <- na.omit(Y)
509
+
## check if Y contains NA
510
+
contains_na <- any(is.na(Y))
511
+
if( contains_na ) {
512
+
Y <- na.omit(Y)
513
+
## Reassign values when NA are present
514
+
temp_helper <- rank_helper(Y)
515
+
rank_vars$z0_start <- temp_helper$z0_start
516
+
rank_vars$levels <- temp_helper$levels
517
+
warning("Observed variables contain missings:\n No imputation, cases are deleted listwise." )
518
+
}
519
+
514
520
515
521
post_samp <- .Call(
516
522
"_BGGM_copula",
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4