testnl: Wald test of multiple hypotheses

Description Usage Arguments Details Examples

View source: R/testnl.R

Description

Test linear and non-linear hypotheses of the coefficients of a fitted regression model.

Usage

1

Arguments

...

one or more (possibly non-linear) expressions

Details

Jointly tests that the (non-linear) expressions in ... are all equal to zero. Use a variable name to refer to the coefficient associated with that variable, for instance testnl(model, 2*age) to test that twice the coefficient associated with age is equal to zero. Separate multiple expressions by commas, i.e. testnl(model, 2*age, motheduc^2). For "weird" variable names, surround in backticks (see example).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# fit a model with interations for illustration
use(datasets::mtcars)
regr(wt ~ hp * disp)

# first, test that hp = disp
testnl(hp - disp)

# then do a full f test (`hp:disp` is the interaction term)
testnl(hp, disp, `hp:disp`)

# if you want to test the intercept, it's called (Intercept)
testnl(sqrt(`(Intercept)`))

nateybear/longhorn-rstata documentation built on Oct. 21, 2020, 2:14 a.m.