nlConfint(obj = NULL, texts, level = 0.95, coeff = NULL, Vcov = NULL, df2 = NULL, x = NULL)
# Standard:
# nlConfint(obj, texts) # based on z-statistics
# nlWaldtest(obj, texts, df2 = T) # based on z-statistics
# If coef(obj) and vcov(obj) are not available
# nlWaldtest(texts = funcions, coeff = vector, Vcov = matrix)
vcov.class(obj)
and
coef.class(obj)
methods are defined. Otherwise, both coeff
and
Vcov
should be inputted directly.
texts = "b[1]^b[2]-1; b[3]"
, or texts = c("b[1]^b[2]-1", "b[3]")
; b
's should be numbered as in coeff
vector.
coef(obj)
when available. It allows, for example, to compute CI for functions of marginal
effects and elasticities provided their covariance matrix is inputted.
coef(obj)
when
available. If coeff
and/or Vcov
are inputed, theirs counterparts from obj
are superseded.
df2 = T
, provided a method for df.residual
is available. Otherwise, one could input df2 = n
, where n
is a natural number. df2
is the df in the t statistics. If df2 = T
but df.residuals(obj)
doesn't exist, z-based intervals are forced, followed by a message.
texts = "b[1]^x[1] + x[2]"
,
x = c(0.1234, 5.6789)
to compute CI for b[1]^0.1234 + 5.6789.
texts
argument. The first column is formed of values of the functions computed at
parameters estimates. The two last columns are confidence bounds.
coef(obj)
and/or vcov(obj)
, coeff
and Vcov
arguments should be inputted directly. To realize the delta-method, the function first tries to compute analytical derivatives using deriv
. If failed, it computes numerical derivatives, calling numericDeriv
.
nlWaldtest
set.seed(13)
x1<-rnorm(30);x2<-rnorm(30);x3<-rnorm(30);y<-rnorm(30)
set.seed(NULL)
lm1a<-lm(y~x1+x2+x3)
nlConfint(lm1a, c("b[2]^3+b[3]*b[1]","b[2]"))
Run the code above in your browser using DataLab