Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

F-statistics not working with mincRandomize #318

Open
rwickens opened this issue Sep 12, 2023 · 0 comments
Open

F-statistics not working with mincRandomize #318

rwickens opened this issue Sep 12, 2023 · 0 comments

Comments

@rwickens
Copy link

rwickens commented Sep 12, 2023

Hello,

I'm trying to use mincRandomize on my mincLm object, which contains a column called F-statistic. In the documentation, I see that the default is t-stats...However, I'm attempting the following:

result = mincRandomize(myLm_masked, R = 500, alternative = "greater", columns = "F-statistic")

Am I calling it correctly? It's giving me the following error:


Error in apply(post_procd, 2, max): dim(X) must have a positive length
Traceback:

  1. mincRandomize(myLm_masked, R = 500, alternative = "greater",
    . columns = "F-statistic")
  2. mincRandomize.mincLm(myLm_masked, R = 500, alternative = "greater",
    . columns = "F-statistic")
  3. mincRandomize_core(lmod, R = R, replace = replace, parallel = parallel,
    . columns = columns, alternative = alternative, conf_file = conf_file,
    . resources = resources)
  4. boot_model(R)
  5. Reduce(function(max_val_matrix, i) {
    . shuf_data <- lmod_data
    . shuf_data[, pred_cols] <- lmod_data[sample(seq_len(nrow(lmod_data)),
    . replace = replace), pred_cols]
    . new_mod <- update(lmod, data = shuf_data)
    . new_mod[!is.finite(new_mod)] <- 0
    . post_procd <- post_proc(new_mod[, columns], ...)
    . if (alternative == "two.sided") {
    . post_procd <- abs(post_procd)
    . }
    . biggest_stats <- apply(post_procd, 2, max)
    . rbind(max_val_matrix, biggest_stats) %>% colnames<-(colnames(lmod)[columns]) %>%
    . rownames<-(NULL)
    . }, seq_len(n), NULL)
  6. f(init, x[[i]])
  7. apply(post_procd, 2, max)
  8. stop("dim(X) must have a positive length")

Using RMINC on a Mac (ARM64) using majestic-minc by josh unrau

@rwickens rwickens changed the title Can F-statistics be used with mincRandomize? F-statistics not working with mincRandomize? Sep 18, 2023
@rwickens rwickens changed the title F-statistics not working with mincRandomize? F-statistics not working with mincRandomize Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant