Commit de148867 authored by Gjalt-Jorn Peters's avatar Gjalt-Jorn Peters
Browse files

less CIs

parent 1c5ca947
Pipeline #225314756 failed with stage
in 3 minutes and 35 seconds
...@@ -420,46 +420,60 @@ CIM <- function(data, ...@@ -420,46 +420,60 @@ CIM <- function(data,
} }
### Make dataframe with factor loading confidence intervals ### Make dataframe with factor loading confidence intervals
if ('psych' %in% class(efa)) { if (n.itr > 1)
if ('psych' %in% class(efa)) {
factorLoadingCIs[[rowVar]][[colVar]] <- factorLoadingCIs[[rowVar]][[colVar]] <-
ufs::faConfInt(res$intermediate$efas[[rowVar]][[colVar]]); ufs::faConfInt(res$intermediate$efas[[rowVar]][[colVar]]);
loadingCIs <- loadingCIs <-
factorLoadingCIs[[rowVar]][[colVar]]; factorLoadingCIs[[rowVar]][[colVar]];
ciSummaryList[[rowIndex]][[colIndex]] <- ciSummaryList[[rowIndex]][[colIndex]] <-
(loadingCIs[[1]]$hi < loadingCIs[[2]]$lo) | (loadingCIs[[1]]$hi < loadingCIs[[2]]$lo) |
(loadingCIs[[2]]$hi < loadingCIs[[1]]$lo); (loadingCIs[[2]]$hi < loadingCIs[[1]]$lo);
faDf <- matrix(unlist(factorLoadingCIs[[rowVar]][[colVar]]), faDf <- matrix(unlist(factorLoadingCIs[[rowVar]][[colVar]]),
ncol=6); ncol=6);
} else {
faDf <- matrix(rep(NA, 6*ncol(abbrVarsDat)),
ncol=6);
}
### Get abbreviated scale names } else {
abbr <- abbreviate(names(scales)); faDf <- matrix(rep(NA, 6*ncol(abbrVarsDat)),
ncol=6);
### Set row and column names }
rownames(faDf) <- c(abbrScales[[abbrScaleNames[rowVar]]], colnames(faDf) <- c(rep(c('lo', 'est', 'hi'), 2));
abbrScales[[abbrScaleNames[colVar]]]);
# paste0(abbr[rowVar], 1:length(scales[[rowVar]])),
# paste0(abbr[colVar], 1:length(scales[[colVar]])));
colnames(faDf) <- c(rep(c('lo', 'est', 'hi'), 2));
faDfReordered <- faDf[order(rownames(faDf)), } else {
];
res$intermediate$faDfs[[rowVar]][[colVar]] <-
list(faDf_raw = faDf,
faDf = faDfReordered,
faDf_rounded = round(faDfReordered, 2));
if (ufs::opts$get('debug')) { faDf <-
cat0("\n\nJust stored this dataframe to create a gTable later on:\n\n"); data.frame(
print(res$intermediate$faDfs[[rowVar]][[colVar]]$faDf_rounded); unclas(
cat0("\n\n"); res$intermediate$efas[[rowVar]][[colVar]]
} )
);
}
### Get abbreviated scale names
abbr <- abbreviate(names(scales));
### Set row and column names
rownames(faDf) <- c(abbrScales[[abbrScaleNames[rowVar]]],
abbrScales[[abbrScaleNames[colVar]]]);
# paste0(abbr[rowVar], 1:length(scales[[rowVar]])),
# paste0(abbr[colVar], 1:length(scales[[colVar]])));
faDfReordered <- faDf[order(rownames(faDf)),
];
res$intermediate$faDfs[[rowVar]][[colVar]] <-
list(faDf_raw = faDf,
faDf = faDfReordered,
faDf_rounded = round(faDfReordered, 2));
if (ufs::opts$get('debug')) {
cat0("\n\nJust stored this dataframe to create a gTable later on:\n\n");
print(res$intermediate$faDfs[[rowVar]][[colVar]]$faDf_rounded);
cat0("\n\n");
}
###------------------------------------------------------------------ ###------------------------------------------------------------------
###------------------------------------------------------------------ ###------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment