Controllo dell'output del report ANOVA tramite l'invio con una variabile stringaCiao,
Sto cercando di fare riferimento a una variabile stringa ( colname ) in spedizione, ma non riesce a obbedire al OutlineBox, {Chiudi (0)} (o Chiudi (1) ) a differenza di quando la stringa viene scritta in modo esplicito.
Gradirei il tuo aiuto.
Revital
Ecco il codice:
For( i = 1, i <= N Items( ColumnNames ), i++,
colname = "Response " || char(colnameames[i]);
Cobj = dt << Fit Model(
Y( colnameames[i] ),
Effects( :Visit, :Group, :Group * :Visit ),
Random Effects( :SubjectNumber[:Group] ),
Personality( "Standard Least Squares" ),
Method( "REML" ),
Emphasis( "Minimal Report" ),
Run(
colnameames[i] << {Analysis of Variance( 0 ), Lack of Fit( 0 ),
Plot Actual by Predicted( 0 ), Plot Regression( 0 ),
Plot Residual by Predicted( 0 ), Plot Effect Leverage( 0 ), {:Visit <<
{LSMeans Plot( 1 ), LSMeans Contrast( [1 0 0 -1] )}, :Group << {LSMeans Plot( 1 ),
LSMeans Contrast( [1 0 0 -1] )}, :Group * :Visit << {LSMeans Plot( 1 )}}
),
SendToReport(
Dispatch(
{colname , "Effect Details", "Visit", "Contrast"},
"Test Detail",
OutlineBox,
{Close( 0 )}
),
Dispatch(
{colname , "Effect Details", "Group", "Contrast"},
"Test Detail",
OutlineBox,
{Close( 0 )}
),
Dispatch(
{colname , "Effect Details"},
"SubjectNumber[Group]",
OutlineBox,
{Close( 1 )}
)
)
);Ri: Controllo dell'output del report ANOVA tramite l'invio con una variabile stringaGrazie mille per l'aiuto. Ho usato la soluzione come nel tuo esempio e ha funzionato !!
Revtal
Ri: Controllo dell'output del report ANOVA tramite l'invio con una variabile stringaÈ necessario creare la stringa contenente il nome della casella di struttura prima di valutare il resto dell'espressione. Puoi farlo in modi diversi usando le stringhe, controlla Parse (Substitute ()) e Eval Insert () come in alcuni casi potrebbero essere scelte migliori. Un modo, però, è utilizzare Eval Expr () come mostrato di seguito:
Prova a sostituire Eval (con Scrivi (Char (e guarda nel log per vedere quale codice viene effettivamente valutato. È possibile copiare e incollare dal registro in una finestra di script e quindi utilizzare il pulsante 'script di riformattare'.
Names default to here( 1 );
dt = Open( "$Sample_data/Iris.jmp" );
targets = {"Sepal length", "Petal length"};
For( i = 1, i <= N Items( targets ), i++,
//Here is a Fit Model expression with some parts contained in Expr()
//First the Fit model 'code' goes to Eval Expr() to evalute only those parts
//contained in Expr(). Then it goes to Eval() to actually run the code.
Eval( Eval Expr(
Fit Model(
Y( targets[i] ),
Effects( :Sepal width, :Petal width ),
Random Effects( :Species ),
NoBounds( 1 ),
Personality( "Standard Least Squares" ),
Method( "REML" ),
Emphasis( "Minimal Report" ),
Run(
:Sepal length << {Summary of Fit( 1 ), Analysis of Variance( 0 ),
Parameter Estimates( 1 ), Lack of Fit( 0 ), Plot Actual by Predicted( 0 ),
Plot Regression( 0 ), Plot Residual by Predicted( 0 ),
Plot Studentized Residuals( 0 ), Plot Effect Leverage( 0 )}
),
SendToReport(
Dispatch(
{ Expr( "Response" || targets[i] ) }, //This is evaluated first
"Parameter Estimates",
OutlineBox,
{Close( 1 )}
),
Dispatch(
{ Expr( "Response" || targets[i] ) }, //This is evaluated first
"REML Variance Component Estimates",
OutlineBox,
{Close( 1 )}
),
Dispatch(
{ Expr( "Response" || targets[i] ) }, //This is evaluated first
"Fixed Effect Tests",
OutlineBox,
{Close( 1 )}
)
)
)
) );
);