Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

- JMP User Community
- :
- Discussions
- :
- How to get Kaiser's MSA (aka KMO) in JMP's Factor analysis?

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Feb 18, 2012 9:41 AM
(8786 views)

The Kaiser's MSA (also called KMO) is a metric that is frequently used along with anti-image correlation matrix to judge the suitability of a set of variables for factor analsysis. I can get these easily uisng SAS (proc factor). Anyone knwos how to get these in JMP (I am using JMP Pro version 9)? I see there was a post in early 2010 about KMO and the answer there was to literally calculate these by exporting the partial/inverse correlation matric to Excel. I am hoping by now, JMP or soem users have come up with a script or some options that do it automatically. Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Created:
Feb 20, 2012 10:40 AM
| Last Modified: Jun 8, 2020 4:31 AM
(10719 views)
| Posted in reply to message from goutam 02-18-2012

See if this code is helpful. I only was able to check it against the socioeconomic sample data and the results were same as the SAS results shown in the SAS docs online. Use at your own risk and certainly test on as many datasets as you have MSA results for.

```
/* Next line if want to open a specific JMP table */
//dt = Open( "$SAMPLE_DATA/Socioeconomic.jmp" );
/* Next line if want to have user pick a JMP data table */
//dt = Open();
/* No Open statement if want to run against the current data table */
cd = Column Dialog( Col ID = ColList( "Select Columns" ) );
names = cd["Col ID"];
nsel = N Items( names );
mv = Multivariate(
Y( Eval( names ) ),
Estimation Method( "Row-wise" ),
Scatterplot Matrix( Density Ellipses( 1 ), Shaded Ellipses( 0 ), Ellipse Color( 3 ) ),
Partial Correlations( 1 )
);
rmv = Report( mv );
dtcorr = rmv["Correlations"][Matrix Box( 1 )] << make into data table;
dtpart = rmv["Partial Corr"][Matrix Box( 1 )] << make into data table;
stkcorr = dtcorr << Stack(
columns( Eval( names ) ),
Source Label Column( "Label" ),
Stacked Data Column( "Data" )
);
stkpart = dtpart << Stack(
columns( Eval( names ) ),
Source Label Column( "Label" ),
Stacked Data Column( "Data" )
);
Close( dtcorr, nosave );
Close( dtpart, nosave );
stkcorr << New Column( "DataSqr", formula( Data ^ 2 ) );
stkpart << New Column( "DataSqr", formula( Data ^ 2 ) );
sumsqrcorr = Col Sum( (stkcorr:"DataSqr") ) - nsel;
sumsqrpart = Col Sum( (stkpart:"DataSqr") );
MSA = sumsqrcorr / (sumsqrcorr + sumsqrpart);
//Show( MSA );
Summarize( bycorr = by( stkcorr:"Row" ), sumsqrcorrby = Sum( stkcorr:"DataSqr" ) );
Summarize( bypart = by( stkpart:"Row" ), sumsqrpartby = Sum( stkpart:"DataSqr" ) );
Close( stkcorr, nosave );
Close( stkpart, nosave );
//show(sumsqrcorrby, sumsqrpartby);
//show(bycorr, bypart);
sumsqrcorrby = sumsqrcorrby - 1;
//show(sumsqrcorrby);
MSAvar = {};
For( i = 1, i <= nsel, i++,
MSAvar = sumsqrcorrby / (sumsqrcorrby + sumsqrpartby);
//Show( bycorr, MSAvar );
);
sr = New Window( "Summary Results",
V List Box(
Table Box( String Col Box( "Variable", bycorr ), Number Col Box( "MSA", MSAvar ) ),
Text Box( "Overall MSA = " || Char( round(MSA, 5) ) )
)
);
```

5 REPLIES 5

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Created:
Feb 20, 2012 10:40 AM
| Last Modified: Jun 8, 2020 4:31 AM
(10720 views)
| Posted in reply to message from goutam 02-18-2012

See if this code is helpful. I only was able to check it against the socioeconomic sample data and the results were same as the SAS results shown in the SAS docs online. Use at your own risk and certainly test on as many datasets as you have MSA results for.

```
/* Next line if want to open a specific JMP table */
//dt = Open( "$SAMPLE_DATA/Socioeconomic.jmp" );
/* Next line if want to have user pick a JMP data table */
//dt = Open();
/* No Open statement if want to run against the current data table */
cd = Column Dialog( Col ID = ColList( "Select Columns" ) );
names = cd["Col ID"];
nsel = N Items( names );
mv = Multivariate(
Y( Eval( names ) ),
Estimation Method( "Row-wise" ),
Scatterplot Matrix( Density Ellipses( 1 ), Shaded Ellipses( 0 ), Ellipse Color( 3 ) ),
Partial Correlations( 1 )
);
rmv = Report( mv );
dtcorr = rmv["Correlations"][Matrix Box( 1 )] << make into data table;
dtpart = rmv["Partial Corr"][Matrix Box( 1 )] << make into data table;
stkcorr = dtcorr << Stack(
columns( Eval( names ) ),
Source Label Column( "Label" ),
Stacked Data Column( "Data" )
);
stkpart = dtpart << Stack(
columns( Eval( names ) ),
Source Label Column( "Label" ),
Stacked Data Column( "Data" )
);
Close( dtcorr, nosave );
Close( dtpart, nosave );
stkcorr << New Column( "DataSqr", formula( Data ^ 2 ) );
stkpart << New Column( "DataSqr", formula( Data ^ 2 ) );
sumsqrcorr = Col Sum( (stkcorr:"DataSqr") ) - nsel;
sumsqrpart = Col Sum( (stkpart:"DataSqr") );
MSA = sumsqrcorr / (sumsqrcorr + sumsqrpart);
//Show( MSA );
Summarize( bycorr = by( stkcorr:"Row" ), sumsqrcorrby = Sum( stkcorr:"DataSqr" ) );
Summarize( bypart = by( stkpart:"Row" ), sumsqrpartby = Sum( stkpart:"DataSqr" ) );
Close( stkcorr, nosave );
Close( stkpart, nosave );
//show(sumsqrcorrby, sumsqrpartby);
//show(bycorr, bypart);
sumsqrcorrby = sumsqrcorrby - 1;
//show(sumsqrcorrby);
MSAvar = {};
For( i = 1, i <= nsel, i++,
MSAvar = sumsqrcorrby / (sumsqrcorrby + sumsqrpartby);
//Show( bycorr, MSAvar );
);
sr = New Window( "Summary Results",
V List Box(
Table Box( String Col Box( "Variable", bycorr ), Number Col Box( "MSA", MSAvar ) ),
Text Box( "Overall MSA = " || Char( round(MSA, 5) ) )
)
);
```

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: How to get Kaiser's MSA (aka KMO) in JMP's Factor analysis?

The code worked like a charm!!! I ahev checked it on several data sets and results are identicla with what I get from running SAS. Thanks very much.

JMP folks (if you are listening in) - please incorporate this code/jsl in the next version of JMP as a red triangle option form multivariate correlation platform.

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: How to get Kaiser's MSA (aka KMO) in JMP's Factor analysis?

We are working on adding this to JMP 16.

-Jeff

Highlighted
##

I am using the same MSA script posted in 2012. It worked well on earlier versions of JMP. But, on JMP Pro 15.1.0 the MSA calculations seem to be off. Can you please help?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: How to get Kaiser's MSA (aka KMO) in JMP's Factor analysis?

- Tags:
- @mpb

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: How to get Kaiser's MSA (aka KMO) in JMP's Factor analysis?

Never mind! I made a mistake - it's running fine.

Article Labels

There are no labels assigned to this post.