jinseob2kim / jstable

Regression Tables from 'GLM', 'GEE', 'GLMM', 'Cox' and 'survey' Results.
https://jinseob2kim.github.io/jstable/
Apache License 2.0
22 stars 13 forks source link

The independent variable is a four-category variable. #24

Closed pipi815 closed 5 months ago

pipi815 commented 6 months ago

Tanks for author's work. My independent variable is a four-category variable.something gets wrong as the below, i wonder how to deal with it.Looking forward to your reply

res <- TableSubgroupMultiCox(formula = SurvObject ~ Trajectory,

  • var_subgroups = c("Gender", "Marital","Education","Functional" ,"Sociality","Residence",
  • "Smoking","AgeG","BMIG","morbidity"),
  • var_cov = c("Gender","Drinking","Smoking","Marital","Education","Functional" ,"Sociality",
  • "CRP","Age","BMI","morbidity"),
  • data=completedData1,line = TRUE,)#指定你的数据 Error in purrr::map(): ℹ In index: 1. Caused by error in mutate(): ℹ In argument: P value = ifelse(pv >= 0.001, pv, "<0.001"). Caused by error: ! P value must be size 6 or 1, not 2. Run rlang::last_trace() to see where the error occurred. Warning messages: 1: Using formula(x) is deprecated when x is a character vector of length > 1. Consider formula(paste(x, collapse = " ")) instead. 2: Using formula(x) is deprecated when x is a character vector of length > 1. Consider formula(paste(x, collapse = " ")) instead. 3: In data.frame(Variable = paste(" ", label_val), Count = Count, : row names were found from a short variable and have been discarded
jinseob2kim commented 6 months ago

Sorry. Currenty The function can't be support >2 categories. I will update until next release. Thanks

jinseob2kim commented 6 months ago

@Suhyeon-Kwon Next week task

jinseob2kim commented 5 months ago

We update the function. Please install the latest version via remotes::install_github("jinseob2kim/jstable")

pipi815 commented 5 months ago

Thanks for your excellent works.

Ink-Mo commented 3 months ago

We update the function. Please install the latest version via remotes::install_github("jinseob2kim/jstable")

I still have this problem with support >2 categories.

res <- TableSubgroupMultiCox(formula = Surv(time, Status) ~ Chemotherapy,

  • var_subgroups = c("Age","Hist","Grade","Stage",),
  • data = df #
  • ) Error in purrr::map(): ℹ In index: 1. Caused by error in if (is.na(pv_anova) & !is.null(cluster)) ...: ! the condition has length > 1 Run rlang::last_trace() to see where the error occurred. rlang::last_trace() <error/purrr_error_indexed> Error in purrr::map(): ℹ In index: 1. Caused by error in if (is.na(pv_anova) & !is.null(cluster)) ...: ! the condition has length > 1

    Backtrace: ▆

    1. └─jstable::TableSubgroupMultiCox(...)
    2. └─purrr::map(...)
    3. └─purrr:::map_("list", .x, .f, ..., .progress = .progress)
    4. ├─purrr:::with_indexed_errors(...)
    5. │ └─base::withCallingHandlers(...)
    6. ├─purrr:::call_with_cleanup(...)
    7. └─jstable (local) .f(.x[[i]], ...)
    8. └─jstable::TableSubgroupCox(...) Run rlang::last_trace(drop = FALSE) to see 4 hidden frames. rlang::last_trace(drop = FALSE) <error/purrr_error_indexed> Error in purrr::map(): ℹ In index: 1. Caused by error in if (is.na(pv_anova) & !is.null(cluster)) ...: ! the condition has length > 1

      Backtrace: ▆

    9. ├─jstable::TableSubgroupMultiCox(...)
    10. │ └─purrr::map(...)
    11. │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress)
    12. │ ├─purrr:::with_indexed_errors(...)
    13. │ │ └─base::withCallingHandlers(...)
    14. │ ├─purrr:::call_with_cleanup(...)
    15. │ └─jstable (local) .f(.x[[i]], ...)
    16. │ └─jstable::TableSubgroupCox(...)
    17. └─base::.handleSimpleError(...)
    18. └─purrr (local) h(simpleError(msg, call))
    19. └─cli::cli_abort(...)
    20. └─rlang::abort(...)
jinseob2kim commented 3 months ago

Thanks for your feedback. Can you share reproducible example with data?

Ink-Mo commented 3 months ago

Sure tmp.csv

jinseob2kim commented 3 months ago

I fix the issue. please install the latest version via remotes::install_github("jinseob2kim/jstable")