globalweights_diff {baskexact}R Documentation

Global Weights Based on Response Rate Differences

Description

Global Weights Based on Response Rate Differences

Usage

globalweights_diff(n, r, eps_global = 1, w = 1)

Arguments

n

The sample size per basket.

r

Vector of responses.

eps_global

A tuning parameter that determines the amount of borrowing. A higher value leads to a smaller weight and therefore less borrowing when the heterogeneity between the results in the baskets increases.

w

A fixed probability between 0 and 1. w is multiplied to the weight.

Details

globalweights_diff calculates a weight based on the heterogeneity of the response rates of all baskets that is multiplied to the pairwise weights calculated with the function that is passed to weight_fun. The weight is 1 when the number of responses is identical in all baskets and 0 if the response rates are an equidistant sequence from 0 to 1. If the maximum weight should be smaller than 1, w can be set to a smaller value.

Value

A numeric value.

Examples

globalweights_diff(n = 20, r = c(1, 3, 5), eps_global = 2)

[Package baskexact version 1.0.1 Index]