Skip to content

Commit

Permalink
minor bugfix for interactions in Xvlm matrix creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Chlebicki committed Jan 19, 2024
1 parent 72b4df7 commit b7fd415
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: singleRcapture
Type: Package
Title: Single-Source Capture-Recapture Models
Version: 0.2.1.1
Version: 0.2.1.2
Authors@R:
c(person(given = "Piotr",
family = "Chlebicki",
Expand Down
11 changes: 2 additions & 9 deletions R/Internals.R
Original file line number Diff line number Diff line change
Expand Up @@ -492,12 +492,6 @@ singleRcaptureinternalIRLSmultipar <- function(dependent,
# make Xvlm matrix
#' @importFrom stats terms
singleRinternalGetXvlmMatrix <- function(X, formulas, parNames, contrasts = NULL) {
if (length(formulas[[1]]) == 3) {
#formulas[[1]][[2]] <- NULL
}
if (attr(attr(X, "terms"), "response") != 0) {
#X <- X[, colnames(X)[-attr(attr(X, "terms"), "response")], drop = FALSE]
}
nPar <- length(parNames)
Xses <- list()

Expand All @@ -506,13 +500,12 @@ singleRinternalGetXvlmMatrix <- function(X, formulas, parNames, contrasts = NULL
if (length(attr(terms(formulas[[k]], data = X), "term.labels")) != 0) {
Xses[[k]] <- model.matrix(
terms(formulas[[k]], data = X),
data = X[, colnames(X)]
data = X
)
} else {
Xses[[k]] <- model.matrix(
~ 1,
X[, intersect(attr(terms(formulas[[k]], data = X), "term.labels"),
colnames(X)), drop = FALSE]
X
)
if (attr(terms(formulas[[k]], data = X), "intercept") == 0)
warning(paste0(
Expand Down
2 changes: 1 addition & 1 deletion R/sandwichMethods.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ bread.singleRStaticCountData <- function(x,...) {
#' @author Piotr Chlebicki, Maciej Beręsewicz
#'
#' @description S3 method for \code{vcovHC} to handle \code{singleRStaticCountData} class objects.
#' Works exactly like \code{vcov.default} the only difference being that this method handles vector generalised linear models.
#' Works exactly like \code{vcovHC.default} the only difference being that this method handles vector generalised linear models.
#' Updating the covariance matrix in variance/standard error estimation for population size estimator can be done via [singleRcapture::redoPopEstimation()]
#'
#' @param x a fitted \code{singleRStaticCountData} class object.
Expand Down

0 comments on commit b7fd415

Please sign in to comment.