cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
NathanFisk
Level II

Conducting a "chi-plot" in JMP

I am attempting to assess the independence of some continuous variables in a dataset and would like to perform what I've typically seen referred to as a "chi-plot" of two continuous variables.  Is there an equivalent plot in JMP that can be used?

2 ACCEPTED SOLUTIONS

Accepted Solutions

Re: Conducting a "chi-plot" in JMP

Please see this reference. This procedure is not available in JMP at this time.

View solution in original post

statman
Super User

Re: Conducting a "chi-plot" in JMP

There are a number of ways to test for multicollinearity.  Mark already suggested the Multivariate Methods>Multivariate.  When you run this platform you can obtain Pearson correlation coefficients (as well as others) and also Mahalanobis outliers and get nice scatterplots.  You can also obtain VIF's from parameter estimates tables.

"All models are wrong, some are useful" G.E.P. Box

View solution in original post

7 REPLIES 7

Re: Conducting a "chi-plot" in JMP

First, please post a picture of the plot you want.

 

Second, see Analysis > Multivariate Methods > Multivariate for a platform to explore relationships with two variables at a time.

NathanFisk
Level II

Re: Conducting a "chi-plot" in JMP

Here is an example of a chi-plot...

 

NathanFisk_0-1612893924018.png

This is a method to quickly evaluate whether two continuous variables are independent.  If they're independent then they'll randomly spread around 0.  I have not seen any method in the Multivariate platform of JMP that will quickly assess the independence assumption of two continuous variables in the way.  Is there a way in JMP to perform this sort of evaluation of variable independence?

 

 

Re: Conducting a "chi-plot" in JMP

Please see this reference. This procedure is not available in JMP at this time.

NathanFisk
Level II

Re: Conducting a "chi-plot" in JMP

Alas.  Is there any sort of equivalent test of independence on continuous variables that JMP can perform?

statman
Super User

Re: Conducting a "chi-plot" in JMP

There are a number of ways to test for multicollinearity.  Mark already suggested the Multivariate Methods>Multivariate.  When you run this platform you can obtain Pearson correlation coefficients (as well as others) and also Mahalanobis outliers and get nice scatterplots.  You can also obtain VIF's from parameter estimates tables.

"All models are wrong, some are useful" G.E.P. Box

Re: Conducting a "chi-plot" in JMP

I used this reference because it was the only one that I found that included the necessary details:

 

"Marchu, Victor A. A., Francisco A. R. Rojas, and Francisco Louzada,
"The Chi-Plot and Its Asymptotic Confidence Interval for Analyzing Bivariate
Dependence: An Application to the Average Intelligence and Atheism Rates
across Nations Data", Journal of Data Science 10(2012), 711-722."

 

I wrote this script and verified the equations, but the plots do not look right to me, so I did not go any further.

 

Names Default to Here( 1 );

// get data columns for Y and X roles
dt = Current Data Table();
If( Is Empty( dt ),
	Throw( "No data table open" );
);

dialog = New Window( "Chi-Plot", << Modal,
	H List Box(
		dt clb = Col List Box( All ),
		Line Up Box( N Col( 2 ),
			Button Box( "Y",
				item = dt clb << Get Selected;
				y clb << Append( item );
				If( N Items( x clb << Get Items ) > 0,
					ok bb << Enable( 1 ),
					ok bb << Enable( 0 )
				);
			),
			y clb = Col List Box(
				Min Items( 1 ), Max Items( 1 ),
				<< Set Analysis Type( Continuous )
			),
			Button Box( "X",
				item = dt clb << Get Selected;
				x clb << Append( item );
				If( N Items( y clb << Get Items ) > 0,
					ok bb << Enable( 1 ),
					ok bb << Enable( 0 )
				);
			),
			x clb = Col List Box(),
			Button Box( "Remove",
				y clb << Remove All;
				x clb << Remove All;
				ok bb << Enable( 0 );
			),
			Text Box( "")
		)
	),
	H List Box(
		ok bb = Button Box( "OK",
			y col = Column( (y clb << Get Items)[1] );
			x col = Column( (x clb << Get Items)[1] ),
			<< Enable( 0 )
		),
		Button Box( "Cancel")
	)
);

