Description Usage Arguments Details Value Examples
View source: R/model-diagnostics.R
gen_grid_cent_rwgt
returns a grid of values based on the empirical
distribution of the regressor in the data.
1 | gen_grid_cent_rwgt(x, grid_method, n_grid)
|
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 ( |
n_grid |
An integer indicating the number of reweighting centers present in the grid. |
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)
.
A vector of values corresponding to the centers for the reweighting.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.