BookmarkSubscribeRSS Feed
Choose Language Hide Translation Bar
Highlighted
yvesprairie
Community Trekker

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

0 Kudos
8 REPLIES 8

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
0 Kudos
yvesprairie
Community Trekker

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

0 Kudos

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
0 Kudos
Kerry
Community Member

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?

0 Kudos

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.

Learn it once, use it forever!
0 Kudos
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
Community Trekker

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

0 Kudos
GM
GM
Community Trekker

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