@@ -295,12 +295,16 @@ calc_impl_one_f <- function(f) {
295
295
}
296
296
}
297
297
298
+ # ' @export
298
299
calc_impl.mean <- calc_impl_one_f(mean )
299
300
301
+ # ' @export
300
302
calc_impl.median <- calc_impl_one_f(stats :: median )
301
303
304
+ # ' @export
302
305
calc_impl.sum <- calc_impl_one_f(sum )
303
306
307
+ # ' @export
304
308
calc_impl.sd <- calc_impl_one_f(stats :: sd )
305
309
306
310
calc_impl_success_f <- function (f , output_name ) {
@@ -327,20 +331,23 @@ calc_impl_success_f <- function(f, output_name) {
327
331
}
328
332
}
329
333
334
+ # ' @export
330
335
calc_impl.prop <- calc_impl_success_f(
331
336
f = function (response , success , ... ) {
332
337
mean(response == success , ... )
333
338
},
334
339
output_name = " proportion"
335
340
)
336
341
342
+ # ' @export
337
343
calc_impl.count <- calc_impl_success_f(
338
344
f = function (response , success , ... ) {
339
345
sum(response == success , ... )
340
346
},
341
347
output_name = " count"
342
348
)
343
349
350
+ # ' @export
344
351
calc_impl.F <- function (type , x , order , ... ) {
345
352
x %> %
346
353
dplyr :: summarize(
@@ -350,6 +357,7 @@ calc_impl.F <- function(type, x, order, ...) {
350
357
)
351
358
}
352
359
360
+ # ' @export
353
361
calc_impl.slope <- function (type , x , order , ... ) {
354
362
x %> %
355
363
dplyr :: summarize(
@@ -359,6 +367,7 @@ calc_impl.slope <- function(type, x, order, ...) {
359
367
)
360
368
}
361
369
370
+ # ' @export
362
371
calc_impl.correlation <- function (type , x , order , ... ) {
363
372
x %> %
364
373
dplyr :: summarize(
@@ -403,12 +412,16 @@ calc_impl_diff_f <- function(f, operator) {
403
412
}
404
413
}
405
414
415
+ # ' @export
406
416
calc_impl.diff_in_means <- calc_impl_diff_f(mean , operator = `-` )
407
417
418
+ # ' @export
408
419
calc_impl.diff_in_medians <- calc_impl_diff_f(stats :: median , operator = `-` )
409
420
421
+ # ' @export
410
422
calc_impl.ratio_of_means <- calc_impl_diff_f(mean , operator = `/` )
411
423
424
+ # ' @export
412
425
calc_impl.Chisq <- function (type , x , order , ... ) {
413
426
resp_var <- response_name(x )
414
427
@@ -464,6 +477,7 @@ calc_impl.Chisq <- function(type, x, order, ...) {
464
477
)
465
478
}
466
479
480
+ # ' @export
467
481
calc_impl.function_of_props <- function (type , x , order , operator , ... ) {
468
482
col <- response_expr(x )
469
483
success <- attr(x , " success" )
@@ -501,14 +515,17 @@ calc_impl.function_of_props <- function(type, x, order, operator, ...) {
501
515
res
502
516
}
503
517
518
+ # ' @export
504
519
calc_impl.diff_in_props <- function (type , x , order , ... ) {
505
520
calc_impl.function_of_props(type , x , order , operator = `-` , ... )
506
521
}
507
522
523
+ # ' @export
508
524
calc_impl.ratio_of_props <- function (type , x , order , ... ) {
509
525
calc_impl.function_of_props(type , x , order , operator = `/` , ... )
510
526
}
511
527
528
+ # ' @export
512
529
calc_impl.odds_ratio <- function (type , x , order , ... ) {
513
530
col <- response_expr(x )
514
531
success <- attr(x , " success" )
@@ -524,6 +541,7 @@ calc_impl.odds_ratio <- function(type, x, order, ...) {
524
541
dplyr :: select(stat )
525
542
}
526
543
544
+ # ' @export
527
545
calc_impl.t <- function (type , x , order , ... ) {
528
546
if (theory_type(x ) == " Two sample t" ) {
529
547
x <- reorder_explanatory(x , order )
@@ -556,6 +574,7 @@ calc_impl.t <- function(type, x, order, ...) {
556
574
df_out
557
575
}
558
576
577
+ # ' @export
559
578
calc_impl.z <- function (type , x , order , ... ) {
560
579
# Two sample proportions
561
580
if (theory_type(x ) == " Two sample props z" ) {
0 commit comments