探索許多列的缺失值嗨,
我喜歡編寫一個腳本來探索缺失值,當我執行它時,將為每列生成許多表。由於我使用的是多變量正常插補,因此必須同時選擇所有列。你能幫我實現嗎?這是我到目前為止的腳本。
lstNames = dt << Get Column Names(String,Numeric);
ncols = N items(lstNames);
for (i=1, i <= N items(cols), i++,
obj = Explore Missing Values(
Y(
Column(lstNames[i])
),
Missing Value Report,
SendToReport(
Dispatch( {}, "Missing Columns", OutlineBox, {SetHorizontal( 1 )} )
)
);
謝謝
obj << 多元正常估算 ;
);
Re:探索許多列的缺失值感謝Jim快速解決方案。它現在有效。
Re:探索許多列的缺失值將For循環定義從“<”更改為“<=”
Re:探索許多列的缺失值吉姆,嗨,
感謝您更新的腳本。它工作正常,日誌中沒有錯誤。我注意到的唯一一件事是表的最後一列沒有包含在缺失值中。我在兩個不同的數據表上進行了測試,兩者都顯示了相同的問題 有什麼理由嗎?
感謝您的進一步幫助。謝謝
Re:探索許多列的缺失值糟糕,我刪除了錯誤的一對“)”。 試試這個:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\Semiconductor Capability.jmp" );
lstNames = dt << Get Column Names( string, Numeric );
// Create a string variable of the structure the platform
// wants them passed to it
names = ":" || lstNames[1];
For( i = 2, i < N Items( lstNames ), i++,
names = names || ",:" || lstNames[i]
);
// Execute the following string, with the column names embedded in it
Eval(
Parse(
"obj = Explore Missing Values(
Y( " || names ||
"),
Missing Value Report,
SendToReport( Dispatch( {}, \!"Missing Columns\!", OutlineBox, {SetHorizontal( 1 )} ))) ;"
)
);Re:探索許多列的缺失值吉姆,嗨,
感謝您更新的腳本。看起來我仍然得到同樣的錯誤。
出乎意料的“)”。也許有一個缺失的“;”要么 ”,”。
第2行第4369欄:... ABC))►),...
剩下的文字被忽略了
),缺少值報告,SendToReport(Dispatch({}“,”Missing Columns,OutlineBox,{
SetHorizontal(1)})));
探索缺失值[]
感謝您的進一步幫助。
Re:探索許多列的缺失值在代碼中無意中留下了2“)”這裡是一個更正版本
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\Semiconductor Capability.jmp" );
lstNames = dt << Get Column Names( string, Numeric );
// Create a string variable of the structure the platform
// wants them passed to it
names = ":" || lstNames[1];
For( i = 2, i < N Items( lstNames ), i++,
names = names || ",:" || lstNames[i]
);
// Execute the following string, with the column names embedded in it
Eval(
Parse(
"obj = Explore Missing Values(
Y( " || names ||
")) ),
Missing Value Report,
SendToReport( Dispatch( {}, \!"Missing Columns\!", OutlineBox, {SetHorizontal( 1 )} ) ;"
)
);Re:探索許多列的缺失值吉姆,嗨,
我剛剛在日誌文件中註意到有一個錯誤:
出乎意料的“)”。也許有一個缺失的“;”要么 ”,”。
第2行第789列:......:P2A1,:P2B1,:PM_L1,:P1))►),...
剩下的文字被忽略了
),缺少值報告,SendToReport(Dispatch({}“,”Missing Columns,OutlineBox,{
SetHorizontal(1)})));
探索缺失值[]
你知道這與這有什麼關係嗎?我注意到它不會在最後一列缺少值插補。
謝謝你的幫助。
Re:探索許多列的缺失值吉姆,嗨,
非常感謝您的快速反饋和解決方案。我嘗試了你的建議,它完美無缺。我補充道
obj << Multivariate Normal Imputation;
做插補。再次感謝。
Re:探索許多列的缺失值以下是解決此問題的一種方法示例
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\Semiconductor Capability.jmp" );
lstNames = dt << Get Column Names( string, Numeric );
// Create a string variable of the structure the platform
// wants them passed to it
names = ":" || lstNames[1];
For( i = 2, i < N Items( lstNames ), i++,
names = names || ",:" || lstNames[i]
);
// Execute the following string, with the column names embedded in it
Eval(
Parse(
"obj = Explore Missing Values(
Y( " || names ||
")) ),
Missing Value Report,
SendToReport( Dispatch( {}, \!"Missing Columns\!", OutlineBox, {SetHorizontal( 1 )} ) ));"
)
);