cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Choose Language Hide Translation Bar
ac111ca
Level I

Finding a correlation coefficient and putting it into a table

I have created 2 files to demonstrate my problem. 
 
In "Test 1" I have data from 4 people (i.e., AAAA, BBBB, CCCC, DDDD). Each person has 8 responses to an "estimate" question and 8 responses to a "truth" question. Half the responses are from Domain "0" and the other half from Domain "1".  
 
I would like to find the correlation of between the estimate and truth question for each person in each domain. I know that I can do that by going to Analyze / Multivariate Methods / Multivariate and putting the estimate and truth questions in the "Y, Columns" box, and both "ID" and "Domain" in the "By" box. 
 
The problem is that I want the output of this analysis to be in another JMP table so that I can do further analyses on the correlations. For example, I want to know what the average persons' correlation is between estimate and truth in each of the domains. In order to do this, I need a file that looks like the data in the "Test 2" file. 
 
Can you please tell me an automatic way to produce the "Test 2" data from the Test 1 data? I cannot do this manually because the actual dataset that I am working with is huge. 
1 ACCEPTED SOLUTION

Accepted Solutions
ian_jmp
Staff

Re: Finding a correlation coefficient and putting it into a table

You could explot the 'makeCombinedDataTableMessage'. In JSL, something like:

NamesDefaultToHere(1);

// Data table
dt = DataTable("Test 1.jmp");

// Multivariate
m = dt << Multivariate(Y( :Estimate, :Truth ), By( :ID, :Domain ));

// 'm' is a list because of the 'By' variable: Get the report for the first level
mRep = Report(m[1]);

// Get the correlation matrix into a table dt2 (for all levels)
dt2 = mRep[MatrixBox(1)] << makeCombinedDataTable;

// Manipulate dt2 to remove redundancy
dt2 << setName("Correlation Coefficients For By Groups");
dt2 << deleteColumns({3, 4});
r2del = dt2 << getRowsWhere(:Truth == 1);
dt2 << deleteRows(r2del);
Column(dt2, "Truth") << setName("Correlation Coefficient")

 

View solution in original post

2 REPLIES 2
ian_jmp
Staff

Re: Finding a correlation coefficient and putting it into a table

You could explot the 'makeCombinedDataTableMessage'. In JSL, something like:

NamesDefaultToHere(1);

// Data table
dt = DataTable("Test 1.jmp");

// Multivariate
m = dt << Multivariate(Y( :Estimate, :Truth ), By( :ID, :Domain ));

// 'm' is a list because of the 'By' variable: Get the report for the first level
mRep = Report(m[1]);

// Get the correlation matrix into a table dt2 (for all levels)
dt2 = mRep[MatrixBox(1)] << makeCombinedDataTable;

// Manipulate dt2 to remove redundancy
dt2 << setName("Correlation Coefficients For By Groups");
dt2 << deleteColumns({3, 4});
r2del = dt2 << getRowsWhere(:Truth == 1);
dt2 << deleteRows(r2del);
Column(dt2, "Truth") << setName("Correlation Coefficient")

 

ac111ca
Level I

Re: Finding a correlation coefficient and putting it into a table

Thank you, Ian. That works perfectly.