Learn R Programming

GECal (version 0.1.7)

g: Debiasing covariate for GECalib

Description

It returns the debiasing covariate, which is equivalent to the first order derivatie of the generalized entropy \(G\).

Usage

g(x, entropy = NULL, del = NULL)

Value

A vector of debiasing covariate.

Arguments

x

A vector of design weights

entropy

An optional data frame containing the variables in the model (specified by formula).

del

The optional vector for threshold (\(\delta\)) when entropy == "PH".

Examples

Run this code
set.seed(11)
N = 10000
x = data.frame(x1 = rnorm(N, 2, 1), x2= runif(N, 0, 4))
pi = pt((-x[,1] / 2 - x[,2] / 2), 3);
pi = ifelse(pi >.7, .7, pi)

g_EL <- g(1 / pi, entropy = 1)
g_ET <- g(1 / pi, entropy = 0)
g_EL <- g(1 / pi, entropy = -1)

Run the code above in your browser using DataLab