Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
9
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
R-packages
ufs
Commits
de148867
Commit
de148867
authored
Dec 04, 2020
by
Gjalt-Jorn Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
less CIs
parent
1c5ca947
Pipeline
#225314756
failed with stage
in 3 minutes and 35 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
33 deletions
+47
-33
R/CIM.R
R/CIM.R
+47
-33
No files found.
R/CIM.R
View file @
de148867
...
...
@@ -420,46 +420,60 @@ CIM <- function(data,
}
### Make dataframe with factor loading confidence intervals
if
(
'psych'
%in%
class
(
efa
))
{
if
(
n.itr
>
1
)
if
(
'psych'
%in%
class
(
efa
))
{
factorLoadingCIs
[[
rowVar
]][[
colVar
]]
<-
ufs
::
faConfInt
(
res
$
intermediate
$
efas
[[
rowVar
]][[
colVar
]]);
loadingCIs
<-
factorLoadingCIs
[[
rowVar
]][[
colVar
]];
factorLoadingCIs
[[
rowVar
]][[
colVar
]]
<-
ufs
::
faConfInt
(
res
$
intermediate
$
efas
[[
rowVar
]][[
colVar
]]);
loadingCIs
<-
factorLoadingCIs
[[
rowVar
]][[
colVar
]];
ciSummaryList
[[
rowIndex
]][[
colIndex
]]
<-
(
loadingCIs
[[
1
]]
$
hi
<
loadingCIs
[[
2
]]
$
lo
)
|
(
loadingCIs
[[
2
]]
$
hi
<
loadingCIs
[[
1
]]
$
lo
);
ciSummaryList
[[
rowIndex
]][[
colIndex
]]
<-
(
loadingCIs
[[
1
]]
$
hi
<
loadingCIs
[[
2
]]
$
lo
)
|
(
loadingCIs
[[
2
]]
$
hi
<
loadingCIs
[[
1
]]
$
lo
);
faDf
<-
matrix
(
unlist
(
factorLoadingCIs
[[
rowVar
]][[
colVar
]]),
ncol
=
6
);
}
else
{
faDf
<-
matrix
(
rep
(
NA
,
6
*
ncol
(
abbrVarsDat
)),
ncol
=
6
);
}
faDf
<-
matrix
(
unlist
(
factorLoadingCIs
[[
rowVar
]][[
colVar
]]),
ncol
=
6
);
### Get abbreviated scale names
abbr
<-
abbreviate
(
names
(
scales
));
}
else
{
faDf
<-
matrix
(
rep
(
NA
,
6
*
ncol
(
abbrVarsDat
)),
ncol
=
6
);
### 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]])));
colnames
(
faDf
)
<-
c
(
rep
(
c
(
'lo'
,
'est'
,
'hi'
),
2
));
}
colnames
(
faDf
)
<-
c
(
rep
(
c
(
'lo'
,
'est'
,
'hi'
),
2
));
faDfReordered
<-
faDf
[
order
(
rownames
(
faDf
)),
];
res
$
intermediate
$
faDfs
[[
rowVar
]][[
colVar
]]
<-
list
(
faDf_raw
=
faDf
,
faDf
=
faDfReordered
,
faDf_rounded
=
round
(
faDfReordered
,
2
));
}
else
{
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"
);
}
faDf
<-
data.frame
(
unclas
(
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"
);
}
###------------------------------------------------------------------
###------------------------------------------------------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment