How do I perform a 2-sample Hotelling's T-square test in JMP?I'm trying to compare multiple different product specs or variables (k = 8) between 2 different groups. I can't find a way to compare those multiple factors between the 2 groups easily in JMP right now using the 2-sample Hotelling's T-square test. I'd also like to know if JMP can then create the CIs if we reject the Hotelling's T2 test statistic and also review the profile plots?
Basic Data Analysis and ModelingRe: How do I perform a 2-sample Hotelling's T-square test in JMP?I found some SAS code on the internet that performed the 2 Sample Hotelling T2 calculation. I converted the code to JSL. I tested it against some sample data and it checked out ok. It is a bit clunking but it works. Take a look at the annotation in the JSL to see what needs to be set to work with your data.

Names Default To Here( 1 );
// Open the data table
dt = open("$SAMPLE_DATA/Prostate Cancer.jmp");
groupVar = "Status"; // Enter the grouping column name
groupList = {"CCD", "Nor"}; // Set the values for the 2 groups
startColumn = 660; // Set the starting column number for the data to be included
// Create the group 1 and group 2 matrices for analysis
gp1Rows = dt << get rows where( as column( groupVar) == groupList[1] );
group1 = dt[gp1Rows, startColumn :: N Cols( dt )];
gp1Rows = dt << get rows where( as column( groupVar ) == groupList[2] );
group2 = dt[gp1Rows, startColumn :: N Cols( dt )];
// Get the dimensions of the matricies
nRows1 = N Row( group1 );
nRows2 = N Row( group2 );
numCols = N Col( group1 );
// Create a filled vector for the analysis
j1 = J( nRows1, 1, 1 );
j2 = J( nRows2, 1, 1 );
// Create an identity matrix for each group
identity1 = Identity( nRows1 );
identity2 = Identity( nRows2 );
// Calculate the means for each of the columns by each group
MeanY1 = group1` * j1 / nRows1;
MeanY2 = group2` * j2 / nRows2;
// Create an output window to display the results in
nw = New Window("Hotelling T2", outlinebox("Hotelling 2 Sample T2 Analysis",spacerbox(size(1,15)),lub = vlistbox()));
// Add the means table to the output
obMean = Outline Box("Group Means",
mTB = Table Box(
string Col box("Groups", groupList),
number col box("# Rows", matrix(nRows1)||matrix(nRows2))
)
);
for(i=startColumn, i<=NCols(dt),i++,
mTB << append(number col box(column(dt,i)<<GET name=""></GET>
Re: How do I perform a 2-sample Hotelling's T-square test in JMP?Thank you for the response. I didn't think to try finding a solution using SAS. Now that I think about it I may have SAS code for doing a multivariate comparison between 2 groups that may also work. That said, I was hoping someone knew if: analyze > fit model menu > Manova , could work multivariate comparison of just 2 groups instead of multiple ones?
Re: How do I perform a 2-sample Hotelling's T-square test in JMP?From JMP Help:

Re: How do I perform a 2-sample Hotelling's T-square test in JMP?Thanks Mark. I saw that 1-sample T2 test option under the multivariate menu, but couldn't find anything for a 2-sample test - which is what I'm looking for to compare product specs between 2 groups. I think I may playing around w/ the MANOVA option but use 2 groups instead of the 3+ groups it usually calls for & see if I can get the correct outputs.
Re: How do I perform a 2-sample Hotelling's T-square test in JMP?For those that are interested - I THINK (someone may need to verify) you can use the MANOVA option to perform a 2-sample Hotelling's T2 analysis as follows:
- Analyze > Fit Model > select all of your response variables you are trying compare between your 2 groups & move them to "Y", select the column containing your labels for your 2 groups select "Add" under 'Construct Model Effects' > select "Manova" from the 'Personality' dropdown menu > Run > under 'Choose Response' menu, select "Identity" > Run.
- This should output your F-value and probability for your test.
- I'm not sure how to do the simultaneous or Bonferroni adjusted intervals from here.
Re: How do I perform a 2-sample Hotelling's T-square test in JMP?Dear Jim
Could I persuade you to post the SAS code as well? That would be most helpful.
Thanks
Re: How do I perform a 2-sample Hotelling's T-square test in JMP?Here is a link to a SAS example. I believe this is the example I used, but I am not sure.
7.1.15 - The Two-Sample Hotelling's T-Square Test Statistic | STAT 505 (psu.edu)