Skip to content

Commit

Permalink
fix: fixed small error in degrees of freedom
Browse files Browse the repository at this point in the history
  • Loading branch information
cvanderaa committed Apr 24, 2024
1 parent 6a39bb3 commit 352c5e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# scp 1.13

## scp 1.13.5
## scp 1.13.5

(nothing yet)
- fix: fixed small error in degrees of freedom
- fix: break workflow upon infinite values

## scp 1.13.4

Expand Down
3 changes: 2 additions & 1 deletion R/ScpModel-Workflow.R
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,8 @@ scpModelWorkflow <- function(object, formula,
hat <- x %*% tcrossprod(xtxInvLam, x)
df <- length(y) - sum(diag(2 * hat - tcrossprod(hat)))
} else {
df <- max(length(y) - ncol(x) - 1, 1)
## note: not - 1 because intercept is in x
df <- max(length(y) - ncol(x), 1)
}
residuals <- y - x %*% beta
list(coefficients = beta[, 1],
Expand Down

0 comments on commit 352c5e3

Please # to comment.