Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
StijnVandenbulcke committed Mar 5, 2024
2 parents 3a7d9c6 + a2432da commit 561d9ed
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# msqrob 1.6.2

- Fixed issues related to residual degrees of freedom of overparameterized models.
- Fixed issue relating to coldata variables as factors.

# msqrob2 1.5.4

- Removed the full lmer model that was accidently left in the statmodel object.
Expand Down
4 changes: 4 additions & 0 deletions R/msqrob.R
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,10 @@ msqrobLmer <- function(y,
colnames(data) <- c(colnames(coldata),colnames(rowdata))
}

# Drop levels that are absent, for all factors
for (i in colnames(data)) {
if (is.factor(data[[i]])) data[[i]] <- droplevels(data[[i]])
}

#all possible variables are now in data, now we can create the fixed object if we use ridge regression
fixed <- model.matrix(nobars(formula), data = data)
Expand Down
5 changes: 3 additions & 2 deletions R/msqrobAggregate.R
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,11 @@ setMethod(
fun = aggregateFun
)

x <- getWithColData(object, i)
rowData(object[[name]])[[modelColumnName]] <- msqrobLmer(
y = assay(object[[i]]),
y = assay(x),
formula = formula,
data = colData(object),
data = colData(x),
rowdata = rowdata,
robust = robust,
ridge = ridge,
Expand Down

0 comments on commit 561d9ed

Please sign in to comment.