Quantile regression in JSL<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />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
Re: Quantile regression in JSLHi 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?
Re: Quantile regression in JSLMy 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
Re: Quantile regression in JSLIn 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
Re: Quantile regression in JSLI 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.
Re: Quantile regression in JSLThe 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.
Re: Quantile regression in JSLI 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 JSLYves,
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
Re: Quantile regression in JSLMany 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 JSLHello 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