Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dbosak01 committed Mar 3, 2024
1 parent daf115f commit 703e476
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
Binary file modified Procs_Validation.docx
Binary file not shown.
9 changes: 5 additions & 4 deletions R/proc_reg.R
Original file line number Diff line number Diff line change
Expand Up @@ -760,13 +760,14 @@ get_reg_report <- function(data, var, model, opts = NULL, weight = NULL, stats =
rlbls[["UCLMSTD"]] <- sprintf(tlbls[["UCLMSTD"]], alph2)
rlbls[["LCLMSTD"]] <- sprintf(tlbls[["LCLMSTD"]], alph2)

# Create
pfmt <- value(condition(is.na(x), "NA"),
# Create p-val format.
# Creating this from a string to bypass CMD check notes on unassigned variable x
pfmt <- eval(str2lang('value(condition(is.na(x), "NA"),
condition(x < .0001, "<.0001"),
condition(TRUE, "%.4f"),
log = FALSE)
log = FALSE)'))

reg_fc <- fcat(N = "%d", MEAN = "%.4f", STD = "%.4f", STDERR = "%.4f",
reg_fc <- fcat(N = "%d", MEAN = "%.4f", STD = "%.4f", STDERR = "%.5f",
MIN = "%.4f", MAX = "%.4f", UCLM = "%.4f", LCLM = "%.4f",
DF = "%d", "T" = "%.2f", PROBT = pfmt, NDF = "%.3f", DDF = "%.3f",
FVAL = "%.2f", PROBF = pfmt, UCLMSTD = "%.4f", LCLMSTD = "%.4f",
Expand Down
2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ articles:
procs-reg: procs-reg.html
procs-ttest: procs-ttest.html
procs: procs.html
last_built: 2024-03-02T04:08Z
last_built: 2024-03-03T02:01Z
urls:
reference: https://procs.r-sassy.org/reference
article: https://procs.r-sassy.org/articles
Expand Down
15 changes: 15 additions & 0 deletions tests/testthat/test-reg.R
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,21 @@ test_that("reg7: by parameter works.", {

expect_equal(length(res2), 2)


# Multiple Bys
res3 <- proc_reg(cls, myfm1,
by = v(Sex, region),
output = c("out", "report"))

res3

expect_equal(length(res3), 2)
expect_equal(is.data.frame(res3$out), TRUE)
expect_equal(nrow(res3$out), 4)
expect_equal(length(res3$report), 4)
expect_equal(length(res3$report$`MODEL1:Sex=F, region=A`), 4)


})


Expand Down

0 comments on commit 703e476

Please sign in to comment.