Il suggerimento di Jim di utilizzare un metodo di partizionamento ricorsivo è ottimo. Il fatto è che esiste più di un modo in cui è possibile modellare questa risposta ordinale in diverse condizioni di S, U e D. Ecco un risultato utilizzando la regressione logistica ordinale:
dt = New Table( "4x4x3 Factorial",
Add Rows( 48 ),
New Table Variable( "Design", "4x4x3 Factorial" ),
New Script(
"Model",
Fit Model(
Effects( :S, :U, :D, :S * :U, :S * :D, :U * :D</img> ),
Y( :Y ),
PERSONALITY( Standard Least Squares )
)
),
New Script( "Evaluate Design", DOE( Evaluate Design, X( :S, :U, :D</img> ) ) ),
New Script(
"DOE Dialog",
DOE(
Full Factorial Design,
{Add Response( Maximize, "Y", ., ., . ),
Add Factor( Categorical, {"1", "2", "3", "4"}, "S", 0 ),
Add Factor( Categorical, {"1", "2", "3", "4"}, "U", 0 ),
Add Factor( Categorical, {"1", "2", "3"}, "D", 0 ),
Set Random Seed( 873 ), Make Design, Simulate Responses( 0 ),
Set Run Order( Sort Left to Right ), Make Table}
)
),
New Script(
"Graph Builder",
Graph Builder(
Size( 566, 1456 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables( Y( :Y ), Page( :D</img> ), Group X( :U ), Group Y( :S ) ),
Elements( Points( Y, Legend( 7 ) ) ),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
7,
Properties( -1, {Line Color( 4 )}, Item ID( "1", 1 ) ),
Properties( -1, {Line Color( 41 )}, Item ID( "2", 1 ) ),
Properties( -1, {Line Color( 3 )}, Item ID( "3", 1 ) )
)}
)
)
)
),
New Column( "Pattern",
Character,
"Nominal",
Set Values(
{"111", "112", "113", "121", "122", "123", "131", "132", "133", "141",
"142", "143", "211", "212", "213", "221", "222", "223", "231", "232",
"233", "241", "242", "243", "311", "312", "313", "321", "322", "323",
"331", "332", "333", "341", "342", "343", "411", "412", "413", "421",
"422", "423", "431", "432", "433", "441", "442", "443"}
)
),
New Column( "S",
Character,
"Nominal",
Set Property( "Value Ordering", {"1", "2", "3", "4"} ),
Set Property( "Design Role", DesignRole( Categorical ) ),
Set Property( "Factor Changes", Easy ),
Set Values(
{"1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "2", "2",
"2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "3", "3", "3", "3",
"3", "3", "3", "3", "3", "3", "3", "3", "4", "4", "4", "4", "4", "4",
"4", "4", "4", "4", "4", "4"}
)
),
New Column( "U",
Character,
"Nominal",
Set Property( "Value Ordering", {"1", "2", "3", "4"} ),
Set Property( "Design Role", DesignRole( Categorical ) ),
Set Property( "Factor Changes", Easy ),
Set Values(
{"1", "1", "1", "2", "2", "2", "3", "3", "3", "4", "4", "4", "1", "1",
"1", "2", "2", "2", "3", "3", "3", "4", "4", "4", "1", "1", "1", "2",
"2", "2", "3", "3", "3", "4", "4", "4", "1", "1", "1", "2", "2", "2",
"3", "3", "3", "4", "4", "4"}
)
),
New Column( "D",
Character,
"Nominal",
Set Property( "Value Ordering", {"1", "2", "3"} ),
Set Property( "Design Role", DesignRole( Categorical ) ),
Set Property( "Factor Changes", Easy ),
Set Values(
{"1", "2", "3", "1", "2", "3", "1", "2", "3", "1", "2", "3", "1", "2",
"3", "1", "2", "3", "1", "2", "3", "1", "2", "3", "1", "2", "3", "1",
"2", "3", "1", "2", "3", "1", "2", "3", "1", "2", "3", "1", "2", "3",
"1", "2", "3", "1", "2", "3"}
)
),
New Column( "Y",
Numeric,
"Ordinal",
Format( "Best", 12 ),
Value Labels( {1 = "Low", 2 = "Med", 3 = "High"} ),
Use Value Labels( 1 ),
Set Values(
[1, 1, 2, 1, 1, 2, 1, 2, 3, 2, 3, 3, 1, 1, 2, 1, 1, 2, 1, 2, 3, 2, 3, 3,
1, 1, 2, 1, 2, 3, 2, 3, 3, 2, 3, 3, 1, 2, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3]
)
),
Set Label Columns( :Pattern )
);
dt << Fit Model(
Y( :Y ),
Effects( :S, :U, :D</img> ),
Personality( "Ordinal Logistic" ),
Run(
Likelihood Ratio Tests( 1 ),
Profiler(
1,
Term Value(
S( "1", Lock( 0 ), Show( 1 ) ),
U( "1", Lock( 0 ), Show( 1 ) ),
D( "1", Lock( 0 ), Show( 1 ) )
)
)
)
);Potresti provare a costruire il tuo modello utilizzando il partizionamento.Di seguito è riportato uno scirpt che crea la tabella e quindi esegue un'analisi della partizione (albero delle decisioni).
names default to here(1);
dt = New Table( "Example",
Add Rows( 48 ),
New Column( "d",
Numeric,
"Nominal",
Format( "Best", 12 ),
Set Values(
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]
)
),
New Column( "u",
Numeric,
"Nominal",
Format( "Best", 12 ),
Set Values(
[1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4,
1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4]
)
),
New Column( "s",
Numeric,
"Nominal",
Format( "Best", 12 ),
Set Values(
[1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 1, 1, 1, 1, 2, 2, 2, 2,
3, 3, 3, 3, 4, 4, 4, 4, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4]
)
),
New Column( "value",
Character,
"Nominal",
Set Values(
{"Low", "Low", "Low", "Med", "Low", "Low", "Low", "Med", "Low", "Low",
"Med", "Med", "Low", "Med", "Med", "Med", "Low", "Low", "Med", "High",
"Low", "Low", "Med", "High", "Low", "Med", "High", "High", "Med", "High",
"High", "High", "Med", "Med", "High", "High", "Med", "Med", "High",
"High", "Med", "High", "High", "High", "High", "High", "High", "High"}
)
)
);
dt << Partition(
Y( :value ),
X( :d, :u, :s ),
Informative Missing( 1 ),
Initial Splits(
:d == {1},
{:u == {4, 3}},
{:u == {1, 2}, {:d == {2}}, {:d == {2}}}
),
SendToReport(
Dispatch( {}, "Partition Report", FrameBox, {Frame Size( 480, 74 )} )
)
);