다중 Y에 대한 Dunnett의내 문제에 맞는 모델에서 자동으로 여러 Y에서 Dunnett를 실행하는 스크립트를 얻으려고 합니다.
요인과 수준이 변수가 아닌 다중 비교 부분을 변경하면 작동하지만 첫 번째 Y에 대해서만 나머지 Y에 대해 Dunnett 부분을 반복하지 않습니다. 그래서 내 질문 :
1. 왜 이것이 Dunnett's의 요인 및 통제 수준에 변수를 사용하는 적합 모형처럼 작동하지 않습니까?
2. 여러 Y에 대해 Dunnett를 자동으로 가져올 수 있습니까?
리사
이것은 내가 지금까지 가지고있는 것입니다.
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 );스크립팅Re: Dunnett's for Multiple Ys먼저 대화식으로 목표를 달성하려고 시도한 다음 스크립트를 저장했습니다. 할 수 있을 것 같지만 각 응답에 옵션 목록을 보내야 합니다. 여러 응답을 수용하기 위해 표현식을 삽입할 수 있습니다.
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" ) )
)
)
)}
)
);Re: Dunnett's for Multiple Ys나는 Dunnett's가 Effect나 Control Level에 대한 변수를 받아들이도록 할 수 없었습니다. 변수를 받아들이는 방법은 무엇입니까?
변수와 수준을 선택한 다음 각 응답에 대해 반복되는 무언가가 필요합니다. 회신에 있는 방법은 실제 열 이름과 실제 수준입니다.
Re: Dunnett's for Multiple Ys표현식을 사용하여 응답 수에 관계없이 적응형 스크립트를 작성하는 방법을 보여주기 위해 예제를 추가로 수정했습니다.
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's for Multiple Ys다음과 같이 문자열로 변환하려고 했습니다.
controllevel = (Char( nm ) || ":" || Char( level ));
그런데 JMP로 보여주면 \!" '\!: \!" 로 나옵니다. '\! " " 사이에 nm 및 level 값이 있습니다.
내가 도대체 뭘 잘못하고있는 겁니까?