-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRun_Example_GSCA_Basic.m
More file actions
90 lines (84 loc) · 2.57 KB
/
Run_Example_GSCA_Basic.m
File metadata and controls
90 lines (84 loc) · 2.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Illustration for GSCA.Basic_Prime package %
% Author: Gyeongcheol Cho %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Description: %
% - This code aims to illustrate how to use GSCA.Basic_Prime package. %
% - The dataset is a replica of the ACSI data used in Cho & Hwang %
% (2024). %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% References %
% * Hwang, H. & Takane, Y. (2004). Generalized structured component %
% analysis. Psychometrika, 69(1), 81-99. %
% * Cho, G., Hwang, H. Generalized Structured Component Analysis %
% Accommodating Convex Components: A Knowledge-Based Multivariate %
% Method with Interpretable Composite Indexes. Psychometrika 89, %
% 241–266 (2024). https://doi.org/10.1007/s11336-023-09944-3 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
help BasicGSCA()
Data=readtable('ACSI_774_Replica.csv');
%% If missing values are included
Z0=Data{:,:};
W0=[1 1 1 0 0 0 0 0 0 0 0 0 0 0 ; ...
0 0 0 1 1 1 0 0 0 0 0 0 0 0 ; ...
0 0 0 0 0 0 1 1 0 0 0 0 0 0 ; ...
0 0 0 0 0 0 0 0 1 1 1 0 0 0 ; ...
0 0 0 0 0 0 0 0 0 0 0 1 0 0 ; ...
0 0 0 0 0 0 0 0 0 0 0 0 1 1 ]';
C0=zeros(6,14);%W0';
B0=[0 1 1 1 0 0;...
0 0 1 1 0 0;...
0 0 0 1 0 0;...
0 0 0 0 1 1;...
0 0 0 0 0 1;...
0 0 0 0 0 0];
ind_sign=[1,4,7,9,12,13];
N_Boot=1000;
Max_iter = 1000;
Min_limit = 10^(-8);
Flag_C_Forced = true;
Flag_Parallel = false;
Opt_Missing = 0;
Results=GSCA_Basic(Z0,W0,C0,B0,ind_sign,N_Boot,Max_iter,Min_limit,Flag_C_Forced,Flag_Parallel,Opt_Missing);
INI=Results.INI;
TABLE=Results.TABLE;
ETC=Results.ETC;
INI
INI.GoF
INI.Converge
INI.iter
INI.W
INI.C
INI.B
INI.R2_m
INI.R2_s
TABLE
TABLE.W
TABLE.C
TABLE.B
ETC
%% If missing values are included in data
Percentage_deleted=.10;
[N,J]=size(Z0);
ind_missing=rand(N,J)<=Percentage_deleted;
Z0_miss=Z0;
Z0_miss(ind_missing)=NaN;
Opt_Missing = 4;
Results=GSCA_Basic(Z0_miss,W0,C0,B0,ind_sign,N_Boot,Max_iter,Min_limit,Flag_C_Forced,Flag_Parallel,Opt_Missing);
INI=Results.INI;
TABLE=Results.TABLE;
ETC=Results.ETC;
INI
INI.GoF
INI.Converge
INI.iter
INI.W
INI.C
INI.B
INI.R2_m
INI.R2_s
TABLE
TABLE.W
TABLE.C
TABLE.B
ETC