Skip to content

Commit

Permalink
Merge pull request #57 from r-spatial/AK
Browse files Browse the repository at this point in the history
add AK test for stsls
  • Loading branch information
rsbivand authored Nov 18, 2024
2 parents 93683ed + 3faf1fe commit 1154e28
Show file tree
Hide file tree
Showing 6 changed files with 412 additions and 385 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: spatialreg
Version: 1.3-5
Date: 2024-08-19
Version: 1.3-6
Date: 2024-11-19
Title: Spatial Regression Analysis
Encoding: UTF-8
Authors@R: c(person("Roger", "Bivand", role = c("cre", "aut"), email = "[email protected]", comment=c(ORCID="0000-0003-2392-6140")),
Expand Down
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ importFrom("stats", "lm.fit", "as.formula", "coef", "lm", "model.extract",
importFrom("spdep", "is.symmetric.glist", "lag.listw", "card",
"nb2listw", "n.comp.nb", "listw2U", "listw2mat", "Szero", "listw2sn",
"mat2listw", "is.symmetric.nb", "chkIDs", "get.spChkOption",
"subset.listw")
"subset.listw", "spweights.constants")

import(Matrix#, except=c("expm")
)
Expand Down
10 changes: 5 additions & 5 deletions R/kpgm_new.R
Original file line number Diff line number Diff line change
Expand Up @@ -518,9 +518,9 @@ impacts.Gmsar <- function(obj, ..., n=NULL, tr=NULL, R=NULL, listw=NULL,
####SARAR model

gstsls<-function (formula, data = list(), listw, listw2=NULL,
na.action = na.fail, zero.policy = attr(listw, "zero.policy"), pars=NULL, scaleU=FALSE,
control = list(), verbose = NULL, method = "nlminb", robust = FALSE,
legacy = FALSE, W2X = TRUE )
na.action = na.fail, zero.policy = attr(listw, "zero.policy"), pars=NULL,
scaleU=FALSE, control = list(), verbose = NULL, method = "nlminb",
robust = FALSE, legacy = FALSE, W2X = TRUE, sig2n_k=FALSE)
{


Expand Down Expand Up @@ -590,7 +590,7 @@ gstsls<-function (formula, data = list(), listw, listw2=NULL,
}

instr <- cbind(WX, WWX)
firststep <- tsls(y = y, yend = wy, X = x, Zinst = instr, robust = robust, legacy = legacy)
firststep <- tsls(y = y, yend = wy, X = x, Zinst = instr, robust = robust, legacy = legacy, sig2n_k=sig2n_k)

ukp <- residuals(firststep)

Expand Down Expand Up @@ -641,7 +641,7 @@ gstsls<-function (formula, data = list(), listw, listw2=NULL,
colnames(xt) <- xcolnames
colnames(wyt) <- c("Rho_Wy")
secstep <- tsls(y = yt, yend = wyt, X = xt, Zinst = instr,
robust = robust, legacy = legacy)
robust = robust, legacy = legacy, sig2n_k=sig2n_k)
rho<-secstep$coefficients[1]
coef.sac<-secstep$coefficients
rest.se <- sqrt(diag(secstep$var))
Expand Down
Loading

0 comments on commit 1154e28

Please sign in to comment.