Learn R Programming

KRLS (version 0.3-1)

summary.krls: Summary method for Kernel-based Regularized Least Squares (KRLS) Model Fits

Description

Summarizes average partial derivatives (i.e. marginal effect) and the distribution of the partial derivatives for each predictor. For binary predictors, the first difference is computed instead of the average partial derivatives.

Usage

## S3 method for class 'krls':
summary(object, binary=TRUE,probs=seq(.25,.75,.25),...)

Arguments

object
Fitted krls model, i.e. an object of class krls
binary
logical flag if first differences, instead of average partial derivatives, should be computed for binary predictors.
probs
numeric vector with numbers between 0 and 1 that specify the quantiles of the pointwise marginal effects for the summary.
...
additional arguments to be passed to lower level functions

Value

  • coefficientsmatrix with average partial derivates and or first differences (point estimates, standart errors, t-values, p-values).
  • qcoefficientsmatrix with 1st, 2nd, and 3rd quatriles of distribution of pointwise marinal effects.
  • dydxmatrix with pointwise partial derivatives where, if binary is set to TRUE, for the binary varibales the pointwise first diferences are reported instead of the partial derivatives.

Details

Notice that the partial derivatives can only be summarized if the krls object was computed with krls(,derivatives=TRUE).

See Also

krls

Examples

Run this code
# non-linear example
# set up data
N <- 200
x1 <- rnorm(N)
x2 <- rbinom(N,size=1,prob=.2)
y <- x1^3 + .5*x2 + rnorm(N,0,.15)
X <- cbind(x1,x2)

# fit model
krlsout <- krls(X=X,y=y)
# summarize marginal effects and contribution of each variable
summary(krlsout)
# plot marginal effects and conditional expectation plots
plot(krlsout)

Run the code above in your browser using DataLab