大家好,我在腳本說明書中好像找不到關於排列組合的資訊,我需要一點方向,因為也是重複執行,會是使用"FOR"函數嗎?
比如我有6個因子( :pH, :ORP, :EC, :DO, :TN, :TP ),我需要執行3~6個不同組合因子且不排序的主成分,全部結果會有42種。
另外報告中滑鼠右鍵的''save principal components''有辦法使用腳本執行嗎?以下是我嘗試的腳本,顯然是不成功的。
任何建議都表示感謝。
names default to here(1);
dt = Current Data Table();
dto = New Table("Output",
New Column("PCA"),
Add Rows(1),
);
pca = dt << Principal Components(
Y( :pH, :ORP, :EC, :DO, :TN, :TP ),
Estimation Method( "Default" ),
"on Correlations"
);
dto:PCA[i] = (report(pca)["save Principal components"] << get)[1];
pca(report)<<close window;
你好,我需要的內容如附件(PCA)中箭頭位置,他需要使用滑鼠右鍵去選擇並決定要幾個成分後將結果貼在原本使用的數據表中,如附件(Prin)。
謝謝


你好,非常感謝,不過遇到了點問題,要如何抓到附圖(Eigenvalues)中的"cumulative Percent"數據。
以下是我編輯完的腳本:
Names Default To Here( 1 );
dt = Data Table("PCA TEST");
dto = New Table("Output",
New Column("cumulative Percent"),
New Column("PCA1"),
New Column("PCA2"),
New Column("PCA3"),
New Column("PCA4"),
New Column("PCA5"),
New Column("PCA6"),
Add Rows(9),
);
pca = dt << Principal Components(
Y( :pH, :ORP, :EC, :DO, :TN, :TP ),
Estimation Method( "Default" ),
"on Correlations"
);
pca << save Principal components(6);
For(i=1,i<=9,i++,dto:pca1[i] = dt:Prin1[i]);
For(i=1,i<=9,i++,dto:pca2[i] = dt:Prin2[i]);
For(i=1,i<=9,i++,dto:pca3[i] = dt:Prin3[i]);
For(i=1,i<=9,i++,dto:pca4[i] = dt:Prin4[i]);
For(i=1,i<=9,i++,dto:pca5[i] = dt:Prin5[i]);
For(i=1,i<=9,i++,dto:pca6[i] = dt:Prin6[i]);
/*dto:cumulative Percent[1] = (report(pca)["Eigenvalues"][NumberColBox(5)]<<GET></GET>