Skip to content

Commit

Permalink
reformatting
Browse files Browse the repository at this point in the history
  • Loading branch information
WinzarH committed May 11, 2024
1 parent 0fb8ebc commit 80ef0a8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions R/makeCorrAlpha.R
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ makeCorrAlpha <- function(items, alpha, variance = 0.5, precision = 0) {
}

is_positive_definite <- min(best_eigen_values) >= 0

if (is_positive_definite) {
cat(paste0("stopped at swap - ", r, "\n"))
break
Expand All @@ -184,8 +185,12 @@ makeCorrAlpha <- function(items, alpha, variance = 0.5, precision = 0) {

k <- items

if (precision < 0) {precision <- 0 }
if (precision > 3) {precision <- 3 }
if (precision < 0) {
precision <- 0
}
if (precision > 3) {
precision <- 3
}


## Calculate the mean correlation coefficient from alpha
Expand Down Expand Up @@ -259,4 +264,3 @@ makeCorrAlpha <- function(items, alpha, variance = 0.5, precision = 0) {

return(cor_matrix)
} ## end matrixFromAlpha function

0 comments on commit 80ef0a8

Please sign in to comment.