gen_grid_cent_rwgt: Create grid of centers for the reweighting of the regressor's...

Description Usage Arguments Details Value Examples

View source: R/model-diagnostics.R

Description

gen_grid_cent_rwgt returns a grid of values based on the empirical distribution of the regressor in the data.

Usage

1
gen_grid_cent_rwgt(x, grid_method, n_grid)

Arguments

x

A vector of values taken by the regressor.

grid_method

A character indicating the method to use for the construction of the grid of reweighting centers. The grid consists either of evenly spaced values between the maximum and the minimum (grid_method='regular') or based on the quantiles between the second and the tenth deciles (grid_method='quantiles').

n_grid

An integer indicating the number of reweighting centers present in the grid.

Details

The function creates either a grid of evenly spaced values between the minimum and the maximum of the regressor's values or based on the quantiles. If the construction of the grid is based on the quantiles, then the values of the grid consists of the quantiles corresponding to the probabilities seq(0.1,0.9,length=n_grid).

Value

A vector of values corresponding to the centers for the reweighting.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
# Construct a grid of centers for the reweighting of the regressor
set.seed(162632)
n <- 100
x <- rnorm(n, 0, 1)
centers <- gen_grid_cent_rwgt(x, "quantiles", 9)

# Display the output
print(centers)

## End(Not run)

shamindras/maar documentation built on Sept. 19, 2021, 10:21 p.m.