Description Usage Arguments Details Value Author(s) References See Also Examples

Tests restriction(s) on model parameters of the form R(b)=q, where R is vector or scalar valued (non)linear function of b, the vector of model parameters, and q is numeric vector or scalar. Delta method is used for covariance matrix. Applicable after any model provided parameters estimates and their covariance matrix are available.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ```
nlWaldtest(obj = NULL, texts, rhss = NULL, coeff = NULL,
Vcov = NULL, df2 = NULL, x = NULL)
# Standard:
# nlWaldtest(obj, texts) # Chi square test
# nlWaldtest(obj, texts, df2 = T) # F test
# Force different covariance matrix:
# nlWaldtest(obj, texts, Vcov = vcovHC(obj))
# If coef(obj) and vcov(obj) are not available
# nlWaldtest(texts = restrictions, coeff = vector, Vcov = matrix)
# Backward compatibility:
# nlWaldtest(obj, texts, rhss)
``` |

`obj` |
model object of any class, for which |

`texts` |
left-side(s) of normalized restriction(s), R(b), as string or vector of strings.
Multiple restrictions can be inputted as a character vector or as a character,
separated by semicolon. Right-hand sides can be included either separated
by "=", or substracted, e.g. |

`rhss` |
right-side(s) of normalized restriction(s) as number or vector. Retained mostly for backward compatibility. Set to zero(s), if missing. |

`coeff` |
vector of parameter estimates. If missing, it is set to |

`Vcov` |
covariance matrix of parameters. If missing, it is set to |

`df2` |
defines the type of the test. By default, Chi square test is performed. To
perfom F test one can use |

`x` |
number, or numeric vector. Provides a way to supply cumbersome coefficients
into restrictions, e.g. |

The test should be applicable after (almost) any regression-type model, estimated using cross-section, time series, or panel data. If there are no methods for `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`

.

an object of "htest" class.

Oleh Komashko

Greene, W.H. (2011). Econometric Analysis, 7th edition. Upper Saddle River, NJ: Prentice Hall

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ```
set.seed(13)
x1<-rnorm(30);x2<-rnorm(30);x3<-rnorm(30);y<-rnorm(30)
set.seed(NULL)
lm1<-lm(y~x1+x2+x3)
nlConfint(lm1, "b[2]^3+b[3]*b[1];b[2]")
nlWaldtest(lm1,"a[2]^3+a[3]*a[1] = x[1]; a[2]", x = -0.07)
nlWaldtest(lm1,c("b[2]^3+b[3]*b[1]+0.07", "b[2]"))
# Reproduce example in EVievs 8 Users Guide II, pp. 149-151.
## Not run:
require(nlme)
nl1<-nls(log(q)~c1+c2*log(c3*(k^c4)+(1-c3)*(l^c4)),
data=CESdata,start=list(c1=-2.6,c2=1.8,c3=0.0001,c4=-6),
nls.control(maxiter = 100, tol = 1e-05,minFactor = 1/2^15))
nlWaldtest(nl1,"b[2]-1/b[4]",0)
nlWaldtest(nl1,"b[2]*b[4]",1)
## End(Not run)
``` |

```
value 2.5 % 97.5 %
b[2]^3+b[3]*b[1] -0.01258957 -0.07624856 0.05106942
b[2] 0.02359922 -0.31708313 0.36428156
Wald Chi-square test of restrictions on model parameters
data: lm1
Chisq = 3.3031, df = 2, p-value = 0.1918
Wald Chi-square test of restrictions on model parameters
data: lm1
Chisq = 3.3031, df = 2, p-value = 0.1918
Loading required package: nlme
Wald Chi-square test of a restriction on model parameters
data: nl1
Chisq = 1.5854, df = 1, p-value = 0.208
Wald Chi-square test of a restriction on model parameters
data: nl1
Chisq = 123.44, df = 1, p-value < 2.2e-16
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.