Come passare le variabili al parametro X in Fit Life by X?Ciao a tutti,
I need to dynamically pass variables to the X parameter in the fit life by x function. The first part of my code generates the analysis report as expected, but the second part only brings up the startup window without a report.
Ecco come appare il mio codice:
Names Default To Here(1);
dt = Open( "$sample_data/big class.jmp" );
x_var = "sex";
y_var = "weight";
obj1 = dt << Fit Life by X(
Distribution( Weibull ),
Nested Model Tests( Location and Scale ),
Y( Eval(y_var) ),
X( :sex ),
);
wait(2);
obj2 = dt << Fit Life by X(
Distribution( Weibull ),
Nested Model Tests( Location and Scale ),
Y( :weight ),
X( Eval(x_var) ),
);
Qualcuno ha riscontrato questo problema o sa come passare correttamente le variabili al parametro X?
Grazie!
Automazione e scriptingAnalisi di affidabilitàRi: Come passare le variabili al parametro X in Fit Life by X?Si prega di vedere quanto segue.
Poiché manca "Relazione", i codici tentano di effettuare l'ipotesi migliore in base a X. Ma nel punto in cui i codici controllano X, X non è ancora una colonna valida, in questo caso. Quindi, fornendo informazioni complete, i codici non devono cadere nella trappola.
Names Default To Here(1);
dt = Open( "$sample_data/big class.jmp" );
x_var = "sex";
y_var = "weight";
obj1 = dt << Fit Life by X(
Distribution( Weibull ),
Relationship( Location and Scale ),
Nested Model Tests( Location and Scale ),
Y( Eval(y_var) ),
X( :sex ),
);
wait(2);
obj2 = dt << Fit Life by X(
Distribution( Weibull ),
Relationship( Location and Scale ),
Nested Model Tests( Location and Scale ),
Y( :weight ),
X( Eval(x_var) ),
);
Ri: Come passare le variabili al parametro X in Fit Life by X?Sembra che ciò richieda un po' più di lavoro per risolvere il problema poiché la forzatura "normale" non funzionerà
Names Default To Here(1);
dt = Open("$sample_data/big class.jmp");
x_var = "sex";
y_var = "weight";
myexpr = EvalExpr(dt << Fit Life by X(
Distribution( Weibull ),
Nested Model Tests( Location and Scale ),
Y( :weight ),
X(Expr(NameExpr(AsColumn(dt, x_var)))),
));
show(myexpr);
obj = Eval(myexpr);
Uno dei casi estremamente rari in cui direi di utilizzare Eval(Parse()) (analisi malvagia) ma sembra funzionare
Names Default To Here(1);
dt = Open("$sample_data/big class.jmp");
x_var = "sex";
y_var = "weight";
obj2 = Eval(Parse(Eval Insert("\[dt << Fit Life by X(
Distribution(Weibull),
Nested Model Tests(Location and Scale),
Y(:weight),
X(:^x_var^)
)]\")));Ri: Come passare le variabili al parametro X in Fit Life by X?Questa anomalia sembra essere un bug. L'argomento Nested Model Tests non è riconosciuto nel secondo caso. Segnalarlo al supporto tecnico JMP ( support@jmp.com ) in modo che possa essere inserito come difetto e monitorato.
Ri: Come passare le variabili al parametro X in Fit Life by X?Oh, questa è esattamente la risposta giusta. Grazie mille!
Ri: Come passare le variabili al parametro X in Fit Life by X?Anche questa è un'altra soluzione alternativa. Grazie!