lrt.slm(object, parameters=NULL, coefficients=NULL, ...)
"slm"
. The likelihood ratio test is
performed by restricting the parameters used to define the model
to a smaller class. Using the arguments below, the covariance matrix
parameters (but not the scale parameter) or the linear model
parameters can be restricted by setting them to known or hypothesized
values.
parameters
can either be a named vector
where the names of the vector are names from
names(object$parameters)
and the values are the values fixed by the null hypothesis.
Alternatively, vector
parameters
can be the same length
as
object$parameters
, with parameters which are free to vary
specified using
NA
s.
If
NULL
, then no covariance matrix parameter is fixed by
the null hypothesis and all are free to vary.
coefficients
can either be a named vector
where the names of the vector are names from
names(coef(object))
and the values are the values fixed by the null hypothesis.
Alternatively, vector
coefficients
can be the same length
as
object$coefficients
, with coefficients which are free to vary
specified using
NA
s.
If
NULL
, then all coefficients are free to
vary and none are fixed by the null hypothesis.
slm.nlminb
(if optimization
of the log-likelihood under the null hypothesis is required).
See routine
slm.nlminb
.
chisquared
.
p.value
.
lrt.slm
is used to perform likelihood ratio tests on the
covariance matrix
parameters
and the linear model
coefficients
of
a spatial regression model. Elements of either of these vectors can
be specified to fixed values, or can be left free to vary.
Each (linearly independent) parameter which is restricted to a fixed values
contributes one degree of freedom to the chi-squared statistic used in
performing the likelihood ratio test.
Likelihood ratio tests compare the optimal likelihood under two
hypothesis. In
lrt.slm
, the alternative hypothesis is that all
model parameters are free to vary, so the maximum likelihood estimates
obtained from
slm
and used as input to
lrt.slm
maximize the
likelihood hypothesis under the alternative hypothesis. The null
hypothesis is obtained by restricting model parameters to fixed
values. If the null hypothesis is true, then twice the log
of the ratio of the optimal likelihoods under the null and alternative
hypotheses is asymptotically distributed as a chi-squared statistic
with degrees of freedom equal to the number of fixed parameters (see
Haining, 1990, page 143). Using this chi-squared distribution, the
significance level is easily obtained.
Closed form expressions for the optimal linear model coefficients are
available if the covariance matrix parameters (except the scale
parameter) are known. In this case the likelihood ratio test will be
relatively inexpensive to compute. However, if one or more covariance
matrix parameters is not known, an iterative algorithm must be
used to compute the optimal log-likelihood under the alternative
hypothesis. In this case, the optimization algorithm used is
identical to the algorithm used by the routine
slm
, and can be quite
cpu intensive.
lrt.slm
does not allow likelihood ratio tests on the scale parameter.
Haining, R. (1990). Spatial Data Analysis in the Social and Environmental Sciences. Cambridge University Press, London.
sids.slm <- slm(sid.ft ~ nwbirths.ft, cov.family=CAR, data=sids, subset=-4, spatial.arglist=list(weights=1/sids$births, neighbor=sids.neighbor)) lrt(sids.slm, 0.12, c(NA, 0)) lrt(sids.slm, 0.12, c("nwbirths.ft"=0)) # another way to specify the test