MaxDiff
Example 1
Summary: Performs a MaxDiff analysis on the 'data_table.jmp' data table, specifying response subject ID, profile ID, and profile effects for candy, with Firth bias-adjusted estimates.
Code:
// MaxDiff
// Open data table
dt = Open("data_table.jmp");
// MaxDiff
MaxDiff(
One Table( 1 ),
Response Subject ID( :Subject ),
Profile ID( :Choice ),
Profile Grouping(
:Subject, :Choice Set
),
Profile Effects( :Candy ),
"Firth Bias-adjusted Estimates"n( 1 )
);
Code Explanation:
- Open data table.
- Call MaxDiff function.
- Specify one table.
- Define response subject ID.
- Define profile ID.
- Group profiles by subject and choice set.
- Specify profile effects for candy.
- Enable Firth bias adjustment.
Example 2
Summary: Performs a MaxDiff analysis on the 'data_table.jmp' file, specifying subject ID as 'Respondent', choice set ID, profile ID, and profile grouping. The script also enables Firth bias adjustment and specifies response values.
Code:
// One Table MaxDiff
// Open data table
dt = Open("data_table.jmp");
// One Table MaxDiff
MaxDiff(
One Table( 1 ),
Subject ID( :Respondent ),
Choice Set ID( :Choice Set ID ),
Profile ID( :Response ),
Profile Grouping( :Survey ID ),
Profile Effects( :Profile ID ),
"Firth Bias-Adjusted Estimates"n( 1 ),
Response Value Indicates Best( 1 ),
Response Value Indicates Worst( -1 )
);
Code Explanation:
- Open data table.
- Run MaxDiff analysis.
- Use one table.
- Set subject ID.
- Set choice set ID.
- Set profile ID.
- Set profile grouping.
- Include profile effects.
- Enable Firth bias adjustment.
- Specify response values.
Example 3
Summary: Performs a MaxDiff analysis on the 'data_table.jmp' data table, specifying response and profile data tables, subject data table, and effects for flavor and citizenship/gender.
Code:
// MaxDiff for Flavor
// Open data table
dt = Open("data_table.jmp");
// MaxDiff for Flavor
Open("data_table.jmp");
Open("data_table.jmp");
MaxDiff(
Response Data Table(
Data Table("data_table")
),
Profile DataTable(
Potato Chip Profiles
),
Subject DataTable(
Data Table("data_table")
),
Response Subject ID( :Respondent ),
Response Profile ID Choices(
:Choice 1, :Choice 2, :Choice 3
),
Profile ID( :Profile ID ),
Profile Effects( :Flavor ),
Subject Subject ID( :Respondent ),
Subject Effects(
:Citizenship, :Gender
),
"Firth Bias-adjusted Estimates"n( 1 ),
Response Best Option( :Best Profile ),
Response Worst Option(
:Worst Profile
)
);
Code Explanation:
- Open data table.
- Open data table.
- Open data table.
- Run MaxDiff analysis.
- Specify response data table.
- Specify profile data table.
- Specify subject data table.
- Set response subject ID.
- Define response profile choices.
- Set profile ID and effects.
Example 4
Summary: Performs a MaxDiff analysis with no subject effects on the 'data_table.jmp' data, specifying response and profile data tables, as well as response and profile IDs.
Code:
// MaxDiff with No Subject Effects
// Open data table
dt = Open("data_table.jmp");
// MaxDiff with No Subject Effects
Open("data_table.jmp");
Open("data_table.jmp");
MaxDiff(
Response Data Table(
Data Table("data_table")
),
Profile DataTable(
Potato Chip Profiles
),
Subject DataTable(
Data Table("data_table")
),
Response Subject ID( :Respondent ),
Response Profile ID Choices(
:Choice 1, :Choice 2, :Choice 3
),
Profile ID( :Profile ID ),
Profile Effects( :Flavor ),
Subject Subject ID( :Respondent ),
"Firth Bias-adjusted Estimates"n( 1 ),
Response Best Option( :Best Profile ),
Response Worst Option(
:Worst Profile
)
);
Code Explanation:
- Open data table.
- Open subjects table.
- Open profiles table.
- Run MaxDiff analysis.
- Specify response data table.
- Specify profile data table.
- Specify subject data table.
- Set response subject ID.
- Set response profile ID choices.
- Set profile ID.
Example 5
Summary: Performs a MaxDiff analysis on the 'data_table.jmp' data table, specifying response and profile IDs, subject effects, and custom axis settings for continuous distributions.
Code:
// Max Diff for Product Of
// Open data table
dt = Open("data_table.jmp");
// Max Diff for Product Of
Open("data_table.jmp");
Open("data_table.jmp");
MaxDiff(
Response Data Table(
Data Table("data_table")
),
Profile DataTable(
Potato Chip Profiles
),
Subject DataTable(
Data Table("data_table")
),
Response Subject ID( :Respondent ),
Response Profile ID Choices(
:Choice 1, :Choice 2, :Choice 3
),
Profile ID( :Profile ID ),
Profile Effects( :Product Of ),
Subject Subject ID( :Respondent ),
Subject Effects(
:Citizenship, :Gender
),
"Firth Bias-adjusted Estimates"n( 1 ),
Response Best Option( :Best Profile ),
Response Worst Option(
:Worst Profile
)
);
Code Explanation:
- Open data table.
- Open data table.
- Open data table.
- Run MaxDiff analysis.
- Set response data table.
- Set profile data table.
- Set subject data table.
- Define response subject ID.
- Define response profile choices.
- Define profile ID and effects.
Example 6
Summary: Performs a MaxDiff analysis with Hierarchical Bayes on the specified data table, utilizing response subject ID, profile ID choices, and subject effects.
Code:
// MaxDiff with Hierarchical Bayes
// Open data table
dt = Open("data_table.jmp");
// MaxDiff with Hierarchical Bayes
Open("data_table.jmp");
Open("data_table.jmp");
Open("data_table.jmp");
MaxDiff(
Response Data Table(
Data Table("data_table")
),
Profile DataTable(
Data Table("data_table")
),
Subject DataTable(
Data Table("data_table")
),
Response Subject ID( :Respondent ),
Response Profile ID Choices(
:Choice 1, :Choice 2, :Choice 3
),
Profile ID( :Profile ID ),
Profile Effects( :Product Of ),
Subject Subject ID( :Respondent ),
Subject Effects(
:Citizenship, :Gender
),
Hierarchical Bayes( 1 ),
Hierarchical Bayes( 1 ),
"Firth Bias-Adjusted Estimates"n( 1 ),
Response Best Option( :Best Profile ),
Response Worst Option(
:Worst Profile
)
);
Code Explanation:
- Open data table.
- Open data table.
- Open data table.
- Open data table.
- Run MaxDiff analysis.
- Specify response data table.
- Specify profile data table.
- Specify subject data table.
- Set response subject ID.
- Set response profile choices.
Example 7
Summary: Performs the MaxDiff analysis on three data tables, specifying response and profile IDs, and saving utility formulas.
Code:
dt1 = Open("data_table1.jmp");
dt2 = Open("data_table2.jmp");
dt3 = Open("data_table3.jmp");
obj1 = MaxDiff(
Response Data Table( Data Table("data_table1") ),
Profile DataTable( dt2 ),
Subject DataTable( Data Table("data_table3") ),
Response Subject ID( :Respondent ),
Response Profile ID Choices( :Choice 1, :Choice 2, :Choice 3 ),
Profile ID( :Profile ID ),
Profile Effects( :Flavor ),
Subject Subject ID( :Respondent ),
Subject Effects( :Citizenship ),
Name( "Firth Bias-Adjusted Estimates" )(1),
Response Best Option( :Best Profile ),
Response Worst Option( :Worst Profile )
);
obj1 << Save Utility Formula;
newdt = Current Data Table();
actRows = N Rows( newdt );
Code Explanation:
- Open table "data_table1".
- Open table "data_table2".
- Open table "data_table3".
- Run MaxDiff analysis.
- Specify response data table.
- Specify profile data table.
- Specify subject data table.
- Set response subject ID.
- Set response profile ID choices.
- Set profile ID.
Example 8
Summary: Estimates Firth bias-adjusted estimates using MaxDiff platform for a specified data table, with hierarchical Bayes and response value indication for best and worst options.
Code:
dt = Open("data_table.jmp");
obj = dt << MaxDiff(
One Table( 1 ),
Subject ID( :Respondent ),
Choice Set ID( :Choice Set ID ),
Profile ID( :Response ),
Profile Effects( :Profile ID ),
Name( "Firth Bias-Adjusted Estimates" )(0),
Hierarchical Bayes( 1 ),
Response Value Indicates Best( 1 ),
Response Value Indicates Worst( -1 )
);
Code Explanation:
- Open data table.
- Launch MaxDiff platform.
- Specify one table.
- Set subject ID column.
- Define choice set ID column.
- Identify profile ID column.
- Include profile effects.
- Disable Firth bias adjustment.
- Enable hierarchical Bayes.
- Set response value for best option.
- Set response value for worst option.
Example 9
Summary: Performs the MaxDiff analysis on three data tables, extracting Bayesian parameter estimates and verifying confidence limits.
Code:
dt1 = Open("data_table1.jmp");
dt2 = Open("data_table2.jmp");
dt3 = Open("data_table3.jmp");
obj = MaxDiff(
Response Data Table( Data Table("data_table1") ),
Profile DataTable( data_table2 ),
Subject DataTable( Data Table("data_table3") ),
Response Subject ID( :Respondent ),
Response Profile ID Choices( :Choice 1, :Choice 2, :Choice 3 ),
Profile ID( :Profile ID ),
Profile Effects( :Flavor ),
Subject Subject ID( :Respondent ),
Subject Effects( :Gender ),
Name( "Firth Bias-Adjusted Estimates" )(0),
Hierarchical Bayes( 1 ),
Number of Bayesian Iterations( 1000 ),
Response Best Option( :Best Profile ),
Response Worst Option( :Worst Profile )
);
rpt = obj << Report;
text = rpt[Outline Box( "Bayesian Parameter Estimates" )] << Get Text();
shouldBeEmpty = Regex Match( text, "95%" );
obj << Confidence Limits( 1 );
text2 = rpt[Outline Box( "Bayesian Parameter Estimates" )] << Get Text();
shouldBe95 = Regex Match( text2, "95%" );
obj << Confidence Limits( 0 );
text3 = rpt[Outline Box( "Bayesian Parameter Estimates" )] << Get Text();
shouldBeEmpty2 = Regex Match( text3, "95%" );
Code Explanation:
- Open data table;
- Open data table;
- Open data table;
- Run MaxDiff analysis.
- Extract Bayesian Parameter Estimates text.
- Check for "95%" presence.
- Enable confidence limits.
- Extract updated text.
- Verify "95%" presence.
- Disable confidence limits.
Example 10
Summary: Runs the Firth bias-adjusted estimation of parameters in a MaxDiff analysis, utilizing hierarchical Bayes and confidence intervals.
Code:
dt = Open("data_table.jmp");
obj = dt << MaxDiff(
One Table( 1 ),
Subject ID( :Respondent ),
Choice Set ID( :Choice Set ID ),
Profile ID( :Response ),
Profile Effects( :Profile ID ),
Name( "Firth Bias-Adjusted Estimates" )(0),
Hierarchical Bayes( 1 ),
Number of Bayesian Iterations( 1000 ),
Response Value Indicates Best( 1 ),
Response Value Indicates Worst( -1 ),
Confidence Intervals( 1 )
);
rpt = obj << Report;
actBayParEst = rpt[Outline Box( "Bayesian Parameter Estimates" )][Table Box( 1 )] << Get As Matrix;
actSummary = rpt[Outline Box( "Bayesian Parameter Estimates" )][Number Col Box( 6 )] << Get As Matrix;
Code Explanation:
- Open table.
- Run MaxDiff analysis.
- Specify hierarchical Bayes.
- Set iterations to 1000.
- Define response values.
- Enable confidence intervals.
- Retrieve report.
- Extract Bayesian parameter estimates.
- Extract summary statistics.
Example 11
Summary: Runs a MaxDiff analysis to estimate Firth bias-adjusted estimates for potato chip preferences, utilizing hierarchical Bayes and confidence intervals.
Code:
Open("data_table1.jmp");
dt2 = Open("data_table2.jmp");
dt3 = Open("data_table3.jmp");
NIter = 1000;
obj = MaxDiff(
Response Data Table( Data Table("data_table1") ),
Profile DataTable( data_table2 ),
Subject DataTable( Data Table("data_table3") ),
Response Subject ID( :Respondent ),
Response Profile ID Choices( :Choice 1, :Choice 2, :Choice 3 ),
Profile ID( :Profile ID ),
Profile Effects( :Flavor ),
Subject Subject ID( :Respondent ),
Subject Effects( :Gender ),
Name( "Firth Bias-Adjusted Estimates" )(0),
Hierarchical Bayes( 1 ),
Number of Bayesian Iterations( 1000 ),
Response Best Option( :Best Profile ),
Response Worst Option( :Worst Profile ),
Confidence Intervals( 1 )
);
Code Explanation:
- Open potato chip profiles.
- Open potato chip responses.
- Open potato chip subjects.
- Set iterations to 1000.
- Define MaxDiff analysis.
- Specify response data table.
- Specify profile data table.
- Specify subject data table.
- Define response subject ID.
- Define response profile choices.
- Define profile ID.
- Define profile effects.
- Define subject subject ID.
- Define subject effects.
- Disable Firth bias adjustment.
- Enable hierarchical Bayes.
- Set Bayesian iterations.
- Define best profile option.
- Define worst profile option.
- Enable confidence intervals.
Example 12
Summary: Estimates Firth bias-adjusted parameters for a MaxDiff analysis, utilizing Hierarchical Bayes and generating reports with Bayesian parameter estimates and summary statistics.
Code:
dt1 = Open("data_table1.jmp");
dt2 = Open("data_table2.jmp");
dt3 = Open("data_table3.jmp");
NIter = 1000;
obj = MaxDiff(
Response Data Table( Data Table("data_table1") ),
Profile DataTable( data_table2 ),
Subject DataTable( Data Table("data_table3") ),
Response Subject ID( :Respondent ),
Response Profile ID Choices( :Choice 1, :Choice 2, :Choice 3 ),
Profile ID( :Profile ID ),
Profile Effects( :Flavor ),
Subject Subject ID( :Respondent ),
Subject Effects( :Gender ),
Name( "Firth Bias-Adjusted Estimates" )(0),
Hierarchical Bayes( 1 ),
Number of Bayesian Iterations( 1000 ),
Response Best Option( :Best Profile ),
Response Worst Option( :Worst Profile ),
Confidence Limits( 1 )
);
rpt = obj << Report;
actBayParEst = rpt[Outline Box( "Bayesian Parameter Estimates" )][Table Box( 1 )] << Get As Matrix;
actSummary = rpt[Outline Box( "Bayesian Parameter Estimates" )][Number Col Box( 6 )] << Get As Matrix;
Code Explanation:
- Open data table;
- Open data table;
- Open data table;
- Set NIter to 1000.
- Create MaxDiff object.
- Set response data table.
- Set profile data table.
- Set subject data table.
- Define response subject ID.
- Define response profile ID choices.
- Define profile ID.
- Define profile effects.
- Define subject subject ID.
- Define subject effects.
- Disable Firth Bias-Adjusted Estimates.
- Enable Hierarchical Bayes.
- Set number of Bayesian iterations.
- Define response best option.
- Define response worst option.
- Enable confidence limits.
- Generate report.
- Extract Bayesian parameter estimates.
- Extract Bayesian summary statistics.
MaxDiff using New Column
Example 1
Summary: Fits a standard least squares model with multiple effects and generates profiler plots for data analysis.
Code:
dt = Open("data_table.jmp");
dt << New Column( "GroupNames",
Numeric,
Continuous,
Formula(
If( Left( :Respondent, 1 ) == "A" | Left( :Respondent, 1 ) == "B" | Left( :Respondent, 1 ) == "C" | Left( :Respondent, 1 ) == "E",
0,
1
)
)
);
obj = dt << MaxDiff(
One Table( 1 ),
Subject ID( :Respondent ),
Choice Set ID( :Choice Set ID ),
Profile ID( :Response ),
Profile Effects( :Profile ID ),
Response Value Indicates Best( 1 ),
Response Value Indicates Worst( -1 ),
By( :GroupNames )
);
rpt1 = obj[1] << Report();
rpt2 = obj[2] << Report();
dt << Select Where( :GroupNames == 0 );
dt << Delete Rows();
objOne = dt << MaxDiff(
One Table( 1 ),
Subject ID( :Respondent ),
Choice Set ID( :Choice Set ID ),
Profile ID( :Response ),
Profile Effects( :Profile ID ),
Response Value Indicates Best( 1 ),
Response Value Indicates Worst( -1 )
);
rptOne = objOne << Report();
Code Explanation:
- Open data table.
- Create new column "GroupNames".
- Define formula for "GroupNames".
- Run MaxDiff analysis.
- Extract first report.
- Extract second report.
- Select rows where "GroupNames" equals 0.
- Delete selected rows.
- Run MaxDiff analysis again.
- Extract report from new analysis.
Example 2
Summary: Fits a standard least squares model with multiple effects and generating a profiler plot, utilizing data table operations and MaxDiff analysis.
Code:
dt = Open("data_table.jmp");
dt << New Column( "GroupNames",
Numeric,
Continuous,
Formula(
If( Left( :Respondent, 1 ) == "A" | Left( :Respondent, 1 ) == "B" | Left( :Respondent, 1 ) == "C" | Left( :Respondent, 1 ) == "E",
0,
1
)
)
);
dt << Select Where( :GroupNames == 1 );
dt << Delete Rows();
objZero = dt << MaxDiff(
One Table( 1 ),
Subject ID( :Respondent ),
Choice Set ID( :Choice Set ID ),
Profile ID( :Response ),
Profile Effects( :Profile ID ),
Response Value Indicates Best( 1 ),
Response Value Indicates Worst( -1 )
);
rptZero = objZero << Report();
Code Explanation:
- Open data table.
- Create new column "GroupNames".
- Define formula for "GroupNames".
- Select rows where "GroupNames" equals 1.
- Delete selected rows.
- Run MaxDiff analysis.
- Set subject ID.
- Set choice set ID.
- Set profile ID.
- Generate report.
Example 3
Summary: Fits a standard least squares model with multiple effects and generating profiler plots for two groups, utilizing MaxDiff analysis and interactive filtering.
Code:
dt = Open("data_table.jmp");
dt << New Column( "GroupNames",
Numeric,
Continuous,
Formula(
If( Left( :Respondent, 1 ) == "A" | Left( :Respondent, 1 ) == "B" | Left( :Respondent, 1 ) == "C" | Left( :Respondent, 1 ) == "E",
0,
1
)
)
);
dt << Select Where( :GroupNames == 1 ) << Exclude( 1 );
objExZ = dt << MaxDiff(
One Table( 1 ),
Subject ID( :Respondent ),
Choice Set ID( :Choice Set ID ),
Profile ID( :Response ),
Profile Effects( :Profile ID ),
Response Value Indicates Best( 1 ),
Response Value Indicates Worst( -1 )
);
dt << Exclude( 0 );
dt << Invert Row Selection() << Exclude( 1 );
objExZ << Close Window();
objExO = dt << MaxDiff(
One Table( 1 ),
Subject ID( :Respondent ),
Choice Set ID( :Choice Set ID ),
Profile ID( :Response ),
Profile Effects( :Profile ID ),
Response Value Indicates Best( 1 ),
Response Value Indicates Worst( -1 )
);
dt << Clear Row States();
objExO << Close Window();
dt:GroupNames << Modeling Type( "Nominal" );
objCat = dt << MaxDiff(
One Table( 1 ),
Subject ID( :Respondent ),
Choice Set ID( :Choice Set ID ),
Profile ID( :Response ),
Profile Effects( :Profile ID ),
Response Value Indicates Best( 1 ),
Response Value Indicates Worst( -1 ),
By( :GroupNames )
);
rpt1Cat = objCat[1] << Report();
rpt2Cat = objCat[2] << Report();
Code Explanation:
- Open data table.
- Create new column "GroupNames".
- Apply formula to "GroupNames".
- Select rows where "GroupNames" equals 1.
- Exclude selected rows.
- Run MaxDiff analysis for excluded group.
- Close MaxDiff window.
- Select remaining rows.
- Exclude remaining rows.
- Run MaxDiff analysis for included group.
- Clear row states.
- Close MaxDiff window.
- Set "GroupNames" modeling type to Nominal.
- Run MaxDiff analysis by groups.
- Extract first report from analysis.
- Extract second report from analysis.
Example 4
Summary: Fits a standard least squares model with multiple effects and generates a profiler plot using MaxDiff analysis in JMP.
Code:
dt1 = Open("data_table.jmp");
dt2 = Open("data_table.jmp");
dt3 = Open("data_table.jmp");
dt3 << New Column( "GroupNames",
Numeric,
Nominal,
Formula(
If( Left( :Respondent, 1 ) == "A" | Left( :Respondent, 1 ) == "B" | Left( :Respondent, 1 ) == "C" | Left( :Respondent, 1 ) == "E",
0,
1
)
)
);
obj = MaxDiff(
Response DataTable( Data Table("data_table") ),
Profile DataTable( Data Table("data_table") ),
Subject DataTable( Data Table("data_table") ),
Response Subject ID( :Respondent ),
Response Profile ID Choices( :Choice 1, :Choice 2, :Choice 3 ),
Profile ID( :Profile ID ),
Profile Effects( :Flavor ),
Subject Subject ID( :Respondent ),
Name( "Firth Bias-adjusted Estimates" )(1),
Response Best Option( :Best Profile ),
Response Worst Option( :Worst Profile ),
By( :GroupNames )
);
rpt1 = obj[1] << Report();
rpt2 = obj[2] << Report();
dt1 << New Column( "GroupNames2",
Numeric,
Continuous,
Formula(
If( Left( :Respondent, 1 ) == "A" | Left( :Respondent, 1 ) == "B" | Left( :Respondent, 1 ) == "C" | Left( :Respondent, 1 ) == "E",
0,
1
)
)
);
obj = dt1 << MaxDiff(
Response DataTable( Data Table("data_table") ),
Profile DataTable( Data Table("data_table") ),
Response Subject ID( :Respondent ),
Response Profile ID Choices( :Choice 1, :Choice 2, :Choice 3 ),
Profile ID( :Profile ID ),
Profile Effects( :Flavor ),
Name( "Firth Bias-adjusted Estimates" )(1),
Response Best Option( :Best Profile ),
Response Worst Option( :Worst Profile ),
By( :GroupNames2 )
);
rpt1 = obj << Report();
Code Explanation:
- Open data table;
- Open data table;
- Open data table;
- Create new column "GroupNames".
- Define formula for "GroupNames".
- Run MaxDiff analysis.
- Extract report from analysis.
- Create new column "GroupNames2".
- Define formula for "GroupNames2".
- Run MaxDiff analysis again.
MaxDiff using Select Rows
Summary: Performs the MaxDiff analysis to estimate Firth bias-adjusted estimates, utilizing a Log Capture to record output and specifying various parameters such as subject ID, choice set ID, profile ID, and survey ID grouping.
Code:
dt = Open("data_table.jmp");
dt << Select Rows( 1 :: N Row( dt ) );
dt << Exclude( 1 );
myLog = Log Capture(
dt << MaxDiff(
One Table( 1 ),
Subject ID( :Respondent ),
Choice Set ID( :Choice Set ID ),
Profile ID( :Response ),
Profile Grouping( :Survey ID ),
Profile Effects( :Profile ID ),
Name( "Firth Bias-Adjusted Estimates" )(1),
Response Value Indicates Best( 1 ),
Response Value Indicates Worst( -1 )
)
);
Code Explanation:
- Open data table.
- Select all rows.
- Exclude first row.
- Capture log output.
- Run MaxDiff analysis.
- Use one table.
- Specify subject ID.
- Define choice set ID.
- Set profile ID.
- Group profiles by survey ID.
MaxDiff using Log Capture
Summary: Executes MaxDiff analysis on three data tables, capturing and extracting posterior mean estimates and parameter values.
Code:
dt1 = Open("data_table1.jmp");
dt2 = Open("data_table2.jmp");
dt3 = Open("data_table3.jmp");
myLog2 = Log Capture(
obj = dt3 << MaxDiff(
Response Data Table( Data Table("data_table1") ),
Profile DataTable( data_table2 ),
Subject DataTable( Data Table("data_table3") ),
Response Subject ID( :Respondent ),
Response Profile ID Choices( :Choice 1, :Choice 2, :Choice 3 ),
Profile ID( :Profile ID ),
Profile Effects( :Flavor ),
Subject Subject ID( :Respondent ),
Response Best Option( :Best Profile ),
Response Worst Option( :Worst Profile ),
Name( "Firth Bias-Adjusted Estimates" )(0),
Hierarchical Bayes( 1 ),
Number of Bayesian Iterations( 0 )
)
);
rpt = obj << Report;
actEst3 = rpt[Outline Box( "Bayesian Parameter Estimates" )][Number Col Box( "Posterior Mean" )] << Get As Matrix();
obj << Confidence Limits( 1 );
obj4 = dt3 << MaxDiff(
Response Data Table( Data Table("data_table") ),
Profile DataTable( data_table ),
Subject DataTable( Data Table("data_table") ),
Response Subject ID( :Respondent ),
Response Profile ID Choices( :Choice 1, :Choice 2, :Choice 3 ),
Profile ID( :Profile ID ),
Profile Effects( :Flavor ),
Subject Subject ID( :Respondent ),
Name( "Firth Bias-Adjusted Estimates" )(0),
Response Best Option( :Best Profile ),
Response Worst Option( :Worst Profile )
);
rpt4 = obj4 << Report;
actEst4 = rpt4[Outline Box( "Parameter Estimates" )][Number Col Box( "Estimate" )] << Get As Matrix();
Code Explanation:
- Open data table;
- Open data table;
- Open data table;
- Start logging.
- Run MaxDiff analysis on dt3.
- Capture report from MaxDiff analysis.
- Extract posterior mean estimates.
- Enable confidence limits.
- Run MaxDiff analysis again on dt3.
- Capture and extract parameter estimates.