<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />嗨,
之前,我描述了我的問題,我需要提一下我使用JMP7。
我有一個包含12列的表,前6列是接下來6列中每一列的描述性參數。前6列是所有字符,最後6列都是數字,二項式。
我需要為最後6列中的每一列運行邏輯回歸,並使用前6列作為預測器從“Pearson”測試中提取“Prob> ChiSq”值。
現在,我為“Y,Response”列之一製作了以下腳本:
dt = Current Data Table();
column_names = dt << Get Column Names(Character, String);
results = New Table("Results", Invisible,
New Column("Parameter", character),
New Column("GEN", numeric),
Add Rows(NItems(column_names))
);
for(i=1,i<=NItems(column_names),i++,
colName = column_names;
cmd = Expr(
ow = dt << Contingency(
Y( :GEN),
X( :cName ),
Contingency Table( 0 ),
Mosaic Plot( 0 )
);
Wait(0.1);
owr = ow<
pValueBox= owr[NumberColBox(6)];
pValue = pValueBox[2];
Column(results,1) = colName;
Column(results,2) = pValue;
ow << Close Window;
);
Substitute Into(cmd,Expr(cName),colName);
Eval(cmd);
);
results << journal;
Close(results);
當我運行它時,它完美地運行。現在,如果我將下一列添加到腳本中:
dt = Current Data Table();
column_names = dt << Get Column Names(Character, String);
results = New Table("Results", Invisible,
New Column("Parameter", character),
New Column("GEN", numeric),
New Column("Ne", numeric),
Add Rows(NItems(column_names))
);
for(i=1,i<=NItems(column_names),i++,
colName = column_names;
cmd = Expr(
ow = dt << Contingency(
Y( :GEN, :Ne),
X( :cName ),
Contingency Table( 0 ),
Mosaic Plot( 0 )
);
Wait(0.1);
owr = ow<
pValueBox= owr[NumberColBox(6)];
pValue = pValueBox[2];
pValueBox1= owr[NumberColBox(12)];
pValue1 = pValueBox1[2];
Column(results,1) = colName;
Column(results,2) = pValue;
Column(results,3) = pValue1;
ow << Close Window;
);
Substitute Into(cmd,Expr(cName),colName);
Eval(cmd);
);
results << journal;
Close(results);
腳本停止工作。我檢查了樹結構,並且兩個NumberColBox都引用了正確的值,但沒有創建日誌,腳本停止工作。
現在,我的問題:
1)當我有靜態多個Y值時,如何解決我的情況?
2)是否可以通過循環定義動態Y值?我有兩個循環變得複雜。
我很感激任何建議。