| plot_coefficients | R Documentation |
This function plots three curves against the transition variable: the coefficient function, its standard error, and the corresponding p-value.
plot_coefficients(obj, vars, length.out = 100, color = "blue", size = 1.5)
obj |
An object of class |
vars |
A vector of column indices or variable names from the nonlinear part. |
length.out |
Number of grid points over the transition variable. |
color |
Line colour. |
size |
Line width. |
For each selected variable j, the curves are
f_1(x) = \beta_{0j} + \beta_{1j} g(x;\gamma,c)
f_2(x) = se\{f_1(x)\}
f_3(x) = 1 - \Pr\left\{X < \left[f_1(x)/f_2(x)\right]^2\right\}
where X follows a chi-square distribution with one degree of freedom.
In addition to the exported function plot_coefficients(obj = ...),
the same functionality is available as an R6 method via
obj$plot_coefficients(...).
A named list of ggplot2 objects.
pstr <- NewPSTR(Hansen99, dep = "inva", indep = 4:20,
indep_k = c("vala","debta","cfa","sales"),
tvars = c("vala","debta","cfa","sales"), iT = 14)
pstr <- EstPSTR(use = pstr, im = 1, iq = 1,
useDelta = TRUE, par = c(.63,0), method = "CG")
# Exported function
ret <- plot_coefficients(pstr, vars = 1:4)
# R6 method
ret2 <- pstr$plot_coefficients(vars = 1:4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.