WLenhard commited on
Commit
eacfed9
·
verified ·
1 Parent(s): a8be869

Upload app.R

Browse files
Files changed (1) hide show
  1. app.R +10 -9
app.R CHANGED
@@ -383,15 +383,16 @@ get_moments_analytical <- function(model, group_label = "Unknown") {
383
  #* Calculate effect size from two groups
384
  #* @param group1 Comma-separated numeric values for group 1
385
  #* @param group2 Comma-separated numeric values for group 2
386
- #* @param degree Polynomial degree (default 5)
387
  #* @post /calculate
388
  #* @get /calculate
389
- function(group1, group2) {
390
 
391
  tryCatch({
392
  # Parse input
393
  x1 <- as.numeric(unlist(strsplit(group1, ",")))
394
  x2 <- as.numeric(unlist(strsplit(group2, ",")))
 
395
 
396
  # Remove any NA values from parsing
397
  x1 <- x1[!is.na(x1)]
@@ -399,17 +400,21 @@ function(group1, group2) {
399
 
400
  if (length(x1) == 0 || length(x2) == 0) {
401
  return(list(
 
402
  error = "Invalid input: Could not parse numeric values from input strings"
403
  ))
404
  }
405
 
406
- # Calculate effect size
407
- result <- d.quantile(x1, x2, silent = TRUE)
408
 
409
  # Return clean result
410
  return(list(
411
  success = TRUE,
412
  d_q = result$d_q,
 
 
 
413
  group1 = list(
414
  n = result$n1,
415
  mean = result$group1_mean,
@@ -421,11 +426,7 @@ function(group1, group2) {
421
  sd = result$group2_sd
422
  ),
423
  pooled_sd = result$pooled_sd,
424
- degree = result$degree,
425
- tie_info = list(
426
- group1_ties = result$tie_proportion_1,
427
- group2_ties = result$tie_proportion_2
428
- )
429
  ))
430
 
431
  }, error = function(e) {
 
383
  #* Calculate effect size from two groups
384
  #* @param group1 Comma-separated numeric values for group 1
385
  #* @param group2 Comma-separated numeric values for group 2
386
+ #* @param ci Confidence interval level (default 0.95)
387
  #* @post /calculate
388
  #* @get /calculate
389
+ function(group1, group2, ci = 0.95) {
390
 
391
  tryCatch({
392
  # Parse input
393
  x1 <- as.numeric(unlist(strsplit(group1, ",")))
394
  x2 <- as.numeric(unlist(strsplit(group2, ",")))
395
+ ci_level <- as.numeric(ci)
396
 
397
  # Remove any NA values from parsing
398
  x1 <- x1[!is.na(x1)]
 
400
 
401
  if (length(x1) == 0 || length(x2) == 0) {
402
  return(list(
403
+ success = FALSE,
404
  error = "Invalid input: Could not parse numeric values from input strings"
405
  ))
406
  }
407
 
408
+ # Calculate effect size with CI
409
+ result <- d.quantile(x1, x2, CI = ci_level, silent = TRUE)
410
 
411
  # Return clean result
412
  return(list(
413
  success = TRUE,
414
  d_q = result$d_q,
415
+ ci_lower = result$ci_lower,
416
+ ci_upper = result$ci_upper,
417
+ ci_level = result$ci_level,
418
  group1 = list(
419
  n = result$n1,
420
  mean = result$group1_mean,
 
426
  sd = result$group2_sd
427
  ),
428
  pooled_sd = result$pooled_sd,
429
+ degree = result$degree
 
 
 
 
430
  ))
431
 
432
  }, error = function(e) {