探索许多列的缺失值嗨,
我喜欢编写一个脚本来探索缺失值,当我执行它时,将为每列生成许多表。由于我使用的是多变量正常插补,因此必须同时选择所有列。你能帮我实现吗?这是我到目前为止的脚本。
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 )} ) ));"
)
);