// unload dialog
If( dialog["Button"] == -1,
	Throw( "User cancelled" );
);

// utility to user alerts
alert# = Function( { msg },
	New Window( "Alert", << Modal,
		Text Box(
			"     " || msg || "     ",
          << Justify Text( "center" ),
          << Set Font Size( 12 )
		),
		Text Box( " " )
	);
);

// sample size and scaling
n = N Row( dt );
scale = 1 / (n-1);

// data vectors
y = y col << Get As Matrix;
x = x col << Get As Matrix;

// cumulative indicators
F = G = H = J( n, 1, . );

// chi-plot coordinates
χ = λ = J( n, 1, . );

For Each Row(
	If( Not( Excluded( Row State() ) ),
		i = Row();
		// compute cumulative indicators for current row
		F[i] = scale * Summation( j = 1, n, If( j != i, x[j] <= x[i], 0 ) );
		G[i] = scale * Summation( j = 1, n, If( j != i, y[j] <= y[i], 0 ) );
		H[i] = scale * Summation( j = 1, n, If( j != i, x[j] <= x[i] & y[j] <= y[i], 0 ) );
		// computer chi-plot coordinates for current row
		χ[i] = (H[i] - (F[i] * G[i])) / Sqrt( F[i] * (1-F[i]) * G[i] * (1-G[i]) );
		sign = ((F[i]-0.5) * (G[i]-0.5));
		λ[i] = 4 * sign * Maximum( (F[i]-0.5)^2, (G[i]-0.5)^2 );
	);
);

// add coordinates to data table
χ col = dt << New Column( "χ", Numeric, Continuous, Values( χ ) );
λ col = dt << New Column( "λ", Numeric, Continuous, Values( λ ) );

// add table script for Chi-Plot
dt << New Script( "Chi-Plot",
	Current Data Table() << Graph Builder(
		Size( 600, 400 ),
		Show Control Panel( 0 ),
		Show Legend( 0 ),
		Variables( X( :λ ), Y( :χ ) ),
		Elements( Points( X, Y, Legend( 3 ) ) ),
		SendToReport(
			Dispatch(
				{},
				"λ",
				ScaleBox,
				{Min( -1 ), Max( 1 ), Inc( 0.2 ), Minor Ticks( 0 )}
			),
			Dispatch(
				{},
				"χ",
				ScaleBox,
				{Min( -1 ), Max( 1 ), Inc( 0.2 ), Minor Ticks( 0 )}
			),
			Dispatch( {}, "graph title", TextEditBox, {Set Text( "Chi-Plot" )} )
		)
	);
);

// launch Chi-Plot
gb = dt << Graph Builder(
	Size( 600, 400 ),
	Show Control Panel( 0 ),
	Show Legend( 0 ),
	Variables( X( :λ ), Y( :χ ) ),
	Elements( Points( X, Y, Legend( 3 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"λ",
			ScaleBox,
			{Min( -1 ), Max( 1 ), Inc( 0.2 ), Minor Ticks( 0 )}
		),
		Dispatch(
			{},
			"χ",
			ScaleBox,
			{Min( -1 ), Max( 1 ), Inc( 0.2 ), Minor Ticks( 0 )}
		),
		Dispatch( {}, "graph title", TextEditBox, {Set Text( "Chi-Plot" )} )
	)
);

Re: Conducting a "chi-plot" in JMP

I was able to continue working on this plot. I uploaded it as an add-in. You can find it here.

 

NOTE: I fixed a bug and I updated this add-in to be more useful. If you downloaded before today, then you should go back and replace it with the newer version.