Learn R Programming

sValues (version 0.1.6)

coef.sValues: Extract sValues Model Coefficients/Statistics

Description

Extract sValues Model Coefficients/Statistics

Usage

# S3 method for sValues
coef(object, type = "default", ...)

betas(object)

t_values(object)

s_values(object)

extreme_bounds(object)

Arguments

object

an object of class sValues.

type

which coefficient/statistic to extract? Current options are "betas", "t_values", "s_values", "extreme_bounds" and "default". See details.

...

further arguments passed to or from other methods.

Value

The function returns a data.frame with the estimates for each variable.

Details

For the coef function, the default is to extract the beta coefficients, t-values and s-values. You can can get each one of those individually by setting type to either "betas", "t_values" or "s_values". You can also get the extreme bounds of the estimates by setting type to "extreme_bounds". Finally, you can set type = "all" to get everything.

For each option of coef, there is an alternative helper function with the same name. That is, coef(x, "betas") is equivalent to betas(x), or coef(x, "extreme_bounds") is equivalent to extreme_bounds(x).

See Also

summary.sValues.

Examples

Run this code
# NOT RUN {
data(economic_growth)
eg_sv <- sValues(GR6096 ~ ., data = economic_growth)
eg_betas <- coef(eg_sv, "betas")
eg_t_values <- coef(eg_sv, "t_values")
eg_s_values <- coef(eg_sv, "s_values")
eg_ext_bounds <- coef(eg_sv, "extreme_bounds")

# get sturdy estimates for R2 bounds 0.5 - 1
eg_s_values[abs(eg_s_values[3]) > 1, 3, drop = FALSE]


# }

Run the code above in your browser using DataLab