Subscribe Bookmark RSS Feed

Only three quantiles reported for fitted distribution

david_arteta

Community Trekker

Joined:

Oct 28, 2014

Hi,

when you analyze the distribution of a sample of a continuous variable, you can customize the output to show upto ten quantiles using the "Custom Quantiles" option. But when you fit a distribution on the data, then you can only define three probabilities for the quantiles to be shown.

Is it possible to get more quantiles of the fitted distribution in any other way?

Thanks

Dave

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

The user interface only provides up to three quantiles at a time. A script could be written to compute any number of quantiles and add the results in a a custom report to the Distribuiton platform. If your analysis is common, then it could incorporate launching the Distribution platform on the variable and either directly add the report for a pre-defined set of quantiles or first open a dialog with ten number entry boxes.

Learn it once, use it forever!
4 REPLIES
Solution

The user interface only provides up to three quantiles at a time. A script could be written to compute any number of quantiles and add the results in a a custom report to the Distribuiton platform. If your analysis is common, then it could incorporate launching the Distribution platform on the variable and either directly add the report for a pre-defined set of quantiles or first open a dialog with ten number entry boxes.

Learn it once, use it forever!
david_arteta

Community Trekker

Joined:

Oct 28, 2014

Hi Mark,

thanks for the tip. Unfortunately I have no experience with scripting. I have tried the following:

Open( "$SAMPLE_DATA/Diabetes.jmp" );

Distribution (

Continuous Distribution (

Column( :BMI ),

Fit Distribution( Normal( Quantiles( 0.01, 0.05, 0.95, 0.99 ) ) )

)

);

but the results will only show the first three quantiles.

I hope you can elaborate a bit on the matter.

Best,

Dave

ms

Super User

Joined:

Jun 23, 2011

You need to calculate the quantiles "outside" the platform and then append them to the report. There are many ways to do this. Example:

dt = Open( "$SAMPLE_DATA/Diabetes.jmp" );

dist = dt << Distribution(

  Continuous Distribution( Column( :BMI ), Fit Distribution( Normal() ) )

);

rdist = dist << report;

// Array of the desired percentiles

p = [0.99 0.95 0.90 0.75 0.5 0.25 0.10 0.05 0.01];

// Get the parameters for fitted normal and calculate the quantiles

{mu, sigma} = rdist[Number Col Box( "Estimate" )] << get;

q = Normal Quantile( p, mu, sigma );

// Add quantile table to report

rdist[Outline Box( "Parameter Estimates" )] << append(

  Table Box( Number Col Box( "Percentile", p ), Number Col Box( "Quantile", q ) )

);


david_arteta

Community Trekker

Joined:

Oct 28, 2014

Thanks ever so much MS! I see that it is a rather tought thing for a beginner to come up to. I have looked for information in

Just one final question, if you will allow me. Is it posible to do that to include other variables?. So for two variables (in this case BMI and BP), I manage to generate the distribution report and normal fitting, but the "extension" of the quantiles is only appended for the first variable. I see that "mu" and "sigma" are given the values for the first variable and the second variable is not included. I don`t seem to find the appropriate information in the scripting guide.

dt = Open( "$SAMPLE_DATA/Diabetes.jmp" );

dist = dt << Distribution(

  Stack( 1 ),

Column( :BMI ),

Horizontal Layout( 1 ),

Vertical( 0 ),

Outlier Box Plot( 0 ),

Normal Quantile Plot( 1 ),

Fit Distribution( Normal( Goodness of Fit( 1 ) ) ),

CV( 1 ),

Minimum( 1 ),

Maximum( 1 ),

Interquartile Range( 1 )

),

Column( :BP ),

Horizontal Layout( 1 ),

Vertical( 0 ),

Outlier Box Plot( 0 ),

Normal Quantile Plot( 1 ),

Fit Distribution( Normal( Goodness of Fit( 1 ) ) ),

CV( 1 ),

Minimum( 1 ),

Maximum( 1 ),

Interquartile Range( 1 )

);

rdist = dist << report;

p = [0.99 0.95 0.90 0.75 0.5 0.25 0.10 0.05 0.01];

{mu, sigma} = rdist[Number Col Box( "Estimate" )] << get;

q = Normal Quantile( p, mu, sigma );

rdist[Outline Box( "Parameter Estimates" )] << append(

  Table Box( Number Col Box( "Percentile", p ), Number Col Box( "Quantile", q ) )

);