cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
yvesprairie
Level IV

Quantile regression in JSL

Any chance anyone has already written a script to do quantile regression in JMP using JSL? Better yet, does anyone know whether quantile regression will included in future releases of JMP? Quantile regression is becoming pretty standard in statistical analysis and it is surprising that it hasn't been already implemented.

many thanks, Yves

9 REPLIES 9

Re: Quantile regression in JSL

Hello Yves,

If you have SAS installed on your machine with JMP, then you should be able to use the Quantile Regression add-in found in File > SAS > SAS Add-Ins. This will work through JMP 10. I'm not sure if you have access to SAS or what version of JMP you are using.

In the Pro version of JMP 12, quantile regression will be included as an option in the Generalized Regression platform.

-Michael

Michael Crotty
Sr Statistical Writer
JMP Development
yvesprairie
Level IV

Re: Quantile regression in JSL

Many thanks for this info Michael. I knew of the SAS add-in but unfortunately I don't have SAS on my computer and my university doesn't want to allow remote connection to the SAS server. Do you know whether the quantile regression platform in JMP 12 will allow it to run as a multiple regression, i.e. with many X variables?

Thanks again, Yves

Re: Quantile regression in JSL

Yves,

Yes, the quantile regression routine that is in JMP Pro 12 will run multiple quantile regression. Note that it will be a Pro-only feature, though.

Thanks,
Michael

Michael Crotty
Sr Statistical Writer
JMP Development
Kerry
Level I

Re: Quantile regression in JSL

I am using JMP 13.1.0 and the SAS Addin menu item is missing under Files/SAS. Is there another way of activating the add in or is quantile regression only available on Pro now?

Re: Quantile regression in JSL

The Addins menu does not appear until you install your first add-in. Simply open the add-in file and JMP will ask you to confirm that you want to install/register it. That is all it takes.

ian_jmp
Staff

Re: Quantile regression in JSL

I believe that (since version 12), JMP has been able to do quantile regression, so you may not need to use SAS. I've attached an old table with some saved scripts, but please be aware I didn't review it in detail. Perhaps it's useful though.

 

GM
GM
Level III

Re: Quantile regression in JSL

In looking over the documentation, it doesn't appear that I can run a quantile regression for multiple quantiles simultaneously.  Am I missing something, or is this a wish list item?  Many thanks in advance!

Sincerely, MG

GM
GM
Level III

Re: Quantile regression in JSL

My solution is to run the quantile regressions in a loop by quantile. The results match the results I get using the quantreg package in R.  Here is an example of the script using the BigClass data.

Names Default to Here( 1 );

dt = Open("$SAMPLE_DATA/Big Class.jmp"); // open data table
q = Index(0.1, 0.90, 0.1); // create row vector of required quantiles

For(i = 1, i<=NItems(q), i++, //loop through the list of quantiles and run model by quantile
run = dt << Fit Model(
	Y( :Weight ),
	Effects( :Height ),
	Personality( "Generalized Regression" ),
	Generalized Distribution( "Quantile Regression" ),
	Quantile( q[i] ), // quantile
	Run( Fit( Estimation Method( Maximum Likelihood ), Validation Method( None ) ) ),
	SendToReport( Dispatch( {}, "Model Launch", OutlineBox, {Close( 0 )} ) )
);
run << (Fit[1] << Save Residual Formula); // save residuals to compare with R "quantreg" package
run << Close Window;

);
Names Default To Here( 1 );

R Init(); // Initializing R 
R Submit( //submit to R
	"\[
		#install.packages("quantreg") # installing quantile regression package
		library(quantreg) #using quantreg after installed

		setwd("path to file") # set working directory 
		dt <- read.csv("BigClass.csv", header = TRUE) # read in the data
		attach(dt) 
		head(dt)
		
		fit1 <- rq(Weight ~ Height, tau=seq(0.1, 0.9, by=.1), data=dt) # run the qr
		r1 <- resid(fit1) # output residuals
		
	]\"
); // end R Submit

 

cmc
cmc
Level I

Re: Quantile regression in JSL

Hi Michael, 

 

Has JMP added a measure of pseudoR2 to the quantile regression output? It says in the help documentation that there isn't a measure of R2 but in the output there appears to be one (Generalized RSquare), though that one isn't matching what I get with R. Any ideas?