Dunnett 的多個 Y我正在嘗試獲取一個腳本,該腳本將在擬合模型中自動在多個 Y 上運行 Dunnett,我的問題是:
如果我更改多重比較部分,其中因子和水平不是它起作用的變量,而是僅適用於第一個 Y,則它不會為剩餘的 Y 重複 Dunnett 部分。 所以我的問題:
1. 為什麼這不像擬合模型那樣工作,其中變量用於 Dunnett 的因子和控制水平?
2. 我們可以自動獲得多個 Y 的 Dunnett's 嗎?
麗莎
這是我到目前為止:
Names Default To Here( 1 );
Clear Log();
lbwidth = 130;
Tolerance = .01;
If( Not( Is Scriptable( dt ) ),
// Check that there is a data set open;
//ca=Caption("Please Open Design Data Set", Back Color(yellow));
//Stop();
dtsel = Pick File( "Open File", {"JMP|jmp", "All files|*"} );
If( dtsel == "",
Stop(),
Try( dt = Open( dtsel ), Stop() )
);
);
Dia_Window = Expr(
// Window to get list of factors and response;
Factorws = New Window( "Fit Model With Dunnetts",
show toolbars( 0 ),
Show Menu( 0 ),
Border Box( Left( 3 ), top( 2 ),
V List Box(
H List Box(
Panel Box( "Select Column to be used as the Factor and the Response(s)",
colListData = Col List Box(
All,
width( lbWidth ),
nLines( Min( nc, 10 ) )
)
),
Panel Box( "The Factor",
Lineup Box( N Col( 2 ), Spacing( 3 ),
Button Box( "Factor",
colListW << Append( colListData << GetSelected )
),
colListW = Col List Box(
width( lbWidth ),
nLines( 1 ),
MinItems( 1 )
),
)
),
Panel Box( "The Response(s)",
Lineup Box( N Col( 2 ), Spacing( 3 ),
Button Box( "Response(s)",
colListY << Append( colListData << GetSelected )
),
colListY = Col List Box(
width( lbWidth ),
nLines( 8 ),
MinItems( 1 )
),
)
),
Panel Box( "Action",
Lineup Box( N Col( 1 ),
Button Box( "OK",
nm = colListW << GetItems;
nY = colListY << GetItems;
If( N Items( nm ) > 0,
dm = dt << Get As Matrix( nm );
Factorws << Close Window;
Eval( next );
);
),
Button Box( "Cancel",
Factorws << Close Window;
Stop();
),
Text Box( " " ),
Button Box( "Remove",
colListW << RemoveSelected;
colListY << RemoveSelected;
)
)
)
),
Text Box( "Written by Lisa Winland lisawinland@icloud.com" )
)
)
)
);
next = Expr(
Show( nm );
colvalues = Associative Array( Column( nm ) ) << Get Keys;
Show( colvalues );
listvalues = {};
Show( nY );
nw = New Window( "User Input for Dunnett's",
Outline Box( "Level Selection for Dunnett's",
values = {};
i = 1;
For( i = 1, i <= N Items( colvalues ), i += 1,
Values[i] = Char( colvalues[i] )
);
Show( Values );
H List Box(
Text Box( "Select Value for Control" ),
listvalues = List Box( Values )
);,
Button Box( "OK",
level = (listvalues << Get selected);
nw << Close Window;
Eval( fiteval );
Show( level );
)
)
);
);
Fiteval = Expr(
Show( nm );
Show( nY );
Show( level );
controllevel = (Char( nm ) || ":" || Char( level ));
Show( controllevel );
Fit Model(
Y( Eval( nY ) ),
Effects( Eval( nm ) ),
Personality( "Standard Least Squares" ),
Emphasis( "Minimal Report" ),
Run(
:Y << {Summary of Fit( 1 ), Analysis of Variance( 1 ), Parameter Estimates( 1 ),
Lack of Fit( 0 ), Expanded Estimates( 1 ), Show Prediction Expression( 1 ),
Sorted Estimates( 1 ), Scaled Estimates( 0 ), Plot Actual by Predicted( 0 ),
Plot Regression( 0 ), Plot Residual by Predicted( 0 ),
Plot Studentized Residuals( 0 ), Plot Effect Leverage( 0 ),
Plot Residual by Normal Quantiles( 0 ), Box Cox Y Transformation( 0 ), Show VIF( 1 ),
Multiple Comparisons(
Effect( Eval( nm ) ),
Comparisons with Control(
1,
Control Level( Eval( Parse( controllevel ) ) ),
Comparisons with Control Decision Chart(
Control Differences Chart( 1, Point Options( "Show Needles" ) )
)
)
)},
)
);
);
dt = Current Data Table();
nc = N Col( dt );
nr = N Row( dt );
Eval( Dia_Window );腳本編寫回复:Dunnett 的多個 Y我首先嘗試以交互方式完成您的目標,然後我保存了腳本。 似乎您可以做到,但是您需要將選項列表發送到每個響應。 您可以插入表達式以容納多個響應。
Names Default to Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
fit = dt << Fit Model(
Y( :height, :weight ),
Effects( :age ),
Personality( "Standard Least Squares" ),
Emphasis( "Effect Leverage" ),
Run(
:height << {Summary of Fit( 1 ), Analysis of Variance( 1 ),
Parameter Estimates( 1 ), Lack of Fit( 0 ), Scaled Estimates( 0 ),
Plot Actual by Predicted( 1 ), Plot Regression( 0 ),
Plot Residual by Predicted( 1 ), Plot Studentized Residuals( 0 ),
Plot Effect Leverage( 1 ), Plot Residual by Normal Quantiles( 0 ),
Box Cox Y Transformation( 0 ),
Multiple Comparisons( Effect( :age ), Tukey HSD( 1 ) )},
:weight << {Summary of Fit( 1 ), Analysis of Variance( 1 ),
Parameter Estimates( 1 ), Lack of Fit( 0 ), Scaled Estimates( 0 ),
Plot Actual by Predicted( 1 ), Plot Regression( 0 ),
Plot Residual by Predicted( 1 ), Plot Studentized Residuals( 0 ),
Plot Effect Leverage( 1 ), Plot Residual by Normal Quantiles( 0 ),
Box Cox Y Transformation( 0 ),
Multiple Comparisons(
Effect( :age ),
Comparisons with Control(
1,
Control Level( "age:12" ),
Comparisons with Control Decision Chart(
Control Differences Chart( 1, Point Options( "Show Needles" ) )
)
)
)}
)
);回复:Dunnett 的多個 Y我無法讓 Dunnett's 接受 Effect 或 Control Level 的變量。 你如何讓它接受一個變量?
我需要一些他們選擇變量和級別的東西,然後對每個響應重複它。 您如何在回復中使用它是實際的列名稱和實際級別。
回复:Dunnett 的多個 Y我進一步修改了我的示例,以向您展示如何使用表達式為任意數量的響應構建自適應腳本。
For( c = 1, c <= N Items( y ), c++,
Insert Into( run expr,
Substitute(
Expr(
yyy << {Summary of Fit( 1 ), Analysis of Variance( 1 ),
Parameter Estimates( 1 ), Lack of Fit( 0 ), Scaled Estimates( 0 ),
Plot Actual by Predicted( 1 ), Plot Regression( 0 ),
Plot Residual by Predicted( 1 ), Plot Studentized Residuals( 0 ),
Plot Effect Leverage( 1 ), Plot Residual by Normal Quantiles( 0 ),
Box Cox Y Transformation( 0 ),
Multiple Comparisons(
Effect( :age ),
Comparisons with Control(
1,
Control Level( "age:12" ),
Comparisons with Control Decision Chart(
Control Differences Chart( 1, Point Options( "Show Needles" ) )
)
)
)}
),
Expr( yyy ),
y[c];
)
)
);
Eval(
Substitute(
Expr(
fit = dt << Fit Model(
Y( Eval( y ) ),
Effects( Eval( x ) ),
Personality( "Standard Least Squares" ),
Emphasis( "Effect Leverage" ),
rrr
)
),
Expr( rrr ),
Name Expr( run expr )
)
);回复:Dunnett 的多個 Y但是在您的示例中,效果仍然是列的名稱,控件級別也是如此。 你能做這樣的事情:
效果(評估(x))
與對照的比較(
1、
控制級別(評估(級別)),
我不能讓它工作。 還是必須將其作為實際名稱?

回复:鄧尼特的多重 Y您的對話框中為列選擇捕獲了什麼? 它是列引用還是名稱(字符串)?
假設它是一個字符串,則此代碼可能有效。
Names Default to Here( 1 );
// example
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
// values from dialog
y = List( "height", "weight" );
x = "age";
level = 12;
// empty run argument for Fit Model message
run expr = Expr( Run() );
// iteratively add the optons for each response
For( c = 1, c <= N Items( y ), c++,
Insert Into( run expr,
Substitute(
Expr(
yyy << {Summary of Fit( 1 ), Analysis of Variance( 1 ),
Parameter Estimates( 1 ), Lack of Fit( 0 ), Scaled Estimates( 0 ),
Plot Actual by Predicted( 1 ), Plot Regression( 0 ),
Plot Residual by Predicted( 1 ), Plot Studentized Residuals( 0 ),
Plot Effect Leverage( 1 ), Plot Residual by Normal Quantiles( 0 ),
Box Cox Y Transformation( 0 ),
Multiple Comparisons(
Effect( xxx ),
Comparisons with Control(
1,
Control Level( ccc ),
Comparisons with Control Decision Chart(
Control Differences Chart( 1, Point Options( "Show Needles" ) )
)
)
)}
),
Expr( yyy ),
Parse( ":" || y[c] ),
Expr( xxx ),
Parse( ":" || x ),
Expr( ccc ),
x || ":" || Char( level )
)
)
);
// complete message and evaluate it
Eval(
Substitute(
Expr(
fit = dt << Fit Model(
Y( Eval( y ) ),
Effects( Eval( x ) ),
Personality( "Standard Least Squares" ),
Emphasis( "Minimal Report" ),
rrr
)
),
Expr( rrr ),
Name Expr( run expr )
)
);