Skip to content

Commit bc4607a

Browse files
committed
update to SlX object call
1 parent 061d076 commit bc4607a

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

R/lm.RStests.R

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,19 @@ lm.RStests <- function(model, listw, zero.policy=attr(listw, "zero.policy"), tes
9494
warning("Out-of-range p-value: reconsider test arguments")
9595
names(p.value) <- ""
9696
method <- "Rao's score (a.k.a Lagrange multiplier) diagnostics for spatial dependence"
97-
data.name <- paste("\n", paste(strwrap(paste("model: ",
98-
gsub("[ ]+", " ", paste(deparse(model$call),
99-
sep="", collapse="")))), collapse="\n"),
100-
"\nweights: ", listw_name, "\n", sep="")
97+
fmla <- gsub("[ ]+", " ", paste(deparse(model$call), sep="",
98+
collapse=""))
99+
if (GNM) {
100+
if (!is.null(attr(model, "SLX_call"))) {
101+
fmla <- paste("lm(", attr(model, "SLX_call"), ")", sep="")
102+
} else {
103+
fmla <- gsub("[ ]+", " ", paste(deparse(model$terms),
104+
sep="", collapse=""))
105+
}
106+
}
107+
data.name <- paste("\n", paste(strwrap(paste("model: ", fmla)),
108+
collapse="\n"),
109+
"\ntest weights: ", listw_name, "\n", sep="")
101110
tres[[i]] <- list(statistic=statistic, parameter=parameter,
102111
p.value=p.value, method=method, data.name=data.name)
103112
class(tres[[i]]) <- "htest"

man/SD.RStests.Rd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ A list of class \code{LMtestlist} of \code{htest} objects, each with:
3131
\item{data.name}{a character string giving the name(s) of the data.}
3232
}
3333
\references{
34-
Malabika Koley and Anil K. Bera (2024) To use, or not to use the spatial Durbin model? – that is the question, Spatial Economic Analysis, 19:1, 30-56, \doi{10.1080/17421772.2023.2256810}; Malabika Koley (2024) Specification Testing under General Nesting Spatial Model, \url{https://sites.google.com/view/malabikakoley/research}.
34+
Malabika Koley and Anil K. Bera (2024) To use, or not to use the spatial Durbin model? – that is the question, Spatial Economic Analysis, 19:1, 30-56, \doi{10.1080/17421772.2023.2256810}; Malabika Koley (2024) Specification Testing under General Nesting Spatial Model (Appendix C), \url{https://sites.google.com/view/malabikakoley/research}.
3535
}
3636
\author{Roger Bivand \email{Roger.Bivand@nhh.no}, Malabika Koley and Anil K. Bera}
3737
\note{

0 commit comments

Comments
 (0)