你好,
我正在尝试分析一些数据的趋势,其中我随时间调整了几组产品,但它们具有相同的初始条件。有可能有一个类别可以应用于同一列中的多个其他类别。或者,换句话说,我试图将下面的每行连接到初始条件组。
</CODE></PRE></LINGO-BODY><LINGO-LABS id="lingo-labs-813112" slang="en-US" mode="CREATE"><LINGO-LABEL>基础数据分析与建模</LINGO-LABEL><LINGO-LABEL>数据探索与可视化</LINGO-LABEL></LINGO-LABS><LINGO-SUB id="lingo-sub-813122" slang="en-US" mode="CREATE">回复:绘制具有相同初始条件的多个组</LINGO-SUB><LINGO-BODY id="lingo-body-813122" slang="en-US" mode="CREATE"><P>您的数据是什么样的?</P></LINGO-BODY><LINGO-SUB id="lingo-sub-813123" slang="en-US" mode="CREATE">回复:绘制具有相同初始条件的多个组</LINGO-SUB><LINGO-BODY id="lingo-body-813123" slang="en-US" mode="CREATE"><P>为了绘制图表的目的,我倾向于为想要显示的每个分组复制我的控制组数据。</P></LINGO-BODY><LINGO-SUB id="lingo-sub-813247" slang="en-US" mode="CREATE">回复:绘制具有相同初始条件的多个组</LINGO-SUB><LINGO-BODY id="lingo-body-813247" slang="en-US" mode="CREATE"><P>同意<A href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687" target="_blank">@txnelson</A> ,此外,为了显示该线,只需向数据集中每个组<STRONG>添加一个数据点</STRONG>- 具有中位数(或平均值)。<BR /><BR />另一方面,必须这么做却令人吃惊。<BR />对于每个组,都有几个时间步骤的数据可用,因此也应该有 0h 数据 - 而不是<U>单独的</U>“0h 数据集”。</P><P>- 如果 0h 数据与组的运行分开,如何保证组的 0h 数据与 0h 数据集的数据相匹配?<BR /> - 如果这些组是 0h 数据集的子集,如何保证它们无法区分?最坏情况:组 30/35 对应于样本的下 20% - 条件 50/50 对应于上 20%。</P></LINGO-BODY><LINGO-SUB id="lingo-sub-813439" slang="en-US" mode="UPDATE">回复:绘制具有相同初始条件的多个组</LINGO-SUB><LINGO-BODY id="lingo-body-813439" slang="en-US" mode="UPDATE"><P>这是在多种存储条件下准备稳定性数据的一个非常常见的数据准备步骤。如下所述,执行此操作的一般程序是:</P><OL><LI>将存储条件汇总到单独的表格中。</LI><LI>越过原始表末尾的那些条件,并将那些行的时间点设置为初始时间点。</LI><LI>计算起始时间点的平均响应,并将该值用于上面粘贴的所有行。</LI><LI>从数据表中删除或隐藏/排除原始初始时间点。</LI></OL><P>我最近刚完成一个脚本来帮助实现这一自动化(不提供任何保证或担保)。</P><P> </P><PRE><CODE class=" language-jsl">Names Default To Here( 1 );
// utility to replicate stability condition labels and variables at time Zero for each stabilty condition
dt = Current Data Table();
timelistdisplay = 0;
nw = New Window( "Replicate Initial Time Point Results Across Conditions",
hb = H List Box(
pb_1 = Panel Box( "Select Columns", clb_1 = Col List Box( all ) ),
pb_2 = Panel Box( "Case Column into Role",
lub_variables = Lineup Box( N Col( 2 ),
Button Box( "Time Column",
Try(
clb_time << append( clb_1 << get selected );
c_time_name = (clb_time << get items)[1];
);
c_time = Column( dt, c_time_name );
time_list = Associative Array( As List( (c_time << get values) ) ) << get keys;
For Each( {s, i}, time_list, time_list[i] = Char( s ) );
If( !timelistdisplay,
pb_2 << Append(
hb_timelist = H List Box( Text Box( "Initial Time Point to Replicate" ), combox = Combo Box( {} ) )
);
timelistdisplay = 1;
);
combox << set items( time_list );
),
clb_time = Col List Box( "numeric", Max Items( 1 ), nlines( 1 ), minItems( 1 ) ),
Button Box( "Stability Condition Columns", clb_stabcond << append( clb_1 << get selected ) ),
clb_stabcond = Col List Box( Min Items( 1 ), nLines( 4 ) ),
Button Box( "Response Columns", clb_response << append( clb_1 << get selected ) ),
clb_response = Col List Box( minItems( 1 ), nlines( 5 ) ),
)
),
pb_3 = Panel Box( "Actions",
V List Box(
Button Box( "OK",
responsecols = clb_response << get items;
// check that all boxes are populated and if so, then do actions
If(
N Items( clb_time << get items ) & N Items( clb_stabcond << get items ) &
N Items( clb_response << get items ),
// make list of column references for the stability condition columns
dt << clear select;
Eval(
Substitute(
Expr(
dt << select where( As Column( dt, c_time_name ) != vvv )
),
Expr( vvv ),
Num( combox << get selected )
)
);
dt_sub = dt << Subset( Selected Rows( 1 ), Selected columns only( 0 ) );
stab_cond_col_list = {};
For Each( {s, i}, clb_stabcond << get items, Insert Into( stab_cond_col_list, Column( dt, s ) ) );
dt_summary = dt_sub << Summary(
Group( stab_cond_col_list ),
Freq( "None" ),
Weight( "None" ),
Link to original data table( 0 ),
output table name( "Stability Conditions" )
);
dt_summary << delete columns( :N Rows );
Close( dt_sub, nosave );
cnew = dt_summary << New Column();
cnew << set name( c_time_name );
timezero = Num( combox << get selected );
cnew << Set Values( J( N Row( dt_summary ), 1, timezero ) );
dt << clear select;
// get the results for time zero
Eval(
Substitute(
Expr(
dt << select where( As Column( dt, c_time_name ) == vvv )
),
Expr( vvv ),
Num( combox << get selected )
)
);
// add those to the summary table of conditions
For Each( {rc}, responsecols,
val = Mean( Column( dt, rc )[dt << get selected rows] );
c = dt_summary << New Column( rc );
c << set values( J( N Rows( dt_summary ), 1, val ) );
);
// hide and exclude the initial values results in the first table
dt << hide and exclude;
dt << clear select;
// now concatenate the summary table onto the original table.
dt << Concatenate( dt_summary, Append to first table );
close(dt_summary, nosave);
nw<<CLOSE window=""></CLOSE>Example: (also attached)
<SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MathStatChem_1-1731704006225.png" style="width: 999px;"><span class="lia-inline-image-display-wrapper" image-alt="MathStatChem_1-1731704006225.png" style="width: 999px;"><img src="https://us.v-cdn.net/6038925/uploads/images/70256i4E461D2F9CFB7556/MathStatChem_1-1731704006225.png" role="button" title="MathStatChem_1-1731704006225.png" alt="MathStatChem_1-1731704006225.png" /></span></SPAN>
Dialog:
<SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MathStatChem_2-1731704075831.png" style="width: 999px;"><span class="lia-inline-image-display-wrapper" image-alt="MathStatChem_2-1731704075831.png" style="width: 999px;"><img src="https://us.v-cdn.net/6038925/uploads/images/70257i6FDA957D441996BE/MathStatChem_2-1731704075831.png" role="button" title="MathStatChem_2-1731704075831.png" alt="MathStatChem_2-1731704075831.png" /></span></SPAN>
Result:
<SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MathStatChem_3-1731704134924.png" style="width: 999px;"><span class="lia-inline-image-display-wrapper" image-alt="MathStatChem_3-1731704134924.png" style="width: 999px;"><img src="https://us.v-cdn.net/6038925/uploads/images/70258i63CBC9328FC01167/MathStatChem_3-1731704134924.png" role="button" title="MathStatChem_3-1731704134924.png" alt="MathStatChem_3-1731704134924.png" /></span></SPAN>