## ------------------------------------------------
## Method `PlausibilityFunction$set_nperms`
## ------------------------------------------------
x <- rnorm(10)
y <- rnorm(10, mean = 2)
null_spec <- function(y, parameters) {purrr::map(y, ~ .x - parameters[1])}
stat_functions <- list(stat_t)
stat_assignments <- list(mean = 1)
pf <- PlausibilityFunction$new(
null_spec = null_spec,
stat_functions = stat_functions,
stat_assignments = stat_assignments,
x, y
)
pf$nperms
pf$set_nperms(10000)
pf$nperms
## ------------------------------------------------
## Method `PlausibilityFunction$set_nperms_max`
## ------------------------------------------------
x <- rnorm(10)
y <- rnorm(10, mean = 2)
null_spec <- function(y, parameters) {purrr::map(y, ~ .x - parameters[1])}
stat_functions <- list(stat_t)
stat_assignments <- list(mean = 1)
pf <- PlausibilityFunction$new(
null_spec = null_spec,
stat_functions = stat_functions,
stat_assignments = stat_assignments,
x, y
)
pf$nperms_max
pf$set_nperms_max(10000)
pf$nperms_max
## ------------------------------------------------
## Method `PlausibilityFunction$set_alternative`
## ------------------------------------------------
x <- rnorm(10)
y <- rnorm(10, mean = 2)
null_spec <- function(y, parameters) {purrr::map(y, ~ .x - parameters[1])}
stat_functions <- list(stat_t)
stat_assignments <- list(mean = 1)
pf <- PlausibilityFunction$new(
null_spec = null_spec,
stat_functions = stat_functions,
stat_assignments = stat_assignments,
x, y
)
pf$alternative
pf$set_alternative("right_tail")
pf$alternative
## ------------------------------------------------
## Method `PlausibilityFunction$set_aggregator`
## ------------------------------------------------
x <- rnorm(10)
y <- rnorm(10, mean = 2)
null_spec <- function(y, parameters) {purrr::map(y, ~ .x - parameters[1])}
stat_functions <- list(stat_t)
stat_assignments <- list(mean = 1)
pf <- PlausibilityFunction$new(
null_spec = null_spec,
stat_functions = stat_functions,
stat_assignments = stat_assignments,
x, y
)
pf$aggregator
pf$set_aggregator("fisher")
pf$aggregator
## ------------------------------------------------
## Method `PlausibilityFunction$set_pvalue_formula`
## ------------------------------------------------
x <- rnorm(10)
y <- rnorm(10, mean = 2)
null_spec <- function(y, parameters) {
purrr::map(y, ~ .x - parameters[1])
}
stat_functions <- list(stat_t)
stat_assignments <- list(mean = 1)
pf <- PlausibilityFunction$new(
null_spec = null_spec,
stat_functions = stat_functions,
stat_assignments = stat_assignments,
x, y
)
pf$pvalue_formula
pf$set_pvalue_formula("estimate")
pf$pvalue_formula
## ------------------------------------------------
## Method `PlausibilityFunction$get_value`
## ------------------------------------------------
x <- rnorm(10)
y <- rnorm(10, mean = 2)
null_spec <- function(y, parameters) {purrr::map(y, ~ .x - parameters[1])}
stat_functions <- list(stat_t)
stat_assignments <- list(mean = 1)
pf <- PlausibilityFunction$new(
null_spec = null_spec,
stat_functions = stat_functions,
stat_assignments = stat_assignments,
x, y
)
pf$set_nperms(50)
pf$get_value(2)
## ------------------------------------------------
## Method `PlausibilityFunction$set_max_conf_level`
## ------------------------------------------------
x <- rnorm(10)
y <- rnorm(10, mean = 2)
null_spec <- function(y, parameters) {
purrr::map(y, ~ .x - parameters[1])
}
stat_functions <- list(stat_t)
stat_assignments <- list(mean = 1)
pf <- PlausibilityFunction$new(
null_spec = null_spec,
stat_functions = stat_functions,
stat_assignments = stat_assignments,
x, y
)
pf$max_conf_level
pf$set_max_conf_level(0.999)
pf$max_conf_level
## ------------------------------------------------
## Method `PlausibilityFunction$set_point_estimate`
## ------------------------------------------------
x <- rnorm(10)
y <- rnorm(10, mean = 2)
null_spec <- function(y, parameters) {
purrr::map(y, ~ .x - parameters[1])
}
stat_functions <- list(stat_t)
stat_assignments <- list(mean = 1)
pf <- PlausibilityFunction$new(
null_spec = null_spec,
stat_functions = stat_functions,
stat_assignments = stat_assignments,
x, y
)
pf$point_estimate
pf$set_point_estimate(mean(y) - mean(x))
pf$point_estimate
## ------------------------------------------------
## Method `PlausibilityFunction$set_parameter_bounds`
## ------------------------------------------------
x <- rnorm(10)
y <- rnorm(10, mean = 2)
null_spec <- function(y, parameters) {
purrr::map(y, ~ .x - parameters[1])
}
stat_functions <- list(stat_t)
stat_assignments <- list(mean = 1)
pf <- PlausibilityFunction$new(
null_spec = null_spec,
stat_functions = stat_functions,
stat_assignments = stat_assignments,
x, y
)
pf$set_nperms(50)
pf$set_point_estimate(point_estimate = mean(y) - mean(x))
pf$parameters
pf$set_parameter_bounds(
point_estimate = pf$point_estimate,
conf_level = 0.8
)
pf$parameters
## ------------------------------------------------
## Method `PlausibilityFunction$set_grid`
## ------------------------------------------------
x <- rnorm(10)
y <- rnorm(10, mean = 2)
null_spec <- function(y, parameters) {
purrr::map(y, ~ .x - parameters[1])
}
stat_functions <- list(stat_t)
stat_assignments <- list(mean = 1)
pf <- PlausibilityFunction$new(
null_spec = null_spec,
stat_functions = stat_functions,
stat_assignments = stat_assignments,
x, y
)
pf$set_nperms(50)
pf$set_point_estimate(mean(y) - mean(x))
pf$set_parameter_bounds(
point_estimate = pf$point_estimate,
conf_level = 0.8
)
pf$set_grid(
parameters = pf$parameters,
npoints = 2L
)
## ------------------------------------------------
## Method `PlausibilityFunction$evaluate_grid`
## ------------------------------------------------
x <- rnorm(10)
y <- rnorm(10, mean = 2)
null_spec <- function(y, parameters) {
purrr::map(y, ~ .x - parameters[1])
}
stat_functions <- list(stat_t)
stat_assignments <- list(mean = 1)
pf <- PlausibilityFunction$new(
null_spec = null_spec,
stat_functions = stat_functions,
stat_assignments = stat_assignments,
x, y
)
pf$set_nperms(50)
pf$set_point_estimate(mean(y) - mean(x))
pf$set_parameter_bounds(
point_estimate = pf$point_estimate,
conf_level = 0.8
)
pf$set_grid(
parameters = pf$parameters,
npoints = 2L
)
pf$evaluate_grid(grid = pf$grid)
Run the code above in your browser using DataLab