Skip to content

Add print method for DeltaMethodForRatio #4

Description

@hoxo-m

Currently, the DeltaMethodForRatio R6 class lacks a custom print method, so it defaults to the generic R6 output. Adding a print method would improve usability by providing a more informative and user-friendly summary.

library(deltatest)
library(dplyr)

n_user <- 100

set.seed(314)
df <- deltatest::generate_dummy_data(n_user) |> 
  group_by(user_id, group) |> 
  summarise(click = sum(metric), pageview = n(), .groups = "drop")

DeltaMethodForRatio$new(df$click, df$pageview)
<DeltaMethodForRatio>
  Public:
    clone: function (deep = FALSE) 
    compute_confidence_interval: function (mean, standard_error, alternative = c("two.sided", 
    compute_expected_value: function (mean1, mean2, var2, cov = 0, bias_correction = FALSE) 
    compute_variance: function (mean1, mean2, var1, var2, cov = 0) 
    get_confidence_interval: function (alternative = c("two.sided", "less", "greater"), conf_level = 0.95) 
    get_expected_value: function () 
    get_info: function (alternative = c("two.sided", "less", "greater"), conf_level = 0.95) 
    get_squared_standard_error: function () 
    get_standard_error: function () 
    get_variance: function () 
    initialize: function (numerator, denominator, bias_correction = FALSE) 
  Private:
    expected_value: 0.215712383488682
    n: 1502
    size: 100
    squared_standard_error: 0.000327578645294461
    standard_error: 0.018099133827188
    variance: 0.0327578645294461
    x: 324

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions