Distribution
Example 1
Summary: Opens a data table, creates a distribution analysis for three nominal columns (TREATMENT GROUP, ADVERSE REACTION, and ADR SEVERITY), and generates mosaic plots and histograms for each column.
Code:
// Distribution
// Open data table
dt = Open("data_table.jmp");
// Distribution
Distribution(
Nominal Distribution(
Column( :TREATMENT GROUP ),
Mosaic Plot( 1 ),
Histogram( 1 )
),
Nominal Distribution(
Column( :ADVERSE REACTION ),
Mosaic Plot( 1 ),
Histogram( 1 )
),
Nominal Distribution(
Column( :ADR SEVERITY ),
Mosaic Plot( 1 ),
Histogram( 1 )
)
);
Code Explanation:
- Open data table;
- Create distribution analysis.
- Analyze "TREATMENT GROUP" column.
- Generate mosaic plot.
- Generate histogram.
- Analyze "ADVERSE REACTION" column.
- Generate mosaic plot.
- Generate histogram.
- Analyze "ADR SEVERITY" column.
- Generate mosaic plot.
- Generate histogram.
Example 2
Summary: Opens a data table, performs distribution analysis on various columns, and sends the results to a report with adjusted marker drawing modes for Premium USD and Claim USD.
Code:
// Distribution (All)
// Open data table
dt = Open("data_table.jmp");
// Distribution (All)
Distribution(
Continuous Distribution(
Column( :Sample # )
),
Continuous Distribution(
Column( :Premium USD )
),
Nominal Distribution(
Column( :"Claim(Y/N)"n )
),
Continuous Distribution(
Column( :Claim USD )
),
Nominal Distribution(
Column( :Age )
),
Nominal Distribution(
Column( :AgeClass )
),
Nominal Distribution(
Column( :Gender )
),
Nominal Distribution(
Column( :Car Power )
),
Nominal Distribution(
Column( :Rating Class )
),
Nominal Distribution(
Column( :Branch )
),
Nominal Distribution(
Column( :Zone )
),
Nominal Distribution(
Column( :Region )
),
Nominal Distribution(
Column( :"City(Y/N)"n )
),
SendToReport(
Dispatch( {"Premium USD"},
"Distrib Outlier Box",
FrameBox,
Marker Drawing Mode( "Fast" )
),
Dispatch( {"Claim USD"},
"Distrib Outlier Box",
FrameBox,
Marker Drawing Mode( "Fast" )
)
)
);
Code Explanation:
- Open data table.
- Create distribution analysis.
- Analyze Sample # column.
- Analyze Premium USD column.
- Analyze Claim(Y/N) column.
- Analyze Claim USD column.
- Analyze Age column.
- Analyze AgeClass column.
- Analyze Gender column.
- Analyze Car Power column.
- Analyze Rating Class column.
- Analyze Branch column.
- Analyze Zone column.
- Analyze Region column.
- Analyze City(Y/N) column.
- Adjust marker drawing mode for Premium USD.
- Adjust marker drawing mode for Claim USD.
Example 3
Summary: Opens a data table, generates a distribution report with quantiles for the 'Awake' and 'Asleep' variables, and displays the results.
Code:
// side by side
// Open data table
dt = Open("data_table.jmp");
// side by side
Distribution(
y( Awake, Asleep ),
quantiles( 0 )
);
Code Explanation:
- Open table.
- Create distribution report.
- Analyze "Awake" variable.
- Analyze "Asleep" variable.
- Display quantiles.
Example 4
Summary: Opens a data table, performs a univariate test for the mean of column 'Dif', and excludes quantiles calculation.
Code:
// univ. test Dif
// Open data table
dt = Open("data_table.jmp");
// univ. test Dif
Distribution(
y( Dif ),
quantiles( 0 ),
test mean( 0 )
);
Code Explanation:
- Open data table.
- Assign data table to dt.
- Run Distribution analysis.
- Analyze column Dif.
- Exclude quantiles calculation.
- Test mean equals zero.
Example 5
Summary: Opens a data table, creates a distribution analysis with nominal column 'Banding?', and selects the 'Banding?' column for further analysis.
Code:
// Distribution (Band Type)
// Open data table
dt = Open("data_table.jmp");
// Distribution (Band Type)
Distribution(
Nominal Distribution(
Column( :Banding? )
)
);
Code Explanation:
- Open data table.
- Create distribution analysis.
- Analyze nominal column.
- Select "Banding?" column.
Example 6
Summary: Opens a data table, creates a distribution analysis with multiple variables (sibling ages, sports, countries visited, and family cars), and visualizes the relationships between these variables.
Code:
// Distribution
// Open data table
dt = Open("data_table.jmp");
// Distribution
Distribution(
Y(
:sibling ages, :sports,
:countries visited, :family cars
)
);
Code Explanation:
- Open data table.
- Create distribution analysis.
- Analyze sibling ages.
- Analyze sports participation.
- Analyze countries visited.
- Analyze family cars.
Example 7
Summary: Opens a data table, creates a distribution analysis with continuous and nominal distributions for the 'weight' and 'age' columns, respectively.
Code:
// Distribution
// Open data table
dt = Open("data_table.jmp");
// Distribution
Distribution(
Continuous Distribution(
Column( :weight )
),
Nominal Distribution(
Column( :age )
)
);
Code Explanation:
- Open table.
- Create distribution analysis.
- Analyze weight column.
- Analyze age column.
Example 8
Summary: Opens a data table, creates a distribution analysis with continuous and nominal variables, and visualizes the results.
Code:
// Distribution
// Open data table
dt = Open("data_table.jmp");
// Distribution
Distribution(
Continuous Distribution(
Column( :birth )
),
Continuous Distribution(
Column( :death )
),
Nominal Distribution(
Column( :Region )
)
);
Code Explanation:
- Open data table.
- Create distribution analysis.
- Analyze birth column.
- Analyze death column.
- Analyze Region column.
Example 9
Summary: Opens a data table, creates a distribution analysis, and analyzes BP AM and BP PM using the quantiles method.
Code:
// side by side
// Open data table
dt = Open("data_table.jmp");
// side by side
Distribution(
y( BP AM, BP PM ),
quantiles( 0 )
);
Code Explanation:
- Open data table.
- Create distribution analysis.
- Analyze BP AM and BP PM.
- Exclude quantiles display.
Example 10
Summary: Opens a data table, creates a distribution analysis with multiple continuous variables, and stacks the data horizontally for visualization.
Code:
// Distribution
// Open data table
dt = Open("data_table.jmp");
// Distribution
Distribution(
Stack( 1 ),
Continuous Distribution(
Column( :Percent body fat ),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Continuous Distribution(
Column( :"Age (years)"n ),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Continuous Distribution(
Column( :"Weight (lbs)"n ),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Continuous Distribution(
Column( :"Height (inches)"n ),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Continuous Distribution(
Column(
:"Neck circumference (cm)"n
),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Continuous Distribution(
Column(
:"Chest circumference (cm)"n
),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Continuous Distribution(
Column(
:
"Abdomen circumference (cm)"n
),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Continuous Distribution(
Column(
:"Hip circumference (cm)"n
),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Continuous Distribution(
Column(
:"Thigh circumference (cm)"n
),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Continuous Distribution(
Column(
:"Knee circumference (cm)"n
),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Continuous Distribution(
Column(
:"Ankle circumference (cm)"n
),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Continuous Distribution(
Column(
:
"Biceps (extended) circumference (cm)"n
),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Continuous Distribution(
Column(
:
"Forearm circumference (cm)"n
),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Continuous Distribution(
Column(
:"Wrist circumference (cm)"n
),
Horizontal Layout( 1 ),
Vertical( 0 )
)
);
Code Explanation:
- Open table.
- Create distribution analysis.
- Stack data horizontally.
- Analyze percent body fat.
- Analyze age.
- Analyze weight.
- Analyze height.
- Analyze neck circumference.
- Analyze chest circumference.
- Analyze abdomen circumference.
- Analyze hip circumference.
- Analyze thigh circumference.
- Analyze knee circumference.
- Analyze ankle circumference.
- Analyze biceps circumference.
- Analyze forearm circumference.
- Analyze wrist circumference.
Example 11
Summary: Opens a data table, creates a distribution analysis for the 'age' column, and visualizes the continuous distribution using the Distribution platform in JMP.
Code:
// Distribution
// Open data table
dt = Open("data_table.jmp");
// Distribution
Distribution(
Continuous Distribution(
Column( :age )
)
);
Code Explanation:
- Open data table;
- Create distribution analysis.
- Include continuous distribution.
- Analyze column "age".
Example 12
Summary: Opens a data table, performs distribution analysis on City Mileage and Highway Mileage variables, and generates histograms with normal quantile plots and stem and leaf plots. The background color of the histograms is also customized.
Code:
// Distribution
// Open data table
dt = Open("data_table.jmp");
// Distribution
Distribution(
Continuous Distribution(
Column( :"City Mileage (MPG)"n ),
Normal Quantile Plot( 1 ),
Stem and Leaf( 1 )
),
Continuous Distribution(
Column(
:"Highway Mileage (MPG)"n
),
Normal Quantile Plot( 1 ),
Stem and Leaf( 1 )
),
SendToReport(
Dispatch( {"City Mileage (MPG)"},
"Distrib Histogram", FrameBox,
Background Color( 2 )
),
Dispatch(
{"Highway Mileage (MPG)"},
"Distrib Histogram", FrameBox,
Background Color( 2 )
)
)
);
Code Explanation:
- Open table.
- Create distribution analysis.
- Analyze City Mileage.
- Include normal quantile plot.
- Include stem and leaf plot.
- Analyze Highway Mileage.
- Include normal quantile plot.
- Include stem and leaf plot.
- Change histogram background color.
- Change histogram background color.
Example 13
Summary: Opens a data table, creates a distribution analysis with automatic recalculation, and visualizes the nominal and continuous variables using histograms and a normal quantile plot.
Code:
// Distribution
// Open data table
dt = Open("data_table.jmp");
// Distribution
Distribution(
Automatic Recalc( 1 ),
Nominal Distribution(
Column( :Day of Week )
),
Continuous Distribution(
Column( :Time ),
Normal Quantile Plot( 1 )
),
SendToReport(
Dispatch( {}, "Distrib Nom Hist",
FrameBox,
{DispatchSeg( Hist Seg( 1 ) )
}
),
Dispatch( {}, "Distrib Histogram",
FrameBox,
{DispatchSeg( Hist Seg( 1 ) )
}
),
Dispatch( {}, "5", ScaleBox,
{Scale( "Linear" ),
Min( 0.0533333333333334 ),
Max( 0.946666666666666 ),
Inc( 0.08 ), Minor Ticks( 0 ),
Show Major Grid( 1 ),
Rotated Labels(
"Horizontal"
)}
),
Dispatch( {}, "Quantiles",
OutlineBox,
{Close( 1 )}
)
)
);
Code Explanation:
- Open table.
- Create distribution analysis.
- Set automatic recalculation.
- Analyze nominal variable.
- Analyze continuous variable.
- Enable normal quantile plot.
- Customize histogram appearance.
- Customize histogram appearance.
- Set linear scale for axis.
- Adjust axis limits and increments.
Example 14
Summary: Opens a data table, creates a distribution analysis with continuous and nominal variables, and visualizes the results.
Code:
// Distribution
// Open data table
dt = Open("data_table.jmp");
// Distribution
Distribution(
Continuous Distribution(
Column( :Coal particles )
),
Continuous Distribution(
Column( :pH )
),
Nominal Distribution(
Column( :Polymer )
)
);
Code Explanation:
- Open data table.
- Create distribution analysis.
- Analyze Coal particles column.
- Analyze pH column.
- Analyze Polymer column.
Example 15
Summary: Opens a data table, creates a distribution analysis with two nominal distributions for the 'Customer' and 'Beverage' columns, and visualizes the results.
Code:
// Distribution
// Open data table
dt = Open("data_table.jmp");
// Distribution
Distribution(
Nominal Distribution(
Column( :Customer )
),
Nominal Distribution(
Column( :Beverage )
)
);
Code Explanation:
- Open table.
- Create distribution analysis.
- Analyze Customer column.
- Analyze Beverage column.
Example 16
Summary: Opens a data table, creates a distribution analysis with continuous data, and fits a normal distribution to the Heart Rate column while grouping by Time.
Code:
// Distribution 2
// Open data table
dt = Open("data_table.jmp");
// Distribution 2
Distribution(
Stack( 1 ),
Continuous Distribution(
Column( :Heart Rate ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Fit Distribution( Normal ),
Fit Distribution( Smooth Curve )
),
By( :"Time (Raw)"n )
);
Code Explanation:
- Open table.
- Create distribution analysis.
- Stack columns.
- Analyze continuous data.
- Select Heart Rate column.
- Set horizontal layout.
- Disable vertical layout.
- Fit normal distribution.
- Fit smooth curve.
- Group by Time.
Example 17
Summary: Opens a data table, creates a distribution analysis with histograms only for the Miles, Weight, and Strike Point columns, and displays the results.
Code:
// Distribution
// Open data table
dt = Open("data_table.jmp");
// Distribution
Distribution(
Continuous Distribution(
Column( :Miles )
),
Continuous Distribution(
Column( :Weight )
),
Nominal Distribution(
Column( :Strike Point )
),
Histograms Only
);
Code Explanation:
- Open data table.
- Create distribution analysis.
- Analyze Miles column.
- Analyze Weight column.
- Analyze Strike Point column.
- Display histograms only.
Example 18
Summary: Generates a comprehensive distribution analysis for multiple columns in a data table, including capability analysis with PpK labeling and dispatching reports to various JMP platforms.
Code:
// Distribution
// Open data table
dt = Open("data_table.jmp");
// Distribution
Distribution(
Continuous Distribution(
Column( :Price ),
PpK Capability Labeling( 61 ),
Capability Analysis(
LSL( 2000 ),
USL( 4000 ),
Target( 3000 )
)
),
Continuous Distribution(
Column( :Carat Weight ),
PpK Capability Labeling( 61 )
),
Nominal Distribution(
Column( :Color )
),
Nominal Distribution(
Column( :Clarity )
),
Continuous Distribution(
Column( :Depth ),
PpK Capability Labeling( 61 )
),
Continuous Distribution(
Column( :Table ),
PpK Capability Labeling( 61 )
),
Nominal Distribution(
Column( :Cut )
),
Nominal Distribution(
Column( :Report )
),
SendToReport(
Dispatch( {"Price"}, "Quantiles",
OutlineBox,
Close( 1 )
),
Dispatch( {"Price"},
"Capability Analysis",
OutlineBox,
Close( 1 )
),
Dispatch(
{"Price",
"Capability Analysis"},
" Long Term Sigma",
OutlineBox,
Close( 1 )
),
Dispatch( {"Carat Weight"},
"Quantiles", OutlineBox,
Close( 1 )
),
Dispatch( {"Color"},
"Frequencies", OutlineBox,
Close( 1 )
),
Dispatch( {"Clarity"},
"Frequencies", OutlineBox,
Close( 1 )
),
Dispatch( {"Depth"}, "Quantiles",
OutlineBox,
Close( 1 )
),
Dispatch( {"Table"}, "Quantiles",
OutlineBox,
Close( 1 )
),
Dispatch( {"Cut"}, "Frequencies",
OutlineBox,
Close( 1 )
),
Dispatch( {"Report"},
"Frequencies", OutlineBox,
Close( 1 )
)
)
);
Code Explanation:
- Open data table;
- Create distribution analysis.
- Analyze Price column.
- Set PpK Capability Labeling to 61.
- Perform capability analysis on Price.
- Define LSL as 2000.
- Define USL as 4000.
- Define Target as 3000.
- Analyze Carat Weight column.
- Set PpK Capability Labeling to 61 for Carat Weight.
Example 19
Summary: Opens a data table, creates a distribution analysis for Quack's Weight Change and Quick's Weight Change, and tests the mean equals zero using the Continuous Distribution function.
Code:
// Distribution
// Open data table
dt = Open("data_table.jmp");
// Distribution
Distribution(
Continuous Distribution(
Column( :Quack's Weight Change ),
Test Mean( 0 )
),
Continuous Distribution(
Column( :Quick's Weight Change ),
Test Mean( 0 )
)
);
Code Explanation:
- Open data table.
- Create distribution analysis.
- Analyze Quack's Weight Change.
- Test mean equals zero.
- Analyze Quick's Weight Change.
- Test mean equals zero.
Example 20
Summary: Opens a data table, creates a distribution analysis with multiple nominal distributions, and adds a local data filter for Handedness.
Code:
// Distributions
// Open data table
dt = Open("data_table.jmp");
// Distributions
Distribution(
Stack( 1 ),
Automatic Recalc( 1 ),
Nominal Distribution(
Column( :Analysis ),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Nominal Distribution(
Column( :BBQ ),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Nominal Distribution(
Column( :Pie ),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Nominal Distribution(
Column( :Discoveries ),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Nominal Distribution(
Column( :OS ),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Nominal Distribution(
Column( :Age ),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Nominal Distribution(
Column( :Usage ),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Nominal Distribution(
Column( :Boy Band ),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Nominal Distribution(
Column( :DGA ),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Local Data Filter(
Add Filter(
columns( :Handedness ),
Display(
:Handedness,
Size( 160, 51 ),
"List Display"
)
)
)
);
Code Explanation:
- Open table.
- Create distribution analysis.
- Stack variables.
- Enable automatic recalculation.
- Analyze Analysis column.
- Analyze BBQ column.
- Analyze Pie column.
- Analyze Discoveries column.
- Analyze OS column.
- Add local data filter for Handedness.
Example 21
Summary: Opens a data table, creates a distribution analysis for the 'Toxicity' column, and specifies a continuous distribution using the Distribution function.
Code:
// Distribution
// Open data table
dt = Open("data_table.jmp");
// Distribution
Distribution(
Continuous Distribution(
Column( :Toxicity )
)
);
Code Explanation:
- Open table.
- Create distribution analysis.
- Specify continuous distribution.
- Analyze column "Toxicity".
Example 22
Summary: Generates a distributions report for three nominal variables: Education Achievement Name, School Type Code, and Education Value System. The script customizes the histograms with green line and fill colors.
Code:
// Distributions
// Open data table
dt = Open("data_table.jmp");
// Distributions
Distribution(
Nominal Distribution(
Column(
:Education Achievement Name
)
),
Nominal Distribution(
Column( :School Type Code )
),
Nominal Distribution(
Column( :Education Value System )
),
SendToReport(
Dispatch(
{"Education Achievement Name"
}, "Distrib Nom Hist",
FrameBox,
{
DispatchSeg(
Hist Seg( 1 ),
{
Line Color(
{65, 104, 68}
), Fill Color( "Green" )}
)}
),
Dispatch( {"School Type Code"},
"Distrib Nom Hist", FrameBox,
{
DispatchSeg(
Hist Seg( 1 ),
{
Line Color(
{65, 104, 68}
), Fill Color( "Green" )}
)}
),
Dispatch(
{"Education Value System"},
"Distrib Nom Hist", FrameBox,
{
DispatchSeg(
Hist Seg( 1 ),
{
Line Color(
{65, 104, 68}
), Fill Color( "Green" )}
)}
)
)
);
Code Explanation:
- Open table.
- Create distributions report.
- Analyze "Education Achievement Name".
- Analyze "School Type Code".
- Analyze "Education Value System".
- Customize "Education Achievement Name" histogram.
- Set line color to green.
- Set fill color to green.
- Customize "School Type Code" histogram.
- Set line color to green.
- Set fill color to green.
- Customize "Education Value System" histogram.
- Set line color to green.
- Set fill color to green.
Example 23
Summary: Generates a distribution analysis for three columns ('Performance Eval', 'Degree Description', and 'Emp Level') in a data table, customizing histogram colors and setting the scale for 'Emp Level'.
Code:
// Distribution
// Open data table
dt = Open("data_table.jmp");
// Distribution
Distribution(
Nominal Distribution(
Column(
Referenced Column(
"Performance Eval",
Reference(
Column(
:Employee Id
),
Reference(
Column(
:Employee Id
),
Reference(
Column(
:
Performance Eval
)
)
)
)
)
)
),
Nominal Distribution(
Column(
Referenced Column(
"Degree Description",
Reference(
Column(
:Employee Id
),
Reference(
Column(
:
Degree Description
)
)
)
)
)
),
Continuous Distribution(
Column( :Emp Level )
),
SendToReport(
Dispatch( {"Performance Eval"},
"Distrib Nom Hist", FrameBox,
{
DispatchSeg(
Hist Seg( 1 ),
{
Line Color(
{65, 104, 68}
), Fill Color( "Green" )}
)}
),
Dispatch( {"Degree Description"},
"Distrib Nom Hist", FrameBox,
{
DispatchSeg(
Hist Seg( 1 ),
{
Line Color(
{65, 104, 68}
), Fill Color( "Green" )}
)}
),
Dispatch( {"Emp Level"}, "1",
ScaleBox,
{Min( -0.157761732851986 ),
Max( 2.1 ), Inc( 1 ),
Minor Ticks( 0 )}
),
Dispatch( {"Emp Level"},
"Distrib Histogram", FrameBox,
{
DispatchSeg(
Hist Seg( 1 ),
{
Line Color(
{65, 104, 68}
), Fill Color( "Green" )}
)}
)
)
);
Code Explanation:
- Open data table.
- Create distribution analysis.
- Analyze "Performance Eval" column.
- Analyze "Degree Description" column.
- Analyze "Emp Level" column.
- Customize "Performance Eval" histogram colors.
- Customize "Degree Description" histogram colors.
- Set "Emp Level" scale.
- Customize "Emp Level" histogram colors.
Example 24
Summary: Opens a data table, creates a distribution analysis with nominal distributions for TV, Film, Art, and Restaurant columns, providing an interactive visualization of the data.
Code:
// Distribution
// Open data table
dt = Open("data_table.jmp");
// Distribution
Distribution(
Nominal Distribution( Column( :TV ) ),
Nominal Distribution(
Column( :Film )
),
Nominal Distribution(
Column( :Art )
),
Nominal Distribution(
Column( :Restaurant )
)
);
Code Explanation:
- Open table.
- Create distribution analysis.
- Analyze TV column.
- Analyze Film column.
- Analyze Art column.
- Analyze Restaurant column.
Example 25
Summary: Opens a data table, creates a distribution analysis for four nutritional columns (Calories, Fat, Carbohydrates, and Protein), and visualizes the results.
Code:
// Distribution: Nutritional Data
// Open data table
dt = Open("data_table.jmp");
// Distribution: Nutritional Data
Distribution(
Continuous Distribution(
Column( :Calories )
),
Continuous Distribution(
Column( :Fat )
),
Continuous Distribution(
Column( :Carbohydrates )
),
Continuous Distribution(
Column( :Protein )
)
);
Code Explanation:
- Open table.
- Create distribution analysis.
- Analyze Calories column.
- Analyze Fat column.
- Analyze Carbohydrates column.
- Analyze Protein column.
Example 26
Summary: Generates a distribution report to analyze and visualize the surface quality and color of data, utilizing the Nominal Distribution function with Count Axis.
Code:
// Distribution of surface quality and color
// Open data table
dt = Open("data_table.jmp");
// Distribution of surface quality and color
Distribution(
Nominal Distribution(
Column( :surface quality ),
Count Axis( 1 )
),
Nominal Distribution(
Column( :color ),
Count Axis( 1 )
),
SendToReport(
Dispatch( {}, "Distributions",
OutlineBox,
{
Set Title(
"Surface Quality and Color"
)}
)
)
);
Code Explanation:
- Open table.
- Create distribution report.
- Analyze surface quality.
- Count surface quality.
- Analyze color.
- Count color.
- Send report.
- Set title.
- Display report.
- End script.
Example 27
Summary: Opens a data table, creates a distribution analysis with stacked variables, and analyzes various substance use and sexual behavior variables using the Nominal Distribution platform in JMP.
Code:
// Distributions
// Open data table
dt = Open("data_table.jmp");
// Distributions
Distribution(
Stack( 1 ),
Nominal Distribution(
Column(
:
"Drove 1+ times when drinking"n
),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Nominal Distribution(
Column(
:Smoked cigarette before 13
),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Nominal Distribution(
Column(
:Smoked daily for 30 days
),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Nominal Distribution(
Column(
:Had first drink before 13
),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Nominal Distribution(
Column(
:
"Five+ drinks 1+ past 30 days"n
),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Nominal Distribution(
Column(
:Tried marijuana before 13
),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Nominal Distribution(
Column(
:
"Used cocaine 1+ times in life"n
),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Nominal Distribution(
Column(
:
"Sniffed glue 1+ times in life"n
),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Nominal Distribution(
Column(
:
"Used meth 1+ times in life"n
),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Nominal Distribution(
Column(
:
"Used ecstasy 1+ times in life"n
),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Nominal Distribution(
Column( :Had sex before 13 ),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Nominal Distribution(
Column(
:
"Had sex with 4+ people in life"n
),
Horizontal Layout( 1 ),
Vertical( 0 )
)
);
Code Explanation:
- Open table.
- Create distribution analysis.
- Stack variables.
- Analyze "Drove 1+ times when drinking".
- Analyze "Smoked cigarette before 13".
- Analyze "Smoked daily for 30 days".
- Analyze "Had first drink before 13".
- Analyze "Five+ drinks 1+ past 30 days".
- Analyze "Tried marijuana before 13".
- Analyze substance use variables.
- Analyze sexual behavior variables.
Example 28
Summary: Visualizes the distribution of profitability by lead studio and genre, utilizing a Distribution platform to generate histograms with interactive ordering by count ascending.
Code:
// Distribution: Profitability by Lead Studio and Genre
// Open data table
dt = Open("data_table.jmp");
// Distribution: Profitability by Lead Studio and Genre
Distribution(
Weight( :Profitability ),
Nominal Distribution(
Column( :Lead Studio Name ),
Order By( "Count Ascending" )
),
Nominal Distribution(
Column( :Genre ),
Order By( "Count Ascending" )
),
Histograms Only,
SendToReport(
Dispatch( {}, "", NomAxisBox,
{Set Width( 155 ),
Set Height( 517 )}
),
Dispatch( {}, "Distrib Nom Hist",
FrameBox,
{Frame Size( 82, 527 )}
),
Dispatch( {}, "Distributions",
OutlineBox,
{
Set Title(
"Profitability by Lead Studio Name and Genre"
)}
)
)
);
Code Explanation:
- Open data table.
- Create distribution analysis.
- Weight by Profitability.
- Analyze Lead Studio Name.
- Order by count ascending.
- Analyze Genre.
- Order by count ascending.
- Display histograms only.
- Adjust report width.
- Adjust report height.
Example 29
Summary: Opens a data table, creates a distribution analysis with nominal and continuous variables, and visualizes the results.
Code:
// Distribution
// Open data table
dt = Open("data_table.jmp");
// Distribution
Distribution(
Nominal Distribution(
Column( :Gender )
),
Continuous Distribution(
Column( :Height )
)
);
Code Explanation:
- Open data table.
- Create distribution analysis.
- Analyze gender as nominal.
- Analyze height as continuous.
Example 30
Summary: Opens a data table, creates a distribution analysis, and fits a Johnson Su continuous distribution to the selected column :x.
Code:
// Distribution
// Open data table
dt = Open("data_table.jmp");
// Distribution
Distribution(
Continuous Distribution(
Column( :x ),
Fit Distribution( Johnson Su )
)
);
Code Explanation:
- Open table.
- Create distribution analysis.
- Select continuous distribution.
- Choose column :x.
- Fit Johnson Su distribution.
Example 31
Summary: Opens a data table, creates a distribution analysis with frequency and nominal variables, and specifies the TYPE column for further analysis.
Code:
// Distribution
// Open data table
dt = Open("data_table.jmp");
// Distribution
Distribution(
Freq( :Count ),
Nominal Distribution(
Column( :TYPE )
)
);
Code Explanation:
- Open table.
- Create distribution analysis.
- Set frequency column.
- Analyze nominal variable.
- Specify TYPE column.
Example 32
Summary: Visualizes a virtual join between the 'Age' and 'Rating' columns, creating a distribution analysis with continuous and nominal variables.
Code:
// Distribution: Virtual Join - Age and Rating
// Open data table
dt = Open("data_table.jmp");
// Distribution: Virtual Join - Age and Rating
Distribution(
Continuous Distribution(
Column(
Referenced Column(
"Age[Customer ID]",
Reference(
Column(
:Customer ID
),
Reference(
Column( :Age )
)
)
)
),
Outlier Box Plot( 0 )
),
Nominal Distribution(
Column(
Referenced Column(
"Rating[Item Number]",
Reference(
Column(
:Item Number
),
Reference(
Column( :Rating )
)
)
)
)
)
);
Code Explanation:
- Open data table.
- Create distribution analysis.
- Analyze continuous variable.
- Use referenced column for age.
- Create virtual join for age.
- Include customer ID reference.
- Include age reference.
- Disable outlier box plot.
- Analyze nominal variable.
- Use referenced column for rating.
Example 33
Summary: Opens a data table and creates a Distribution analysis for multiple nominal columns, visualizing the distribution of each column's values.
Code:
// Distribution
// Open data table
dt = Open("data_table.jmp");
// Distribution
Distribution(
Nominal Distribution(
Column( :Edibility )
),
Nominal Distribution(
Column( :cap shape )
),
Nominal Distribution(
Column( :cap surface )
),
Nominal Distribution(
Column( :cap color )
),
Nominal Distribution(
Column( :bruises )
),
Nominal Distribution(
Column( :odor )
),
Nominal Distribution(
Column( :gill attachment )
),
Nominal Distribution(
Column( :gill spacing )
),
Nominal Distribution(
Column( :gill size )
),
Nominal Distribution(
Column( :gill color )
),
Nominal Distribution(
Column( :stalk shape )
),
Nominal Distribution(
Column( :stalk root )
),
Nominal Distribution(
Column(
:stalk surface above ring
)
),
Nominal Distribution(
Column(
:stalk surface below ring
)
),
Nominal Distribution(
Column( :stalk color above ring )
),
Nominal Distribution(
Column( :stalk color below ring )
),
Nominal Distribution(
Column( :veil type )
),
Nominal Distribution(
Column( :veil color )
),
Nominal Distribution(
Column( :ring number )
),
Nominal Distribution(
Column( :ring type )
),
Nominal Distribution(
Column( :spore print color )
),
Nominal Distribution(
Column( :population )
),
Nominal Distribution(
Column( :habitat )
)
);
Code Explanation:
- Open data table.
- Create Distribution analysis.
- Analyze Edibility column.
- Analyze cap shape column.
- Analyze cap surface column.
- Analyze cap color column.
- Analyze bruises column.
- Analyze odor column.
- Analyze gill attachment column.
- Analyze gill spacing column.
Example 34
Summary: Generates a distributions report for various categorical and continuous variables in a data table, utilizing the Distribution platform to visualize the frequency of each category.
Code:
// Distributions
// Open data table
dt = Open("data_table.jmp");
// Distributions
Distribution(
Nominal Distribution(
Column(
:Body System or Organ Class
),
Order By( "Count Ascending" )
),
Nominal Distribution(
Column( :"Severity/Intensity"n )
),
Nominal Distribution(
Column( :Serious Event )
),
Continuous Distribution(
Column( :Age )
),
Nominal Distribution(
Column( :Sex )
),
Nominal Distribution(
Column( :Race )
),
Nominal Distribution(
Column( :Death Description ),
Order By( "Count Ascending" )
)
);
Code Explanation:
- Open data table;
- Generate distributions report.
- Analyze Body System or Organ Class.
- Order by count ascending.
- Analyze Severity/Intensity.
- Analyze Serious Event.
- Analyze Age.
- Analyze Sex.
- Analyze Race.
- Analyze Death Description.
- Order by count ascending.
Example 35
Summary: Opens a data table, creates a distribution analysis with uniform scaling, and analyzes multiple columns (palmitic, palmitoleic, stearic, oleic, linoleic, linolenic, arachidic, eicosenoic) as well as the Subregion column, displaying percents and a mosaic plot.
Code:
// Distribution
// Open data table
dt = Open("data_table.jmp");
// Distribution
Distribution(
Uniform Scaling( 1 ),
Continuous Distribution(
Column( :palmitic )
),
Continuous Distribution(
Column( :palmitoleic )
),
Continuous Distribution(
Column( :stearic )
),
Continuous Distribution(
Column( :oleic )
),
Continuous Distribution(
Column( :linoleic )
),
Continuous Distribution(
Column( :linolenic )
),
Continuous Distribution(
Column( :arachidic )
),
Continuous Distribution(
Column( :eicosenoic )
),
Nominal Distribution(
Column( :Subregion ),
Show Percents( 1 ),
Mosaic Plot( 1 )
)
);
Code Explanation:
- Open data table.
- Create distribution analysis.
- Set uniform scaling.
- Analyze palmitic column.
- Analyze palmitoleic column.
- Analyze stearic column.
- Analyze oleic column.
- Analyze linoleic column.
- Analyze linolenic column.
- Analyze arachidic column.
- Analyze eicosenoic column.
- Analyze Subregion column.
- Show percents for Subregion.
- Create mosaic plot for Subregion.
Example 36
Summary: Opens a data table, creates a distribution analysis with uniform scaling, and analyzes three continuous columns ('1980', '1984', and '1996') with linear scale, best format, and specific axis settings.
Code:
// Distribution
// Open data table
dt = Open("data_table.jmp");
// Distribution
Distribution(
Uniform Scaling( 1 ),
Continuous Distribution(
Column( :"1980"n ),
Axis Settings(
Scale( Linear ),
Format( Best ),
Min( 20 ),
Max( 65 ),
Inc( 5 )
)
),
Continuous Distribution(
Column( :"1984"n ),
Axis Settings(
Scale( Linear ),
Format( Best ),
Min( 20 ),
Max( 65 ),
Inc( 5 )
)
),
Continuous Distribution(
Column( :"1996"n ),
Axis Settings(
Scale( Linear ),
Format( Best ),
Min( 20 ),
Max( 65 ),
Inc( 5 )
)
)
);
Code Explanation:
- Open table.
- Create distribution analysis.
- Set uniform scaling.
- Analyze "1980" column.
- Set linear scale.
- Format axis best.
- Set axis minimum to 20.
- Set axis maximum to 65.
- Set axis increment to 5.
- Analyze "1984" and "1996" columns similarly.
Example 37
Summary: Opens a data table, creates a distribution analysis for three columns (Prime, Delta, and DeltaDelta), and visualizes the results using the EMS method.
Code:
// Distribution
// Open data table
dt = Open("data_table.jmp");
// Distribution
Distribution(
Continuous Distribution(
Column( :Prime )
),
Continuous Distribution(
Column( :Delta )
),
Continuous Distribution(
Column( :DeltaDelta )
)
);
Code Explanation:
- Open table.
- Create distribution analysis.
- Analyze Prime column.
- Analyze Delta column.
- Analyze DeltaDelta column.
Example 38
Summary: Opens a data table, creates a distribution analysis with a continuous distribution, and adds a normal quantile plot for the 'Hours between Burnouts' column.
Code:
// Distribution
// Open data table
dt = Open("data_table.jmp");
// Distribution
Distribution(
Continuous Distribution(
Column( :Hours between Burnouts ),
Normal Quantile Plot( 1 )
)
);
Code Explanation:
- Open data table.
- Create distribution analysis.
- Select continuous distribution.
- Specify column for analysis.
- Add normal quantile plot.
Example 39
Summary: This JSL script customizes an analysis by defining columns, limits, and target values, then generates a report with capability indices for each column.
Code:
// Customized Analysis
// Open data table
dt = Open("data_table.jmp");
// Customized Analysis
Names Default To Here( 1 );
col = {:ph, :Specific gravity,
:"Temperature, degrees C"n,
:"Sediment, ppb"n, :Alcohol};
lsl = [5.1, 1.001, 2, 85, 4.2];
target = [5.25, 1.002, 4, 102, 4.25];
usl = [5.35, 1.003, 6, 115, 4.3];
i = 1;
dist =
Distribution(
Y( Eval( col ) ),
Quantiles( 0 ),
Moments( 0 ),
Capability Analysis(
LSL( lsl[i] ),
USL( usl[i] ),
Target( target[i++] )
)
);
rpt = dist << Report;
For( i = 1, i <= N Items( col ), i++,
name = col[i] << Get Name;
cp = rpt[Outline Box( name )][
Column Box( "Index" )] << Get( 1 );
If( cp > 1,
rpt[Outline Box( name )] << Close
);
);
Names Default To Here( 0 );
Code Explanation:
- Open data table.
- Set default names scope.
- Define columns for analysis.
- Define lower specification limits.
- Define target values.
- Define upper specification limits.
- Initialize index variable.
- Create distribution analysis.
- Extract report from analysis.
- Iterate through columns.
- Check capability index.
- Close outline box if CP > 1.
- Reset default names scope.
Example 40
Summary: Generates a distribution analysis of Tip Percentage by Server, using the Stack and Continuous Distribution functions to visualize the data.
Code:
// Distribution: Tip % by Server
// Open data table
dt = Open("data_table.jmp");
// Distribution: Tip % by Server
Distribution(
Stack( 1 ),
Continuous Distribution(
Column( :Tip Percentage ),
Horizontal Layout( 1 ),
Vertical( 0 )
),
By( :Server )
);
Code Explanation:
- Open data table.
- Create distribution analysis.
- Stack columns vertically.
- Analyze continuous distribution.
- Select Tip Percentage column.
- Arrange layout horizontally.
- Disable vertical layout.
- Group by Server.
Example 41
Summary: Opens a data table, creates a distribution analysis, and visualizes the Ether variable across 1-Octanol, Carbon Tetrachloride, Benzene, Hexane, and Chloroform.
Code:
// Distribution
// Open data table
dt = Open("data_table.jmp");
// Distribution
Distribution(
Y(
:Ether, :"1-Octanol"n,
:Carbon Tetrachloride, :Benzene,
:Hexane, :Chloroform
)
);
Code Explanation:
- Open data table.
- Create distribution analysis.
- Analyze Ether variable.
- Analyze 1-Octanol variable.
- Analyze Carbon Tetrachloride variable.
- Analyze Benzene variable.
- Analyze Hexane variable.
- Analyze Chloroform variable.
Example 42
Summary: Visualizes the distribution of age and sex using a mosaic plot and histogram, providing an interactive analysis platform for exploring these variables.
Code:
// Distribution: Age and Sex
// Open data table
dt = Open("data_table.jmp");
// Distribution: Age and Sex
Distribution(
Nominal Distribution(
Column( :age ),
Mosaic Plot( 1 ),
Histogram( 1 )
),
Nominal Distribution(
Column( :sex ),
Mosaic Plot( 1 ),
Histogram( 1 )
)
);
Code Explanation:
- Open data table;
- Create Distribution platform.
- Analyze age column.
- Generate mosaic plot.
- Generate histogram.
- Analyze sex column.
- Generate mosaic plot.
- Generate histogram.
Example 43
Summary: Visualizes the distribution of height and weight data using a continuous distribution analysis, with customizable axis settings for both variables.
Code:
// Distribution: Height and Weight
// Open data table
dt = Open("data_table.jmp");
// Distribution: Height and Weight
Distribution(
Continuous Distribution(
Column( :height ),
Axis Settings(
Min( 50 ),
Max( 72.5 ),
Scale( Linear ),
Inc( 5 ),
Minor Ticks( 1 )
)
),
Continuous Distribution(
Column( :weight ),
Axis Settings(
Min( 50 ),
Max( 200 ),
Scale( Linear ),
Inc( 10 )
)
)
);
Code Explanation:
- Open table.
- Create distribution analysis.
- Add height column.
- Set axis minimum.
- Set axis maximum.
- Use linear scale.
- Set major tick increment.
- Add minor ticks.
- Add weight column.
- Set axis minimum.
- Set axis maximum.
- Use linear scale.
- Set major tick increment.
Example 44
Summary: Opens a data table and performs a distribution analysis on various nominal and continuous variables, including Lot Acceptance, API Particle Size, Mill Time, and more.
Code:
// Distribution
// Open data table
dt = Open("data_table.jmp");
// Distribution
Distribution(
Nominal Distribution(
Column( :Lot Acceptance )
),
Nominal Distribution(
Column( :API Particle Size )
),
Continuous Distribution(
Column( :Mill Time )
),
Nominal Distribution(
Column( :Screen Size )
),
Nominal Distribution(
Column( :Mag. Stearate Supplier )
),
Nominal Distribution(
Column( :Lactose Supplier )
),
Nominal Distribution(
Column( :Sugar Supplier )
),
Nominal Distribution(
Column( :Talc Supplier )
),
Continuous Distribution(
Column( :Blend Time )
),
Continuous Distribution(
Column( :Blend Speed )
),
Nominal Distribution(
Column( :Compressor )
),
Continuous Distribution(
Column( :Force )
),
Nominal Distribution(
Column( :Coating Supplier )
),
Continuous Distribution(
Column( :Coating Viscosity )
),
Continuous Distribution(
Column( :Inlet Temp )
),
Continuous Distribution(
Column( :Exhaust Temp )
),
Continuous Distribution(
Column( :Spray Rate )
),
Continuous Distribution(
Column( :Atomizer Pressure )
)
);
Code Explanation:
- Open data table.
- Create distribution analysis.
- Analyze Lot Acceptance (nominal).
- Analyze API Particle Size (nominal).
- Analyze Mill Time (continuous).
- Analyze Screen Size (nominal).
- Analyze Mag. Stearate Supplier (nominal).
- Analyze Lactose Supplier (nominal).
- Analyze Sugar Supplier (nominal).
- Analyze Talc Supplier (nominal).
Example 45
Summary: Opens a data table, creates a distribution analysis with stacked columns, weighted by population, and grouped by region, displaying the results.
Code:
// Distribution
// Open data table
dt = Open("data_table.jmp");
// Distribution
Distribution(
Stack( 1 ),
Weight( :Population ),
Nominal Distribution(
Column( :Year ),
Horizontal Layout( 1 ),
Vertical( 0 )
),
By( :Region )
);
Code Explanation:
- Open table.
- Create distribution analysis.
- Stack columns.
- Apply weight.
- Analyze nominal data.
- Specify column.
- Set horizontal layout.
- Disable vertical layout.
- Group by region.
- Display results.
Example 46
Summary: Opens a data table, creates a distribution analysis for the 'weight' column, and visualizes the results using the EMS method.
Code:
// Distribution
// Open data table
dt = Open("data_table.jmp");
// Distribution
Distribution(
Continuous Distribution(
Column( :weight )
)
);
Code Explanation:
- Open table.
- Create distribution analysis.
- Analyze weight column.
Example 47
Summary: Opens a data table, creates a distribution analysis with continuous and nominal variables, and selects specific columns for further analysis.
Code:
// Distribution
// Open data table
dt = Open("data_table.jmp");
// Distribution
Distribution(
Continuous Distribution(
Column( :"weight (lb.)"n )
),
Nominal Distribution(
Column( :age )
)
);
Code Explanation:
- Open data table.
- Create distribution analysis.
- Analyze continuous variable.
- Select "weight (lb.)" column.
- Analyze nominal variable.
- Select "age" column.
Example 48
Summary: Opens a data table, creates a distribution analysis for GDP per Capita, and sends the report to a JMP document with customized settings for the outlier box and histogram frame size.
Code:
// Distribution: GDP per Capita
// Open data table
dt = Open("data_table.jmp");
// Distribution: GDP per Capita
Distribution(
Continuous Distribution(
Column( :GDP per Capita ),
Vertical( 0 )
),
SendToReport(
Dispatch( {"GDP per Capita"},
"Distrib Outlier Box",
FrameBox,
{Frame Size( 208, 76 ),
Marker Size( 2 ),
DispatchSeg(
Marker Seg( 1 ),
label offset(
{5, -68, -27},
{6, -29, 38},
{7, 17, 29},
{8, -72, -26}
)
)}
),
Dispatch( {"GDP per Capita"},
"Distrib Histogram", FrameBox,
{Frame Size( 208, 82 )}
)
)
);
Code Explanation:
- Open table.
- Create distribution analysis.
- Set column for analysis.
- Adjust vertical axis.
- Send report settings.
- Configure outlier box.
- Set frame size.
- Adjust marker size.
- Label outlier markers.
- Configure histogram frame size.
Example 49
Summary: Fits a linear model using the EMS method with interactions and random effects, utilizing the Distribution platform to analyze data from a sample dataset.
Code:
// Distribution
Distribution(
Stack( 1 ),
Nominal Distribution(
Column( :Name ),
Horizontal Layout( 1 ),
Vertical( 0 )
)
);
Code Explanation:
- Open distribution platform.
- Stack data vertically.
- Select nominal distribution analysis.
- Specify column for analysis.
- Arrange layout horizontally.
- Disable vertical arrangement.
Example 50
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing Wafer, Lot, P1, P2, and P3 columns in the provided data table.
Code:
// Distribution
Distribution(
Nominal Distribution(
Column( :Wafer )
),
Nominal Distribution(
Column( :Lot )
),
Continuous Distribution(
Column( :P1 )
),
Continuous Distribution(
Column( :P2 )
),
Nominal Distribution(
Column( :P3 )
)
);
Code Explanation:
- Create distribution analysis.
- Analyze Wafer column.
- Analyze Lot column.
- Analyze P1 column.
- Analyze P2 column.
- Analyze P3 column.
Example 51
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing five distributions (Color Rating, Thickness, Ln, an, and b*n) from a data table.
Code:
// Distribution for Five Responses
Distribution(
Nominal Distribution(
Column( :Color Rating )
),
Continuous Distribution(
Column( :Thickness )
),
Continuous Distribution(
Column( :"L*"n )
),
Continuous Distribution(
Column( :"a*"n )
),
Continuous Distribution(
Column( :"b*"n )
)
);
Code Explanation:
- Open Distribution platform.
- Analyze Color Rating distribution.
- Analyze Thickness distribution.
- Analyze L*n distribution.
- Analyze a*n distribution.
- Analyze b*n distribution.
Example 52
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing the 'Expert Rating' column in a stacked distribution.
Code:
// Distribution
Distribution(
Stack( 1 ),
Nominal Distribution(
Column( :Expert Rating ),
Horizontal Layout( 1 ),
Vertical( 0 )
),
SendToReport(
Dispatch(
{"Expert Rating"}, "",
NomAxisBox,
Rotated Tick Labels(
1
)
)
)
);
Code Explanation:
- Open Distribution platform.
- Stack data by column 1.
- Analyze Nominal Distribution.
- Select "Expert Rating" column.
- Set horizontal layout to 1.
- Disable vertical layout.
- Send report to window.
- Dispatch to "Expert Rating".
- Access NomAxisBox.
- Rotate tick labels on.
Example 53
Summary: Visualizes the distribution of TermGPA using a histogram, sending report settings to frame a specific size.
Code:
// Distribution of TermGPA
Distribution(
Stack( 0 ),
Continuous Distribution(
Column( :TermGPA )
),
Histograms Only,
SendToReport(
Dispatch( {"TermGPA"},
"Distrib Histogram",
FrameBox,
{
Frame Size( 112, 462 )
}
)
)
);
Code Explanation:
- Generate distribution analysis.
- Stack data vertically.
- Analyze continuous data.
- Select column TermGPA.
- Display histograms only.
- Send report settings.
- Adjust histogram frame.
- Set frame size width.
- Set frame size height.
- Complete analysis.
Example 54
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing two columns (MFI and CI) from a data table.
Code:
// Distribution
Distribution(
Stack( 1 ),
Continuous Distribution(
Column( :MFI ),
Quantiles( 0 ),
Summary Statistics( 0 ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Capability Analysis(
USL( 198 )
)
),
Continuous Distribution(
Column( :CI ),
Quantiles( 0 ),
Summary Statistics( 0 ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Capability Analysis(
LSL( 80 )
)
)
);
Code Explanation:
- Open distribution platform.
- Stack data vertically.
- Analyze MFI column.
- Disable quantiles display.
- Disable summary statistics.
- Set horizontal layout.
- Disable vertical layout.
- Perform capability analysis.
- Set USL to 198.
- Analyze CI column.
- Disable quantiles display.
- Disable summary statistics.
- Set horizontal layout.
- Disable vertical layout.
- Perform capability analysis.
- Set LSL to 80.
Example 55
Summary: Visualizes the distribution of '% Response' column using a normal quantile plot and fits a normal distribution to the data, enabling goodness-of-fit testing.
Code:
// Distribution
Distribution(
Continuous Distribution(
Column( :"% Response"n ),
Normal Quantile Plot( 1 ),
Fit Distribution(
Normal(
Goodness of Fit(
1
)
)
)
),
SendToReport(
Dispatch( {"% Response"},
"Quantiles",
OutlineBox,
Close( 1 )
)
)
);
Code Explanation:
- Open distribution analysis.
- Select continuous distribution.
- Analyze "% Response" column.
- Generate normal quantile plot.
- Fit normal distribution.
- Enable goodness of fit test.
- Close quantiles outline box.
Example 56
Summary: Fits a linear model using the EMS method with interactions and random effects to analyze the relationship between 'weight' (continuous) and 'age' (nominal) in the provided data table.
Code:
// Distribution
Distribution(
Continuous Distribution(
Column( :weight )
),
Nominal Distribution(
Column( :age )
)
);
Code Explanation:
- Open Distribution platform.
- Select Continuous Distribution.
- Analyze 'weight' column.
- Select Nominal Distribution.
- Analyze 'age' column.
Example 57
Summary: Generates a nominal distribution report for the 'height' column, sending it to a window with a custom background color.
Code:
// Frequencies on Height
Distribution(
Nominal Distribution(
Column( :height )
),
SendToReport(
Dispatch( {"height"},
"Distrib Nom Hist",
FrameBox,
Background Color( 2 )
)
)
);
Code Explanation:
- Open distribution platform.
- Set analysis type to nominal.
- Select column :height.
- Send report to window.
- Dispatch to "height" report.
- Locate "Distrib Nom Hist".
- Access FrameBox properties.
- Set background color to 2.
Example 58
Summary: Fits a linear model using the EMS method with interactions and random effects to analyze the age column in a continuous distribution, providing an interactive platform for exploring relationships.
Code:
// Distribution
Distribution(
Continuous Distribution(
Column( :age )
)
);
Code Explanation:
- Open distribution platform.
- Select continuous distribution.
- Analyze age column.
Example 59
Summary: Generates a distribution analysis of Avg. Desirability, Hardware Discount, Call Display, Text Messaging, and Multimedia using the EMS method with interactions and random effects.
Code:
// Distribution
Distribution(
Continuous Distribution(
Column(
:Avg. Desirability
),
PpK Capability Labeling(
61
)
),
Nominal Distribution(
Column(
:Hardware Discount
)
),
Nominal Distribution(
Column( :Call Display )
),
Nominal Distribution(
Column( :Text Messaging )
),
Nominal Distribution(
Column( :Multimedia )
),
SendToReport(
Dispatch(
{
"Avg. Desirability Rank"
}, "Quantiles",
OutlineBox,
Close( 1 )
)
)
);
Code Explanation:
- Create distribution analysis.
- Analyze Avg. Desirability.
- Set PpK capability to 61.
- Analyze Hardware Discount.
- Analyze Call Display.
- Analyze Text Messaging.
- Analyze Multimedia.
- Close Quantiles outline.
Example 60
Summary: Fits a linear model using the EMS method with interactions and random effects, sending the report to output and dispatching it to Quantiles outline.
Code:
// Distribution
Distribution(
Continuous Distribution(
Column(
:
Avg. Desirability Rank
)
),
SendToReport(
Dispatch(
{
"Avg. Desirability Rank"
}, "Quantiles",
OutlineBox,
Close( 1 )
)
)
);
Code Explanation:
- Open Distribution platform.
- Select continuous distribution option.
- Specify column for analysis.
- Send report to output.
- Dispatch to Quantiles outline.
- Close Quantiles outline box.
Example 61
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing the :Correct? column in the Split Plot data table.
Code:
// Distribution
Distribution(
Stack( 1 ),
Nominal Distribution(
Column( :Correct? ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Test Probabilities(
Test( Hypothesized ),
0.3,
0.7,
f
),
Confidence Interval(
0.95
)
)
);
Code Explanation:
- Open Distribution platform.
- Use Stack option.
- Select Nominal Distribution.
- Analyze :Correct? column.
- Set Horizontal Layout.
- Disable Vertical display.
- Conduct Test Probabilities.
- Use Hypothesized test.
- Set probabilities to 0.3, 0.7.
- Calculate 95% Confidence Interval.
Example 62
Summary: Opens a distribution platform, analyzes continuous and nominal data, and generates reports with histograms, outlier boxes, and frequencies using the EMS method.
Code:
// Distribution
Distribution(
Stack( 1 ),
Continuous Distribution(
Column(
:Unemployment Rate
),
Horizontal Layout( 1 ),
Vertical( 0 ),
PpK Capability Labeling(
61
)
),
Nominal Distribution(
Column( :Date ),
Horizontal Layout( 1 ),
Vertical( 0 )
),
SendToReport(
Dispatch(
{"Unemployment Rate"},
"Distrib Outlier Box",
FrameBox,
{Frame Size( 403, 36 )
}
),
Dispatch(
{"Unemployment Rate"},
"Distrib Histogram",
FrameBox,
{
Frame Size( 403, 192 )
}
),
Dispatch( {"Date"},
"Distrib Nom Hist",
FrameBox,
{
Frame Size( 388, 183 )
}
),
Dispatch( {"Date"},
"Frequencies",
OutlineBox,
{Close( 1 )}
)
)
);
Code Explanation:
- Open distribution platform.
- Stack columns vertically.
- Analyze continuous data.
- Select unemployment rate column.
- Set horizontal layout.
- Disable vertical layout.
- Enable PpK capability labeling.
- Set PpK target value.
- Analyze nominal data.
- Select date column.
- Set horizontal layout.
- Disable vertical layout.
- Adjust outlier box size.
- Adjust histogram size.
- Adjust date histogram size.
- Close frequencies outline.
Example 63
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing the relationship between 'Churn Flag' and other variables in a data table.
Code:
// Distribution - Churn
Distribution(
Nominal Distribution(
Column( :Churn Flag )
)
);
Code Explanation:
- Open JMP software.
- Access Distribution platform.
- Select Nominal Distribution option.
- Choose "Churn Flag" column.
Example 64
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing the 'Prob[Yes]' column from the 'Split Plot' data table.
Code:
// Distribution of Prob[Yes]
Distribution(
Stack( 1 ),
Continuous Distribution(
Column( :"Prob[Yes]"n ),
Horizontal Layout( 1 ),
Vertical( 0 )
)
);
Code Explanation:
- Create distribution analysis.
- Stack data vertically.
- Use continuous distribution.
- Analyze "Prob[Yes]" column.
- Arrange horizontally.
- Display vertically.
Example 65
Summary: Generates a distribution analysis with stacked plots, analyzing the 'Offer Accepted?' column and displaying horizontal layouts for 'Most Likely Offer Accepted?', 'Cutoff Prob(Yes) = 0.20', and 'Cutoff Prob(Yes) = 0.15' columns.
Code:
// Distribution Cutoffs
Distribution(
Stack( 0 ),
Nominal Distribution(
Column( :Offer Accepted? ),
Horizontal Layout( 0 )
),
Nominal Distribution(
Column(
:
Most Likely Offer Accepted?
),
Horizontal Layout( 0 )
),
Nominal Distribution(
Column(
:
"Cutoff Prob(Yes) = 0.20"n
),
Horizontal Layout( 0 )
),
Nominal Distribution(
Column(
:
"Cutoff Prob(Yes) = 0.15"n
),
Horizontal Layout( 0 )
),
Nominal Distribution(
Column(
:
"Cutoff Prob(Yes) = 0.10"n
),
Horizontal Layout( 0 )
)
);
Code Explanation:
- Create distribution analysis.
- Stack plots vertically.
- Analyze 'Offer Accepted?' column.
- Use horizontal layout.
- Analyze 'Most Likely Offer Accepted?' column.
- Use horizontal layout.
- Analyze 'Cutoff Prob(Yes) = 0.20' column.
- Use horizontal layout.
- Analyze 'Cutoff Prob(Yes) = 0.15' column.
- Use horizontal layout.
Example 66
Summary: This script fits a linear model using the EMS method with interactions and random effects, analyzing the 'Responses' and 'Response Rate' columns while applying PpK labeling with 61.
Code:
// Distribution
Distribution(
Continuous Distribution(
Column( :Responses ),
PpK Capability Labeling(
61
)
),
Continuous Distribution(
Column( :Response Rate ),
PpK Capability Labeling(
61
)
),
SendToReport(
Dispatch( {"Responses"},
"Quantiles",
OutlineBox,
Close( 1 )
),
Dispatch(
{"Response Rate"},
"Quantiles",
OutlineBox,
Close( 1 )
)
)
);
Code Explanation:
- Create distribution analysis.
- Analyze Responses column.
- Apply PpK labeling with 61.
- Analyze Response Rate column.
- Apply PpK labeling with 61.
- Access report for Responses.
- Close Quantiles outline box.
- Access report for Response Rate.
- Close Quantiles outline box.
Example 67
Summary: Creates a Distribution analysis with multiple variables, including continuous and nominal distributions, to visualize the relationships between Price, Carat Size, Color, Clarity, Depth, Table, and Cut.
Code:
// Distribution
Distribution(
Continuous Distribution(
Column( :Price ),
Horizontal Layout( 0 )
),
Continuous Distribution(
Column( :Carat Size ),
Horizontal Layout( 0 )
),
Nominal Distribution(
Column( :Color ),
Horizontal Layout( 0 )
),
Nominal Distribution(
Column( :Clarity ),
Horizontal Layout( 0 )
),
Continuous Distribution(
Column( :Depth ),
Horizontal Layout( 0 )
),
Continuous Distribution(
Column( :Table ),
Horizontal Layout( 0 )
),
Nominal Distribution(
Column( :Cut ),
Horizontal Layout( 0 )
)
);
Code Explanation:
- Create Distribution analysis.
- Add Price column distribution.
- Set horizontal layout for Price.
- Add Carat Size column distribution.
- Set horizontal layout for Carat Size.
- Add Color column distribution.
- Set horizontal layout for Color.
- Add Clarity column distribution.
- Set horizontal layout for Clarity.
- Add Depth column distribution.
- Set horizontal layout for Depth.
- Add Table column distribution.
- Set horizontal layout for Table.
- Add Cut column distribution.
- Set horizontal layout for Cut.
Example 68
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing multiple columns (Responses, Annual Fee, Opening Fee, initial interest, long term interest) from a data table.
Code:
// Distribution
Distribution(
Continuous Distribution(
Column( :Responses ),
PpK Capability Labeling(
61
)
),
Nominal Distribution(
Column( :Annual Fee )
),
Nominal Distribution(
Column( :Opening Fee )
),
Nominal Distribution(
Column(
:initial interest
)
),
Nominal Distribution(
Column(
:long term interest
)
),
SendToReport(
Dispatch( {"Responses"},
"Quantiles",
OutlineBox,
Close( 1 )
)
)
);
Code Explanation:
- Open Distribution platform.
- Analyze Responses column.
- Enable PpK labeling with value 61.
- Analyze Annual Fee column.
- Analyze Opening Fee column.
- Analyze initial interest column.
- Analyze long term interest column.
- Close Quantiles outline for Responses.
- Display report.
Example 69
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing the 'Gift?' column in the provided data table.
Code:
// Distribution - Gift?
Distribution(
Nominal Distribution(
Column( :Gift? )
)
);
Code Explanation:
- Create distribution analysis.
- Use nominal distribution type.
- Analyze column "Gift?".
Example 70
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing the relationships between Vendor, Product, and Cycle Times.
Code:
// Distribution
Distribution(
Nominal Distribution(
Column( :Vendor )
),
Nominal Distribution(
Column( :Product )
),
Continuous Distribution(
Column( :Cycle Times )
)
);
Code Explanation:
- Launch Distribution platform.
- Analyze Vendor column.
- Analyze Product column.
- Analyze Cycle Times column.
Example 71
Summary: Fits a linear model using the EMS method with interactions and random effects to analyze various continuous and nominal variables in a data table, utilizing automatic recalculation.
Code:
// Default - Distribution
Distribution(
Automatic Recalc( 1 ),
Nominal Distribution(
Column( :DEFAULT )
),
Continuous Distribution(
Column(
:"LOAN(Request)"n
)
),
Continuous Distribution(
Column( :MORTGAGE DUE )
),
Continuous Distribution(
Column(
:"VALUE(inital)"n
)
),
Nominal Distribution(
Column( :"REASON(old)"n )
),
Nominal Distribution(
Column( :"JOB(old)"n )
),
Continuous Distribution(
Column( :YEARS ON JOB )
),
Continuous Distribution(
Column(
:"# DEROGATORY(old)"n
)
),
Continuous Distribution(
Column( :"# DELINQUENT"n )
),
Continuous Distribution(
Column( :CREDIT LINE AGE )
),
Continuous Distribution(
Column( :"# INQUIRY"n )
),
Continuous Distribution(
Column(
:"# CREDIT LINES"n
)
),
Continuous Distribution(
Column( :DEBT TO INCOME )
)
);
Code Explanation:
- Open Distribution platform.
- Enable automatic recalculation.
- Analyze DEFAULT column as nominal.
- Analyze LOAN(Request) column as continuous.
- Analyze MORTGAGE DUE column as continuous.
- Analyze VALUE(inital) column as continuous.
- Analyze REASON(old) column as nominal.
- Analyze JOB(old) column as nominal.
- Analyze YEARS ON JOB column as continuous.
- Analyze # DEROGATORY(old) column as continuous.
- Analyze # DELINQUENT column as continuous.
- Analyze CREDIT LINE AGE column as continuous.
- Analyze # INQUIRY column as continuous.
- Analyze # CREDIT LINES column as continuous.
- Analyze DEBT TO INCOME column as continuous.
Example 72
Summary: Generates a distribution analysis for the 'Arrival Delay' column, stacked by 'Carrier Code', with interactive features such as density axis and histogram visualization.
Code:
// Distribution
Distribution(
Stack( 1 ),
Continuous Distribution(
Column( :Arrival Delay ),
Quantiles( 0 ),
Moments( 0 ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Density Axis( 1 ),
Outlier Box Plot( 0 )
),
by( :Carrier Code ),
SendToReport(
Dispatch(
{"Arrival Delay"}, "1",
ScaleBox,
{Scale( Linear ),
Format(
"Fixed Dec",
0
), Min( -40 ),
Max( 220 ), Inc( 100 ),
Minor Ticks( 4 )}
),
Dispatch(
{"Arrival Delay"},
"Distrib Histogram",
FrameBox,
{
Frame Size( 647, 370 ),
DispatchSeg(
Hist Seg( 1 ),
{
Fill Color(
"Medium Dark Blue"
),
Histogram Color(
21
)}
)}
)
)
);
Code Explanation:
- Create distribution analysis.
- Stack data vertically.
- Analyze continuous distribution.
- Select column "Arrival Delay".
- Disable quantiles calculation.
- Disable moments calculation.
- Set horizontal layout.
- Disable vertical display.
- Enable density axis.
- Disable outlier box plot.
Example 73
Summary: Generates distribution analysis for three columns (Drive Voltage, T50 @ 80mA, and Avg Thickness) using the EMS method, with interactions and random effects. The script then dispatches the results to a report.
Code:
// Distribution
Distribution(
Continuous Distribution(
Column( :Drive Voltage )
),
Continuous Distribution(
Column( :"T50 @ 80mA"n )
),
Continuous Distribution(
Column( :Avg Thickness )
),
SendToReport(
Dispatch(
{"Drive Voltage"},
"Quantiles",
OutlineBox,
Close( 1 )
),
Dispatch( {"T50 @ 80mA"},
"Quantiles",
OutlineBox,
Close( 1 )
),
Dispatch(
{"Avg Thickness"},
"Quantiles",
OutlineBox,
Close( 1 )
)
)
);
Code Explanation:
- Generate distribution analysis.
- Analyze Drive Voltage column.
- Analyze T50 @ 80mA column.
- Analyze Avg Thickness column.
- Close Quantiles outline for Drive Voltage.
- Close Quantiles outline for T50 @ 80mA.
- Close Quantiles outline for Avg Thickness.
Example 74
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing continuous distribution of 'Amount' column in the provided data table.
Code:
// Distribution Amount
Distribution(
Stack( 1 ),
Continuous Distribution(
Column( :Amount ),
Horizontal Layout( 1 ),
Vertical( 0 ),
PpK Capability Labeling(
61
)
)
);
Code Explanation:
- Open distribution platform.
- Stack data horizontally.
- Analyze continuous distribution.
- Select column "Amount".
- Arrange layout horizontally.
- Disable vertical layout.
- Enable PpK capability labeling.
- Set PpK target to 61.
Example 75
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing continuous distribution of :Age column in the Split Plot data table.
Code:
// Distribution Age
Distribution(
Stack( 1 ),
Continuous Distribution(
Column( :Age ),
Horizontal Layout( 1 ),
Vertical( 0 ),
PpK Capability Labeling(
61
)
)
);
Code Explanation:
- Open distribution analysis.
- Stack data horizontally.
- Analyze continuous distribution.
- Select column :Age.
- Set horizontal layout.
- Disable vertical layout.
- Enable PpK capability labeling.
- Set PpK target value 61.
Example 76
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing the distribution of Gender while applying a nominal distribution and horizontal layout.
Code:
// Distribution Gender
Distribution(
Stack( 1 ),
Nominal Distribution(
Column( :Gender ),
Horizontal Layout( 1 ),
Vertical( 0 )
)
);
Code Explanation:
- Create distribution analysis.
- Use stack option 1.
- Apply nominal distribution.
- Analyze column Gender.
- Set horizontal layout 1.
- Disable vertical layout.
Example 77
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing columns Crust, Cheese, Topping, Profile Name, and Subject from a data table.
Code:
// Distribution
Distribution(
Automatic Recalc( 1 ),
Nominal Distribution(
Column( :Crust )
),
Nominal Distribution(
Column( :Cheese )
),
Nominal Distribution(
Column( :Topping )
),
Nominal Distribution(
Column( :Profile Name )
),
Nominal Distribution(
Column( :Subject )
)
);
Code Explanation:
- Launch Distribution platform.
- Enable automatic recalculation.
- Analyze Crust column.
- Analyze Cheese column.
- Analyze Topping column.
- Analyze Profile Name column.
- Analyze Subject column.
Example 78
Summary: Generates distribution analysis for three columns (Thickness, RUN #, and MN ckt wx) with normal quantile plots and histograms, customizing background colors in the report.
Code:
// Distribution
Distribution(
Continuous Distribution(
Column( :Thickness ),
Normal Quantile Plot( 1 )
),
Nominal Distribution(
Column( :RUN # )
),
Continuous Distribution(
Column( :MN ckt wx ),
Normal Quantile Plot( 1 )
),
SendToReport(
Dispatch( {"Thickness"},
"Distrib Histogram",
FrameBox,
Background Color( 2 )
),
Dispatch( {"RUN #"},
"Distrib Nom Hist",
FrameBox,
Background Color( 2 )
),
Dispatch( {"MN ckt wx"},
"Distrib Histogram",
FrameBox,
Background Color( 2 )
)
)
);
Code Explanation:
- Create distribution analysis.
- Analyze Thickness column.
- Generate normal quantile plot.
- Analyze RUN # column.
- Analyze MN ckt wx column.
- Generate normal quantile plot.
- Change Thickness histogram background.
- Change RUN # histogram background.
- Change MN ckt wx histogram background.
- Finalize report settings.
Example 79
Summary: Fits a linear model using the EMS method with interactions and random effects to analyze various columns in a data table, including SALES, MARGIN, traffic_band, week_ending_dt, and more.
Code:
// View 1: JMP - Outputs Distribution
Distribution(
Continuous Distribution(
Column( :SALES )
),
Continuous Distribution(
Column( :MARGIN )
),
Continuous Distribution(
Column( :traffic_band )
),
Continuous Distribution(
Column( :week_ending_dt )
),
Nominal Distribution(
Column(
:ty_corp__vol__grp_
)
),
Nominal Distribution(
Column( :region_name )
),
Continuous Distribution(
Column( :region_number )
),
Nominal Distribution(
Column( :district_name )
),
Continuous Distribution(
Column( :district_number )
),
Continuous Distribution(
Column( :store_number )
),
Nominal Distribution(
Column( :city )
),
Nominal Distribution(
Column( :state )
),
Continuous Distribution(
Column( :store_post_code )
)
);
Code Explanation:
- Create Distribution analysis.
- Analyze SALES column.
- Analyze MARGIN column.
- Analyze traffic_band column.
- Analyze week_ending_dt column.
- Analyze ty_corp__vol__grp_ column.
- Analyze region_name column.
- Analyze region_number column.
- Analyze district_name column.
- Analyze district_number column.
- Analyze store_number column.
- Analyze city column.
- Analyze state column.
- Analyze store_post_code column.
Example 80
Summary: Opens a data table, fits a linear model using the EMS method with interactions and random effects, and visualizes the results.
Code:
// Distribution
Distribution(
Stack( 1 ),
Nominal Distribution(
Column( :Survived ),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Nominal Distribution(
Column( :Passenger Class ),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Nominal Distribution(
Column( :Sex ),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Continuous Distribution(
Column( :Age ),
Horizontal Layout( 1 ),
Vertical( 0 ),
PpK Capability Labeling(
61
)
),
Continuous Distribution(
Column(
:Siblings and Spouses
),
Horizontal Layout( 1 ),
Vertical( 0 ),
PpK Capability Labeling(
61
)
),
Continuous Distribution(
Column(
:Parents and Children
),
Horizontal Layout( 1 ),
Vertical( 0 ),
PpK Capability Labeling(
61
)
)
);
Code Explanation:
- Open Distribution platform.
- Stack data vertically.
- Analyze "Survived" column.
- Use horizontal layout.
- Disable vertical layout.
- Analyze "Passenger Class" column.
- Use horizontal layout.
- Disable vertical layout.
- Analyze "Sex" column.
- Use horizontal layout.
- Disable vertical layout.
- Analyze "Age" column.
- Use horizontal layout.
- Disable vertical layout.
- Add PpK capability labeling.
- Set PpK value to 61.
- Analyze "Siblings and Spouses" column.
- Use horizontal layout.
- Disable vertical layout.
- Add PpK capability labeling.
- Set PpK value to 61.
- Analyze "Parents and Children" column.
- Use horizontal layout.
- Disable vertical layout.
- Add PpK capability labeling.
- Set PpK value to 61.
Example 81
Summary: Opens a data table, then uses the EMS method to fit a linear model with interactions and random effects, analyzing columns Q1_A, 'Opposed', 'Group or Individual?', Age, and Gender 2.
Code:
// Distribution
Distribution(
Stack( 0 ),
Nominal Distribution(
Column( :Q1_A ),
Horizontal Layout( 0 )
),
Nominal Distribution(
Column(
:
"Opposed (Yes=1, No=0)"n
),
Horizontal Layout( 0 )
),
Nominal Distribution(
Column(
:Group or Individual?
),
Horizontal Layout( 0 )
),
Nominal Distribution(
Column( :Age ),
Horizontal Layout( 0 )
),
Nominal Distribution(
Column( :Gender 2 ),
Horizontal Layout( 0 )
)
);
Code Explanation:
- Open Distribution platform.
- Stack plots vertically.
- Analyze Q1_A column.
- Use horizontal layout.
- Analyze "Opposed" column.
- Use horizontal layout.
- Analyze "Group or Individual?" column.
- Use horizontal layout.
- Analyze Age column.
- Use horizontal layout.
Example 82
Summary: Opens a data table, sets up a distribution platform with nominal and continuous variables, and prepares the data for analysis using the EMS method.
Code:
// Distribution
Distribution(
Stack( 1 ),
Nominal Distribution(
Column( :Region ),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Continuous Distribution(
Column(
:Household Income
),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Continuous Distribution(
Column(
:Gross State Product
),
Horizontal Layout( 1 ),
Vertical( 0 )
)
);
Code Explanation:
- Open distribution platform.
- Stack data vertically.
- Analyze nominal variable Region.
- Set horizontal layout for Region.
- Disable vertical layout for Region.
- Analyze continuous variable Household Income.
- Set horizontal layout for Household Income.
- Disable vertical layout for Household Income.
- Analyze continuous variable Gross State Product.
- Set horizontal layout for Gross State Product.
- Disable vertical layout for Gross State Product.
Example 83
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing multiple columns from a data table.
Code:
// Distribution
Distribution(
Continuous Distribution(
Column( :Quality )
),
Continuous Distribution(
Column( :fixed acidity )
),
Continuous Distribution(
Column( :volatile acidity )
),
Continuous Distribution(
Column( :citric acid )
),
Continuous Distribution(
Column( :residual sugar )
),
Continuous Distribution(
Column( :chlorides )
),
Continuous Distribution(
Column( :free sulfur dioxide )
),
Continuous Distribution(
Column( :total sulfur dioxide )
),
Continuous Distribution(
Column( :density )
),
Continuous Distribution(
Column( :pH )
),
Continuous Distribution(
Column( :sulphates )
),
Continuous Distribution(
Column( :alcohol )
)
);
Code Explanation:
- Open Distribution platform.
- Analyze Quality column.
- Analyze fixed acidity column.
- Analyze volatile acidity column.
- Analyze citric acid column.
- Analyze residual sugar column.
- Analyze chlorides column.
- Analyze free sulfur dioxide column.
- Analyze total sulfur dioxide column.
- Analyze density column.
- Analyze pH column.
- Analyze sulphates column.
- Analyze alcohol column.
Example 84
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing various wine quality attributes from a dataset.
Code:
// Distribution
Distribution(
Continuous Distribution(
Column( :fixed acidity )
),
Continuous Distribution(
Column( :volatile acidity )
),
Continuous Distribution(
Column( :citric acid )
),
Continuous Distribution(
Column( :residual sugar )
),
Continuous Distribution(
Column( :chlorides )
),
Continuous Distribution(
Column( :free sulfur dioxide )
),
Continuous Distribution(
Column( :total sulfur dioxide )
),
Continuous Distribution(
Column( :density )
),
Continuous Distribution(
Column( :pH )
),
Continuous Distribution(
Column( :sulphates )
),
Continuous Distribution(
Column( :alcohol )
),
Nominal Distribution(
Column( :Color )
),
Continuous Distribution(
Column( :Quality )
)
);
Code Explanation:
- Open Distribution platform.
- Analyze fixed acidity.
- Analyze volatile acidity.
- Analyze citric acid.
- Analyze residual sugar.
- Analyze chlorides.
- Analyze free sulfur dioxide.
- Analyze total sulfur dioxide.
- Analyze density.
- Analyze pH.
- Analyze sulphates.
- Analyze alcohol.
- Analyze Color.
- Analyze Quality.
Example 85
Summary: Fits a linear model using the EMS method with interactions and random effects to analyze various continuous and nominal variables, including target churn, current bill amount, average calls, account age, and more.
Code:
// Distribution
Distribution(
Nominal Distribution(
Column( :target churn )
),
Continuous Distribution(
Column( :Current Bill Amt )
),
Continuous Distribution(
Column( :Avg Calls )
),
Continuous Distribution(
Column( :Avg Calls Weekdays )
),
Continuous Distribution(
Column( :Account Age )
),
Continuous Distribution(
Column( :Percent Increase MOM )
),
Nominal Distribution(
Column( :Acct Plan Subtype )
),
Nominal Distribution(
Column( :Complaint Code )
),
Continuous Distribution(
Column( :Avg Days Delinquent )
),
Nominal Distribution(
Column(
:Current TechSupComplaints
)
),
Continuous Distribution(
Column(
:Current Days OpenWorkOrders
)
),
Continuous Distribution(
Column( :Equipment Age )
),
Nominal Distribution(
Column(
:Condition of Current Handset
)
),
Continuous Distribution(
Column(
:Avg Hours WorkOrderOpenned
)
),
Nominal Distribution(
Column( :State )
)
);
Code Explanation:
- Create distribution analysis.
- Analyze 'target churn' nominally.
- Analyze 'Current Bill Amt' continuously.
- Analyze 'Avg Calls' continuously.
- Analyze 'Avg Calls Weekdays' continuously.
- Analyze 'Account Age' continuously.
- Analyze 'Percent Increase MOM' continuously.
- Analyze 'Acct Plan Subtype' nominally.
- Analyze 'Complaint Code' nominally.
- Analyze 'Avg Days Delinquent' continuously.
Example 86
Summary: Opens a data table, fits a linear model using the EMS method with interactions and random effects to analyze various continuous and nominal variables.
Code:
// Distribution
Distribution(
Nominal Distribution(
Column( :Activity )
),
Continuous Distribution(
Column( :Smiles Length )
),
Continuous Distribution(
Column( :Charge )
),
Continuous Distribution(
Column( :Andrews Binding E )
),
Continuous Distribution(
Column( :Bioav. Score )
),
Continuous Distribution(
Column( :MW )
),
Continuous Distribution(
Column( :CMR )
),
Continuous Distribution(
Column( :ClogP )
),
Continuous Distribution(
Column( :"logD(ph4.6)"n )
),
Continuous Distribution(
Column( :"logD(ph6.4)"n )
),
Continuous Distribution(
Column( :"logD(7.4)"n )
),
Continuous Distribution(
Column( :pka reliability )
),
Continuous Distribution(
Column( :pka base reliability )
),
Continuous Distribution(
Column( :polar surface area )
),
Continuous Distribution(
Column( :"# rotatable bonds"n )
),
Continuous Distribution(
Column( :sol logM )
),
Continuous Distribution(
Column( :"sol mg/L"n )
),
Continuous Distribution(
Column( :sLogP )
),
Continuous Distribution(
Column( :Clark log )
)
);
Code Explanation:
- Open Distribution platform.
- Analyze nominal data for Activity.
- Analyze continuous data for Smiles Length.
- Analyze continuous data for Charge.
- Analyze continuous data for Andrews Binding E.
- Analyze continuous data for Bioav. Score.
- Analyze continuous data for MW.
- Analyze continuous data for CMR.
- Analyze continuous data for ClogP.
- Analyze continuous data for logD(ph4.6).
Example 87
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing various columns in a data table.
Code:
// Distribution
Distribution(
Nominal Distribution(
Column( :MFI Good? )
),
Nominal Distribution(
Column( :CI Good? )
),
Continuous Distribution(
Column( :SA )
),
Continuous Distribution(
Column( :M% )
),
Continuous Distribution(
Column( :Xf )
),
Nominal Distribution(
Column( :Quarry )
),
Continuous Distribution(
Column( :pH )
),
Continuous Distribution(
Column( :Ambient Temp )
),
Continuous Distribution(
Column( :Viscosity )
),
Nominal Distribution(
Column( :Shift )
)
);
Code Explanation:
- Create Distribution platform.
- Analyze MFI Good? column.
- Analyze CI Good? column.
- Analyze SA column.
- Analyze M% column.
- Analyze Xf column.
- Analyze Quarry column.
- Analyze pH column.
- Analyze Ambient Temp column.
- Analyze Viscosity column.
- Analyze Shift column.
Example 88
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing nominal columns 'Solvent' and 'BASE', and continuous columns 'Conv (24hrs)' to 'BD14', displaying histograms only.
Code:
// Distribution
Distribution(
Nominal Distribution(
Column( :Solvent )
),
Nominal Distribution(
Column( :BASE )
),
Continuous Distribution(
Column( :"Conv (24hrs)"n )
),
Continuous Distribution(
Column( :SD1 )
),
Continuous Distribution(
Column( :SD2 )
),
Continuous Distribution(
Column( :SD3 )
),
Continuous Distribution(
Column( :SD4 )
),
Continuous Distribution(
Column( :SD5 )
),
Continuous Distribution(
Column( :SD6 )
),
Continuous Distribution(
Column( :SD7 )
),
Continuous Distribution(
Column( :SD8 )
),
Continuous Distribution(
Column( :SD9 )
),
Continuous Distribution(
Column( :SD10 )
),
Continuous Distribution(
Column( :SD11 )
),
Continuous Distribution(
Column( :SD12 )
),
Continuous Distribution(
Column( :SD13 )
),
Continuous Distribution(
Column( :SD14 )
),
Continuous Distribution(
Column( :SD15 )
),
Continuous Distribution(
Column( :SD16 )
),
Continuous Distribution(
Column( :SD17 )
),
Continuous Distribution(
Column( :BD1 )
),
Continuous Distribution(
Column( :BD2 )
),
Continuous Distribution(
Column( :BD3 )
),
Continuous Distribution(
Column( :BD4 )
),
Continuous Distribution(
Column( :BD5 )
),
Continuous Distribution(
Column( :BD6 )
),
Continuous Distribution(
Column( :BD7 )
),
Continuous Distribution(
Column( :BD8 )
),
Continuous Distribution(
Column( :BD9 )
),
Continuous Distribution(
Column( :BD10 )
),
Continuous Distribution(
Column( :BD11 )
),
Continuous Distribution(
Column( :BD12 )
),
Continuous Distribution(
Column( :BD13 )
),
Continuous Distribution(
Column( :BD14 )
),
Histograms Only
);
Code Explanation:
- Generate distribution analysis.
- Analyze nominal column "Solvent".
- Analyze nominal column "BASE".
- Analyze continuous column "Conv (24hrs)".
- Analyze continuous column "SD1".
- Analyze continuous column "SD2".
- Analyze continuous column "SD3".
- Analyze continuous column "SD4".
- Analyze continuous column "SD5".
- Display histograms only.
Example 89
Summary: Generates a distribution analysis of various customer attributes, including churn flag, cust id, and continuous variables like average daily balance, interest paid, and more. The script also disables outlier box plots for certain variables and sends the results to a report.
Code:
// Distribution - All
Distribution(
Nominal Distribution(
Column( :Churn Flag )
),
Nominal Distribution(
Column( :cust id )
),
Continuous Distribution(
Column( :Average Daily Balance ),
Outlier Box Plot( 0 )
),
Continuous Distribution(
Column( :Interest Paid ),
Outlier Box Plot( 0 )
),
Continuous Distribution(
Column( :Cash Advances ),
Outlier Box Plot( 0 )
),
Continuous Distribution(
Column( :Balance Transferred ),
Outlier Box Plot( 0 )
),
Nominal Distribution(
Column( :Marital Status )
),
Nominal Distribution(
Column( :Occupation Group )
),
Continuous Distribution(
Column(
:"Age of Account (Months)"n
),
Outlier Box Plot( 0 )
),
Continuous Distribution(
Column( :Age Group ),
Outlier Box Plot( 0 )
),
Nominal Distribution(
Column( :LTV Group )
),
Continuous Distribution(
Column( :Bill Cycle ),
Outlier Box Plot( 0 )
),
Nominal Distribution(
Column( :Customer Type )
),
Nominal Distribution(
Column( :Gender )
),
Continuous Distribution(
Column( :Customer Value ),
Outlier Box Plot( 0 )
),
Continuous Distribution(
Column( :Credit Limit ),
Outlier Box Plot( 0 )
),
SendToReport(
Dispatch( {}, "cust id",
OutlineBox,
{Close( 1 )}
)
)
);
Code Explanation:
- Create distribution analysis.
- Analyze Churn Flag as nominal.
- Analyze cust id as nominal.
- Analyze Average Daily Balance as continuous.
- Disable outlier box plot for Average Daily Balance.
- Analyze Interest Paid as continuous.
- Disable outlier box plot for Interest Paid.
- Analyze Cash Advances as continuous.
- Disable outlier box plot for Cash Advances.
- Analyze Balance Transferred as continuous.
- Disable outlier box plot for Balance Transferred.
- Analyze Marital Status as nominal.
- Analyze Occupation Group as nominal.
- Analyze Age of Account (Months) as continuous.
- Disable outlier box plot for Age of Account (Months).
- Analyze Age Group as continuous.
- Disable outlier box plot for Age Group.
- Analyze LTV Group as nominal.
- Analyze Bill Cycle as continuous.
- Disable outlier box plot for Bill Cycle.
- Analyze Customer Type as nominal.
- Analyze Gender as nominal.
- Analyze Customer Value as continuous.
- Disable outlier box plot for Customer Value.
- Analyze Credit Limit as continuous.
- Disable outlier box plot for Credit Limit.
- Close cust id outline box.
Example 90
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing various variables such as Offer Accepted?, # Homes Owned, Household Size, and more.
Code:
// Distribution
Distribution(
Nominal Distribution(
Column( :Offer Accepted? )
),
Continuous Distribution(
Column( :"# Homes Owned"n )
),
Continuous Distribution(
Column( :Household Size )
),
Nominal Distribution(
Column( :Own Your Home? )
),
Nominal Distribution(
Column( :Income Level )
),
Continuous Distribution(
Column(
:"# Bank Accounts Open"n
)
),
Nominal Distribution(
Column( :Credit Rating )
),
Continuous Distribution(
Column( :"# Credit Cards Held"n )
),
Nominal Distribution(
Column( :Overdraft Protection? )
),
Nominal Distribution(
Column( :Reward )
),
Nominal Distribution(
Column( :Mailer Type )
),
SendToReport(
Dispatch( {"# Homes"},
"Distrib Outlier Box",
FrameBox,
Marker Drawing Mode( Fast )
),
Dispatch( {"Household Size"},
"Distrib Outlier Box",
FrameBox,
Marker Drawing Mode( Fast )
),
Dispatch( {"# Bank Accounts"},
"Distrib Outlier Box",
FrameBox,
Marker Drawing Mode( Fast )
),
Dispatch( {"# Credit Cards"},
"Distrib Outlier Box",
FrameBox,
Marker Drawing Mode( Fast )
)
)
);
Code Explanation:
- Open distribution analysis.
- Analyze "Offer Accepted?" (nominal).
- Analyze "# Homes Owned" (continuous).
- Analyze "Household Size" (continuous).
- Analyze "Own Your Home?" (nominal).
- Analyze "Income Level" (nominal).
- Analyze "# Bank Accounts Open" (continuous).
- Analyze "Credit Rating" (nominal).
- Analyze "# Credit Cards Held" (continuous).
- Analyze "Overdraft Protection?" (nominal).
- Analyze "Reward" (nominal).
- Analyze "Mailer Type" (nominal).
- Adjust outlier box marker drawing mode for specific columns.
Example 91
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing the relationships between Operator, Part, Y, and OpPart columns in a data table.
Code:
// Distribution
Distribution(
Nominal Distribution(
Column( :Operator )
),
Nominal Distribution(
Column( :Part )
),
Continuous Distribution(
Column( :Y )
),
Nominal Distribution(
Column( :OpPart )
)
);
Code Explanation:
- Create Distribution platform.
- Analyze Operator column.
- Analyze Part column.
- Analyze Y column.
- Analyze OpPart column.
Example 92
Summary: Opens a data table, fits a linear model using the EMS method with interactions and random effects, and analyzes various columns including Supplier, Cloth Type, Color, Receive Date, Lot, Roll #, Length, Points Per Roll, and Points Per 100 Yards.
Code:
// Baseline Condition
Distribution(
Nominal Distribution(
Column( :Supplier )
),
Nominal Distribution(
Column( :Cloth Type )
),
Nominal Distribution(
Column( :Color )
),
Nominal Distribution(
Column( :Recieve Date )
),
Nominal Distribution(
Column( :Lot )
),
Nominal Distribution(
Column( :Roll # )
),
Continuous Distribution(
Column( :Length )
),
Continuous Distribution(
Column( :Points Per Roll )
),
Continuous Distribution(
Column( :Points Per 100 Yards )
)
);
Code Explanation:
- Open table.
- Run Distribution analysis.
- Analyze Supplier column.
- Analyze Cloth Type column.
- Analyze Color column.
- Analyze Recieve Date column.
- Analyze Lot column.
- Analyze Roll # column.
- Analyze Length column.
- Analyze Points Per Roll column.
- Analyze Points Per 100 Yards column.
Example 93
Summary: Opens a data table, analyzes multiple columns (Clarity, Cut, Color), and fits a normal distribution to the Carat Weight column. It also generates various plots and displays standard error bars.
Code:
// Expanded Distribution
Distribution(
Nominal Distribution(
Column( :Clarity )
),
Nominal Distribution(
Column( :Cut )
),
Nominal Distribution(
Column( :Color )
),
Continuous Distribution(
Column( :Carat Weight ),
Std Error Bars( 1 ),
Normal Quantile Plot( 1 ),
CDF Plot( 1 ),
Fit Distribution( Normal )
),
SendToReport(
Dispatch(
{"Distributions",
"Carat Weight"},
"Distrib Histogram", FrameBox,
{
DispatchSeg(
Hist Seg( 1 ),
Bin Span( 48, 0 )
)}
),
Dispatch(
{"Distributions",
"Carat Weight"}, "5",
ScaleBox,
{Scale( "Normal" ),
Min( 0.000297287253808995 ),
Max( 0.999702712746191 ),
Inc( 1 ), Minor Ticks( 0 ),
Show Major Grid( 1 )}
)
)
);
Code Explanation:
- Open Distribution platform.
- Analyze Clarity column.
- Analyze Cut column.
- Analyze Color column.
- Analyze Carat Weight column.
- Display standard error bars.
- Create normal quantile plot.
- Generate CDF plot.
- Fit normal distribution.
- Adjust histogram bin span.
- Set normal scale for CDF.
- Define axis limits.
- Show major grid lines.
Example 94
Summary: Fits a Gamma distribution to the Price column, performing capability analysis and customizing histogram labels with Helvetica font style.
Code:
// Distribution with Gamma Fit
Distribution(
Continuous Distribution(
Column( :Price ),
Capability Analysis( 0 ),
Fit Distribution(
Gamma(
Spec Limits(
LSL( 2000 ),
USL( 4000 ),
Target( 3000 )
)
)
)
),
SendToReport(
Dispatch(
{"Distributions", "Price"},
"Distrib Histogram", FrameBox,
{
DispatchSeg(
LabelSeg( 1 ),
{
Font(
"Helvetica", 13,
"Plain"
)}
),
DispatchSeg(
LabelSeg( 2 ),
{
Font(
"Helvetica", 13,
"Plain"
)}
),
DispatchSeg(
LabelSeg( 3 ),
{
Font(
"Helvetica", 13,
"Plain"
)}
)}
)
)
);
Code Explanation:
- Open Distribution platform.
- Analyze continuous data.
- Select Price column.
- Perform capability analysis.
- Fit Gamma distribution.
- Set LSL to 2000.
- Set USL to 4000.
- Set target to 3000.
- Customize histogram labels.
- Apply Helvetica font style.
Example 95
Summary: Generates a distribution platform to analyze the Price column, grouping by Validation and filtering for Training data. It fits a Gamma distribution with specified limits and targets, and displays histograms only.
Code:
// Validation Split
Distribution(
SendToByGroup(
{Format( :Validation ) ==
"Training"}
),
Stack( 1 ),
Continuous Distribution(
Column( :Price ),
Summary Statistics( 1 ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Capability Analysis( 0 ),
Fit Distribution(
Gamma(
Spec Limits(
LSL( 2000 ),
USL( 4000 ),
Target( 3000 )
)
)
)
),
Histograms Only,
By( :Validation ),
SendToByGroup(
{Format( :Validation ) ==
"Training"},
SendToReport(
Dispatch(
{
"Distributions Validation=Training",
"Price"},
"Distrib Histogram",
FrameBox,
{
DispatchSeg(
LabelSeg( 1 ),
{
Font(
"Helvetica", 13,
"Plain"
)}
),
DispatchSeg(
LabelSeg( 2 ),
{
Font(
"Helvetica", 13,
"Plain"
)}
),
DispatchSeg(
LabelSeg( 3 ),
{
Font(
"Helvetica", 13,
"Plain"
)}
)}
),
Dispatch(
{
"Distributions Validation=Training",
"Price", "Fitted Gamma"},
"Capability Analysis",
OutlineBox,
{Close( 1 )}
)
)
),
SendToByGroup(
{Format( :Validation ) ==
"Validation"},
SendToReport(
Dispatch(
{
"Distributions Validation=Validation",
"Price"},
"Distrib Histogram",
FrameBox,
{
DispatchSeg(
LabelSeg( 1 ),
{
Font(
"Helvetica", 13,
"Plain"
)}
),
DispatchSeg(
LabelSeg( 2 ),
{
Font(
"Helvetica", 13,
"Plain"
)}
),
DispatchSeg(
LabelSeg( 3 ),
{
Font(
"Helvetica", 13,
"Plain"
)}
)}
),
Dispatch(
{
"Distributions Validation=Validation",
"Price", "Fitted Gamma"},
"Capability Analysis",
OutlineBox,
{Close( 1 )}
)
)
)
);
Code Explanation:
- Open Distribution platform.
- Group by Validation column.
- Filter for Training group.
- Stack data vertically.
- Analyze Price column.
- Show summary statistics.
- Arrange layout horizontally.
- Disable vertical orientation.
- Disable capability analysis.
- Fit Gamma distribution.
- Set LSL to 2000.
- Set USL to 4000.
- Set target to 3000.
- Display histograms only.
- Group by Validation column.
- Customize Training group report.
- Set font for histogram labels.
- Hide capability analysis for Training.
- Customize Validation group report.
- Set font for histogram labels.
- Hide capability analysis for Validation.
Example 96
Summary: Fits a linear model using the EMS method with interactions and random effects, incorporating various continuous and nominal distributions from a data table.
Code:
// V2: Distribution - Inputs
Distribution(
Continuous Distribution(
Column( :SA )
),
Continuous Distribution(
Column( :M% )
),
Continuous Distribution(
Column( :ambient temp )
),
Continuous Distribution(
Column( :viscosity )
),
Nominal Distribution(
Column( :Quarry )
),
Nominal Distribution(
Column( :Shift )
),
Continuous Distribution(
Column( :pH )
),
Continuous Distribution(
Column( :Xf )
),
Histograms Only
);
Code Explanation:
- Create distribution analysis.
- Add SA column for continuous distribution.
- Add M% column for continuous distribution.
- Add ambient temp column for continuous distribution.
- Add viscosity column for continuous distribution.
- Add Quarry column for nominal distribution.
- Add Shift column for nominal distribution.
- Add pH column for continuous distribution.
- Add Xf column for continuous distribution.
- Display histograms only.
Example 97
Summary: Opens a data table, stacks the data vertically using Nominal Distribution, and arranges the layout horizontally to validate a column.
Code:
// V4: Validation Column
Distribution(
Stack( 1 ),
Nominal Distribution(
Column( :Validation ),
Horizontal Layout( 1 ),
Vertical( 0 )
)
);
Code Explanation:
- Open Distribution platform.
- Stack data vertically.
- Use Nominal Distribution.
- Select Validation column.
- Arrange layout horizontally.
- Disable vertical layout.
Example 98
Summary: Fits a linear model using the EMS method with interactions and random effects to analyze various characteristics of mushrooms, including edibility, cap shape, surface, color, bruises, odor, gill attachment, spacing, size, and more.
Code:
// Distribution
Distribution(
Nominal Distribution(
Column( :Edibility )
),
Nominal Distribution(
Column( :cap shape )
),
Nominal Distribution(
Column( :cap surface )
),
Nominal Distribution(
Column( :cap color )
),
Nominal Distribution(
Column( :bruises )
),
Nominal Distribution(
Column( :odor )
),
Nominal Distribution(
Column( :gill attachment )
),
Nominal Distribution(
Column( :gill spacing )
),
Nominal Distribution(
Column( :gill size )
),
Nominal Distribution(
Column( :gill color )
),
Nominal Distribution(
Column( :stalk shape )
),
Nominal Distribution(
Column( :stalk root )
),
Nominal Distribution(
Column(
:stalk surface above ring
)
),
Nominal Distribution(
Column(
:stalk surface below ring
)
),
Nominal Distribution(
Column( :stalk color above ring )
),
Nominal Distribution(
Column( :stalk color below ring )
),
Nominal Distribution(
Column( :veil type )
),
Nominal Distribution(
Column( :veil color )
),
Nominal Distribution(
Column( :ring number )
),
Nominal Distribution(
Column( :ring type )
),
Nominal Distribution(
Column( :spore print color )
),
Nominal Distribution(
Column( :population )
),
Nominal Distribution(
Column( :habitat )
)
);
Code Explanation:
- Create distribution analysis.
- Analyze Edibility column.
- Analyze cap shape column.
- Analyze cap surface column.
- Analyze cap color column.
- Analyze bruises column.
- Analyze odor column.
- Analyze gill attachment column.
- Analyze gill spacing column.
- Analyze gill size column.
Example 99
Summary: Generates a distribution analysis to visualize the Tip percentage by Server, using a continuous distribution with horizontal layout and grouping by Server.
Code:
// Distribution: Tip % by Server
Distribution(
Stack( 1 ),
Continuous Distribution(
Column( :Tip Percentage ),
Horizontal Layout( 1 ),
Vertical( 0 )
),
By( :Server )
);
Code Explanation:
- Open distribution analysis.
- Stack data vertically.
- Use continuous distribution.
- Analyze Tip Percentage column.
- Arrange horizontally.
- Do not stack vertically.
- Group by Server.
Example 100
Summary: Opens a data table, fits a linear model using the EMS method with interactions and random effects, and displays histograms only for the specified columns.
Code:
// Explore: Distribution - Inputs
Distribution(
Continuous Distribution(
Column( :SA )
),
Continuous Distribution(
Column( :M% )
),
Continuous Distribution(
Column( :ambient temp )
),
Continuous Distribution(
Column( :viscosity )
),
Nominal Distribution(
Column( :Quarry )
),
Nominal Distribution(
Column( :Shift )
),
Continuous Distribution(
Column( :pH )
),
Continuous Distribution(
Column( :Xf )
),
Histograms Only
);
Code Explanation:
- Open Distribution platform.
- Analyze SA column.
- Analyze M% column.
- Analyze ambient temp column.
- Analyze viscosity column.
- Analyze Quarry column.
- Analyze Shift column.
- Analyze pH column.
- Analyze Xf column.
- Display histograms only.
Example 101
Summary: Opens a data table, fits a linear model using the EMS method with interactions and random effects, and arranges the layout horizontally for nominal data analysis.
Code:
// Explore: Validation Column
Distribution(
Stack( 1 ),
Nominal Distribution(
Column( :Validation ),
Horizontal Layout( 1 ),
Vertical( 0 )
)
);
Code Explanation:
- Open distribution platform.
- Use stacked data option.
- Analyze nominal data.
- Select validation column.
- Arrange layout horizontally.
- Disable vertical layout.
Example 102
Summary: Generates distribution analysis for nominal columns 'Purchase' and 'Promotion', displaying histograms only, with customizable frame sizes.
Code:
// Low Response Rate to Promotion
Distribution(
Nominal Distribution(
Column( :Purchase )
),
Nominal Distribution(
Column( :Promotion )
),
Histograms Only,
SendToReport(
Dispatch(
{"Distributions", "Purchase"},
"Distrib Nom Hist", FrameBox,
{Frame Size( 394, 257 )}
),
Dispatch(
{"Distributions", "Promotion"
}, "Distrib Nom Hist",
FrameBox,
{Frame Size( 234, 258 )}
)
)
);
Code Explanation:
- Generate distribution analysis.
- Analyze nominal column 'Purchase'.
- Analyze nominal column 'Promotion'.
- Display histograms only.
- Resize 'Purchase' histogram frame.
- Set 'Purchase' histogram size to 394x257.
- Resize 'Promotion' histogram frame.
- Set 'Promotion' histogram size to 234x258.
Example 103
Summary: Visualizes the distribution of nominal variables 'Validation', 'Purchase', and 'Promotion' using histograms, with interactive settings for report customization.
Code:
// Splitting the Data
Distribution(
Nominal Distribution(
Column( :Validation )
),
Nominal Distribution(
Column( :Purchase )
),
Nominal Distribution(
Column( :Promotion )
),
Histograms Only,
SendToReport(
Dispatch(
{"Distributions", "Purchase"},
"Distrib Nom Hist", FrameBox,
{Frame Size( 460, 257 )}
)
)
);
Code Explanation:
- Open distribution analysis.
- Analyze nominal variable "Validation".
- Analyze nominal variable "Purchase".
- Analyze nominal variable "Promotion".
- Display histograms only.
- Adjust report settings.
- Set size for "Purchase" histogram frame.
- Frame width set to 460.
- Frame height set to 257.
- End of script execution.
Example 104
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing six input variables (Age, Income, Tenure, Visits, Service Spend, and Product Spend) from a data table.
Code:
// V1: Distribution of Input Variables
Distribution(
Continuous Distribution(
Column( :Age )
),
Continuous Distribution(
Column( :Income )
),
Continuous Distribution(
Column( :Tenure )
),
Continuous Distribution(
Column( :Visits )
),
Continuous Distribution(
Column( :Service Spend )
),
Continuous Distribution(
Column( :Product Spend )
),
Continuous Distribution(
Column( :Incentives )
)
);
Code Explanation:
- Open distribution analysis.
- Analyze Age column.
- Analyze Income column.
- Analyze Tenure column.
- Analyze Visits column.
- Analyze Service Spend column.
- Analyze Product Spend column.
- Analyze Incentives column.
Example 105
Summary: Opens a data table and fits a linear model using the EMS method with interactions and random effects, analyzing various field study variables.
Code:
// V2: Distribution of Field Study Variables
Distribution(
Nominal Distribution(
Column( :Manufacturer Promo )
),
Nominal Distribution(
Column( :Use Promo )
),
Nominal Distribution(
Column( :Treatment and Use )
),
Continuous Distribution(
Column( :Pre Visits )
),
Continuous Distribution(
Column( :Post Visits )
),
Continuous Distribution(
Column(
:Pre Promo Service Spend
)
),
Continuous Distribution(
Column(
:Pre Promo Product Spend
)
),
Continuous Distribution(
Column(
:Post Promo Service Spend
)
),
Continuous Distribution(
Column(
:Post Promo Product Spend
)
)
);
Code Explanation:
- Open distribution analysis window.
- Analyze Manufacturer Promo nominal data.
- Analyze Use Promo nominal data.
- Analyze Treatment and Use nominal data.
- Analyze Pre Visits continuous data.
- Analyze Post Visits continuous data.
- Analyze Pre Promo Service Spend continuous data.
- Analyze Pre Promo Product Spend continuous data.
- Analyze Post Promo Service Spend continuous data.
- Analyze Post Promo Product Spend continuous data.
Example 106
Summary: Fits a normal distribution to the '% Response' column using the EMS method, visualizing the goodness of fit and sending the report to the output window.
Code:
// Distribution
Distribution(
Continuous Distribution(
Column( :"% Response"n ),
Normal Quantile Plot( 1 ),
Fit Distribution(
Normal(
Goodness of Fit( 1 )
)
)
),
SendToReport(
Dispatch( {"% Response"},
"Quantiles", OutlineBox,
Close( 1 )
)
)
);
Code Explanation:
- Open distribution platform.
- Select continuous distribution option.
- Choose "% Response" column.
- Enable normal quantile plot.
- Fit normal distribution.
- Include goodness of fit test.
- Send report to output window.
- Locate "% Response" section.
- Find quantiles outline box.
- Close quantiles outline box.
Example 107
Summary: Fits a linear model using the EMS method with interactions and random effects, utilizing the Distribution platform in JMP.
Code:
// Distribution - Overall Resp Rate
Distribution(
Continuous Distribution(
Column( :Response Rate ),
Horizontal Layout( 1 ),
Vertical( 0 )
)
);
Code Explanation:
- Open JMP application.
- Load data table.
- Access Distribution platform.
- Select Continuous Distribution option.
- Choose Response Rate column.
- Set Horizontal Layout to 1.
- Set Vertical to 0.
- Generate distribution plot.
- Display results.
- End script execution.
Example 108
Summary: Opens a data table and fits a linear model using the EMS method with interactions and random effects to analyze various columns, including SALES, MARGIN, traffic_band, week_ending_dt, and more.
Code:
// View 1: JMP - Ouptuts Distribution
Distribution(
Continuous Distribution(
Column( :SALES )
),
Continuous Distribution(
Column( :MARGIN )
),
Continuous Distribution(
Column( :traffic_band )
),
Continuous Distribution(
Column( :week_ending_dt )
),
Nominal Distribution(
Column( :ty_corp__vol__grp_ )
),
Nominal Distribution(
Column( :region_name )
),
Continuous Distribution(
Column( :region_number )
),
Nominal Distribution(
Column( :district_name )
),
Continuous Distribution(
Column( :district_number )
),
Continuous Distribution(
Column( :store_number )
),
Nominal Distribution(
Column( :city )
),
Nominal Distribution(
Column( :state )
),
Continuous Distribution(
Column( :store_post_code )
)
);
Code Explanation:
- Open Distribution platform.
- Analyze SALES column.
- Analyze MARGIN column.
- Analyze traffic_band column.
- Analyze week_ending_dt column.
- Analyze ty_corp__vol__grp_ column.
- Analyze region_name column.
- Analyze region_number column.
- Analyze district_name column.
- Analyze district_number column.
- Analyze store_number column.
- Analyze city column.
- Analyze state column.
- Analyze store_post_code column.
Example 109
Summary: Fits a linear model using the EMS method with interactions and random effects to analyze various continuous and nominal variables in a data table, including SALES, open_dt, gsf, ssf, and more.
Code:
// View 1: JMP - Inputs Distribution
Distribution(
Continuous Distribution(
Column( :SALES )
),
Nominal Distribution(
Column( :center_type )
),
Nominal Distribution(
Column( :climate )
),
Nominal Distribution(
Column( :store_status )
),
Continuous Distribution(
Column( :open_dt )
),
Nominal Distribution(
Column( :type_of_closure )
),
Continuous Distribution(
Column( :reopening_date )
),
Continuous Distribution(
Column( :gsf )
),
Continuous Distribution(
Column( :ssf )
),
Nominal Distribution(
Column( :store_design )
),
Nominal Distribution(
Column( :updated_re_type )
),
Continuous Distribution(
Column( :GENDER_F )
),
Continuous Distribution(
Column( :GENDER_M )
),
Continuous Distribution(
Column( :AGE )
),
Continuous Distribution(
Column( :RACE_W )
),
Continuous Distribution(
Column( :RACE_H )
),
Continuous Distribution(
Column( :RACE_B )
),
Continuous Distribution(
Column( :RACE_J )
),
Continuous Distribution(
Column( :RACE_C )
),
Continuous Distribution(
Column( :RACE_P )
),
Continuous Distribution(
Column( :RACE_R )
),
Continuous Distribution(
Column( :RACE_A )
),
Continuous Distribution(
Column( :RACE_I )
),
Continuous Distribution(
Column( :EDU_LEVEL )
),
Continuous Distribution(
Column( :LENGTH_OF_RESIDENCE )
),
Continuous Distribution(
Column( :NUMBER_OF_CHILDREN )
),
Continuous Distribution(
Column( :NUM_ADULTS_IN_HH )
),
Continuous Distribution(
Column( :MARITAL_STATUS_M )
),
Continuous Distribution(
Column( :MARITAL_STATUS_S )
),
Continuous Distribution(
Column( :HOMEOWNER_Y )
),
Continuous Distribution(
Column( :NEW_ESTIMATED_INCOME )
)
);
Code Explanation:
- Create Distribution analysis.
- Analyze SALES (continuous).
- Analyze center_type (nominal).
- Analyze climate (nominal).
- Analyze store_status (nominal).
- Analyze open_dt (continuous).
- Analyze type_of_closure (nominal).
- Analyze reopening_date (continuous).
- Analyze gsf (continuous).
- Analyze ssf (continuous).
Example 110
Summary: Runs the analysis of three continuous columns (Yield, LC ASSAY, and TURBIDITY2) by fitting all distributions, performing capability analysis with specific limits, and generating reports for quantiles, moments, and distribution comparisons.
Code:
// Distribution
Distribution(
Continuous Distribution(
Column( :Yield ),
PpK Capability Labeling( 61 ),
Fit Distribution( All ),
Capability Analysis( LSL( 80 ) )
),
Continuous Distribution(
Column( :LC ASSAY ),
PpK Capability Labeling( 61 ),
Fit Distribution( All ),
Capability Analysis( LSL( 98 ) )
),
Continuous Distribution(
Column( :" TURBIDITY2"n ),
PpK Capability Labeling( 61 ),
Fit Distribution( All ),
Capability Analysis( USL( 10 ) )
),
SendToReport(
Dispatch( {"Yield"}, "Quantiles",
OutlineBox,
Close( 1 )
),
Dispatch( {"Yield"}, "Moments",
OutlineBox,
Close( 1 )
),
Dispatch( {"Yield"},
"Compare Distributions",
OutlineBox,
Close( 1 )
),
Dispatch( {"LC ASSAY"},
"Quantiles", OutlineBox,
Close( 1 )
),
Dispatch( {"LC ASSAY"}, "Moments",
OutlineBox,
Close( 1 )
),
Dispatch( {"LC ASSAY"},
"Compare Distributions",
OutlineBox,
Close( 1 )
),
Dispatch( {" TURBIDITY2"},
"Quantiles", OutlineBox,
Close( 1 )
),
Dispatch( {" TURBIDITY2"},
"Moments", OutlineBox,
Close( 1 )
),
Dispatch( {" TURBIDITY2"},
"Compare Distributions",
OutlineBox,
Close( 1 )
)
)
);
Code Explanation:
- Open Distribution platform.
- Analyze Yield column.
- Label PpK capability at 61.
- Fit all distributions.
- Perform capability analysis with LSL 80.
- Analyze LC ASSAY column.
- Label PpK capability at 61.
- Fit all distributions.
- Perform capability analysis with LSL 98.
- Analyze TURBIDITY2 column.
- Label PpK capability at 61.
- Fit all distributions.
- Perform capability analysis with USL 10.
- Close Quantiles report for Yield.
- Close Moments report for Yield.
- Close Compare Distributions report for Yield.
- Close Quantiles report for LC ASSAY.
- Close Moments report for LC ASSAY.
- Close Compare Distributions report for LC ASSAY.
- Close Quantiles report for TURBIDITY2.
- Close Moments report for TURBIDITY2.
- Close Compare Distributions report for TURBIDITY2.
Example 111
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing the relationship between Parent and Child columns in a nominal distribution.
Code:
// Distribution
Distribution(
Nominal Distribution(
Column( :Parent )
),
Nominal Distribution(
Column( :Child )
)
);
Code Explanation:
- Open distribution analysis.
- Analyze Parent column.
- Apply nominal distribution.
- Analyze Child column.
- Apply nominal distribution.
Example 112
Summary: This script fits a linear model using the EMS method with interactions and random effects to analyze 'Yield @ Time t' and columns A-H, displaying histograms only.
Code:
// Distribution Default
Distribution(
Continuous Distribution(
Column( :"Yield @ Time t"n )
),
Continuous Distribution(
Column( :A )
),
Continuous Distribution(
Column( :B )
),
Continuous Distribution(
Column( :C )
),
Continuous Distribution(
Column( :D )
),
Continuous Distribution(
Column( :E )
),
Continuous Distribution(
Column( :F )
),
Continuous Distribution(
Column( :G )
),
Continuous Distribution(
Column( :H )
),
Continuous Distribution(
Column( :I )
),
Continuous Distribution(
Column( :J )
),
Histograms Only
);
Code Explanation:
- Launch Distribution analysis.
- Analyze "Yield @ Time t".
- Analyze column A.
- Analyze column B.
- Analyze column C.
- Analyze column D.
- Analyze column E.
- Analyze column F.
- Analyze column G.
- Display histograms only.
Example 113
Summary: Generates a report with histograms for multiple nominal columns and a continuous distribution, using the Distribution platform in JMP.
Code:
// Distribution
Distribution(
Continuous Distribution(
Column( :Total )
),
Nominal Distribution(
Column( :Facility )
),
Nominal Distribution(
Column( :Weekday )
),
Nominal Distribution(
Column( :Month )
),
Nominal Distribution(
Column( :Fiscal Year )
),
Nominal Distribution(
Column( :Symbol )
),
Nominal Distribution(
Column( :Holdback )
),
Histograms Only,
SendToReport(
Dispatch( {}, "1", ScaleBox,
{Min( 0 ), Max( 11000 ),
Inc( 1000 ), Minor Ticks( 1 ),
Rotated Labels(
"Horizontal"
)}
),
Dispatch( {}, "Distrib Histogram",
FrameBox,
{Frame Size( 90, 400 )}
),
Dispatch( {}, "Distrib Nom Hist",
FrameBox,
{Frame Size( 68, 400 )}
),
Dispatch( {}, "Distrib Nom Hist",
FrameBox,
{Frame Size( 68, 400 )}
),
Dispatch( {}, "Distrib Nom Hist",
FrameBox,
{Frame Size( 68, 400 )}
),
Dispatch( {}, "Distrib Nom Hist",
FrameBox,
{Frame Size( 68, 400 )}
),
Dispatch( {}, "Distrib Nom Hist",
FrameBox,
{Frame Size( 68, 400 )}
)
)
);
Code Explanation:
- Open Distribution platform.
- Analyze continuous column :Total.
- Analyze nominal column :Facility.
- Analyze nominal column :Weekday.
- Analyze nominal column :Month.
- Analyze nominal column :Fiscal Year.
- Analyze nominal column :Symbol.
- Analyze nominal column :Holdback.
- Display histograms only.
- Customize report settings.
Example 114
Summary: Generates a distribution report and analyzes the 'Attack Type', 'Attack Type - 4 Class + normal', and 'Attack Class Binary' columns, displaying histograms only.
Code:
// Distribution of Attacks & Binning
Distribution(
Nominal Distribution(
Column( :Attack Type )
),
Nominal Distribution(
Column(
:
"Attack Type - 4 Class + normal"n
)
),
Nominal Distribution(
Column( :Attack Class Binary )
),
Histograms Only
);
Code Explanation:
- Generate distribution report.
- Analyze "Attack Type" column.
- Analyze "Attack Type - 4 Class + normal"n column.
- Analyze "Attack Class Binary" column.
- Display histograms only.
Example 115
Summary: Generates a distribution platform to analyze nominal data for :Level, continuous data for :Count and :Prob, and displays histograms only. It also sets report settings for 'Weight = inverse Prob' with probability axis.
Code:
// Distribution counts-weights
Distribution(
Nominal Distribution(
Column( :Level ),
Show Counts( 1 )
),
Continuous Distribution(
Column( :Count )
),
Continuous Distribution(
Column( :Prob )
),
Continuous Distribution(
Column(
:"Weight = inverse Prob"n
),
Prob Axis( 1 )
),
Histograms Only,
SendToReport(
Dispatch(
{"Distributions",
"Weight = inverse Prob"}, "1",
ScaleBox,
{Min( -2.55119055335069 ),
Max( 129.576990002644 ),
Inc( 5 ), Minor Ticks( 1 )}
)
)
);
Code Explanation:
- Open Distribution platform.
- Analyze nominal data for :Level.
- Display counts for :Level.
- Analyze continuous data for :Count.
- Analyze continuous data for :Prob.
- Analyze continuous data for "Weight = inverse Prob".
- Use probability axis for "Weight = inverse Prob".
- Display histograms only.
- Set report settings for "Weight = inverse Prob".
- Configure scale box properties.
Example 116
Summary: Generates a distribution report with various nominal distributions and histograms, analyzing multiple columns from the provided data table.
Code:
// Distribution - Top 4
Distribution(
Nominal Distribution(
Column( :Edibility ),
Show Percents( 1 )
),
Nominal Distribution(
Column( :Holdback ),
Show Percents( 1 )
),
Nominal Distribution(
Column( :Crossvalidation ),
Show Counts( 1 )
),
Nominal Distribution(
Column( :cap color )
),
Nominal Distribution(
Column( :gill size )
),
Nominal Distribution(
Column( :ring number )
),
Nominal Distribution(
Column( :spore print color )
),
Histograms Only,
SendToReport(
Dispatch( {}, "Distrib Nom Hist",
FrameBox,
{Frame Size( 71, 277 )}
)
)
);
Code Explanation:
- Generate distribution report.
- Analyze Edibility column.
- Display percentages.
- Analyze Holdback column.
- Display percentages.
- Analyze Crossvalidation column.
- Display counts.
- Analyze cap color column.
- Analyze gill size column.
- Analyze ring number column.
- Analyze spore print color column.
- Display histograms only.
- Adjust frame size.
Example 117
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing the PARENT_LOT and WAFER columns in a data table.
Code:
// Lots and Wafers
Distribution(
Nominal Distribution(
Column( :PARENT_LOT )
),
Nominal Distribution(
Column( :WAFER )
),
Histograms Only
);
Code Explanation:
- Open table.
- Create distribution analysis.
- Analyze PARENT_LOT column.
- Analyze WAFER column.
- Display histograms only.
Example 118
Summary: This script breaks up data for predictive modeling using a Distribution analysis, visualizing nominal and continuous distributions with histograms only, and sending the report to the viewer.
Code:
// Break up the data for predictive modeling
Distribution(
Nominal Distribution(
Column( :Validation )
),
Continuous Distribution(
Column( :"Log(Bin10)"n )
),
Histograms Only,
SendToReport(
Dispatch(
{"Distributions",
"Validation"},
"Distrib Nom Hist", FrameBox,
{Frame Size( 141, 272 )}
)
)
);
Code Explanation:
- Run Distribution analysis.
- Analyze nominal column "Validation".
- Analyze continuous column "Log(Bin10)n".
- Display histograms only.
- Send report to viewer.
- Adjust frame size for "Validation" histogram.
- Set width to 141 units.
- Set height to 272 units.
Example 119
Summary: Generates a comprehensive analysis of various distributions, including continuous and nominal variables, using the EMS method with interactions and random effects. It also creates reports for quantiles, capability analysis, and frequencies.
Code:
// Distribution
Distribution(
Continuous Distribution(
Column( :Price ),
PpK Capability Labeling( 61 ),
Capability Analysis(
LSL( 2000 ),
USL( 4000 ),
Target( 3000 )
)
),
Continuous Distribution(
Column( :Carat Weight ),
PpK Capability Labeling( 61 )
),
Nominal Distribution(
Column( :Color )
),
Nominal Distribution(
Column( :Clarity )
),
Continuous Distribution(
Column( :Depth ),
PpK Capability Labeling( 61 )
),
Continuous Distribution(
Column( :Table ),
PpK Capability Labeling( 61 )
),
Nominal Distribution(
Column( :Cut )
),
Nominal Distribution(
Column( :Report )
),
SendToReport(
Dispatch( {"Price"}, "Quantiles",
OutlineBox,
Close( 1 )
),
Dispatch( {"Price"},
"Capability Analysis",
OutlineBox,
Close( 1 )
),
Dispatch(
{"Price",
"Capability Analysis"},
" Long Term Sigma",
OutlineBox,
Close( 1 )
),
Dispatch( {"Carat Weight"},
"Quantiles", OutlineBox,
Close( 1 )
),
Dispatch( {"Color"},
"Frequencies", OutlineBox,
Close( 1 )
),
Dispatch( {"Clarity"},
"Frequencies", OutlineBox,
Close( 1 )
),
Dispatch( {"Depth"}, "Quantiles",
OutlineBox,
Close( 1 )
),
Dispatch( {"Table"}, "Quantiles",
OutlineBox,
Close( 1 )
),
Dispatch( {"Cut"}, "Frequencies",
OutlineBox,
Close( 1 )
),
Dispatch( {"Report"},
"Frequencies", OutlineBox,
Close( 1 )
)
)
);
Code Explanation:
- Create distribution analysis.
- Analyze Price for continuous distribution.
- Set PpK Capability Labeling to 61.
- Define capability analysis limits for Price.
- Analyze Carat Weight for continuous distribution.
- Set PpK Capability Labeling to 61.
- Analyze Color for nominal distribution.
- Analyze Clarity for nominal distribution.
- Analyze Depth for continuous distribution.
- Set PpK Capability Labeling to 61.
- Analyze Table for continuous distribution.
- Set PpK Capability Labeling to 61.
- Analyze Cut for nominal distribution.
- Analyze Report for nominal distribution.
- Close Quantiles for Price.
- Close Capability Analysis for Price.
- Close Long Term Sigma for Price.
- Close Quantiles for Carat Weight.
- Close Frequencies for Color.
- Close Frequencies for Clarity.
- Close Quantiles for Depth.
- Close Quantiles for Table.
- Close Frequencies for Cut.
- Close Frequencies for Report.
Example 120
Summary: Generates a distribution analysis of three nominal variables: Industry, Application Area, and New AL/Upgrade. The script uses the Distribution platform to create a hierarchical structure for each variable, ordered by count ascending.
Code:
// Distribution
Distribution(
Nominal Distribution(
Column( :Industry ),
Order By( "Count Ascending" )
),
Nominal Distribution(
Column( :Application Area ),
Order By( "Count Ascending" )
),
Nominal Distribution(
Column( :"New AL/Upgrade"n )
)
);
Code Explanation:
- Create distribution analysis.
- Analyze Industry column.
- Order by count ascending.
- Analyze Application Area column.
- Order by count ascending.
- Analyze New AL/Upgrade column.
Example 121
Summary: This JSL script distributes a new upgrade to reports, using a nominal distribution and sending the output to a specific location in the report.
Code:
// Distribution of New AL/Upgrade
Distribution(
Nominal Distribution(
Column( :"New AL/Upgrade"n )
),
SendToReport(
Dispatch(
{"Distributions", "New AL"},
"Frequencies", OutlineBox,
{Close( 1 )}
)
)
);
Code Explanation:
- Create distribution analysis.
- Use nominal distribution.
- Select column "New AL/Upgrade".
- Send report to destination.
- Dispatch to specific location.
- Target "Distributions", "New AL".
- Access "Frequencies" outline box.
- Close the first item.
Example 122
Summary: Generates a distribution of phases using the EMS method, fitting a linear model with interactions and random effects.
Code:
// Distribution of Phases
Distribution(
Nominal Distribution(
Column( :Phases ),
Frequencies( 0 )
)
);
Code Explanation:
- Generate distribution.
- Use nominal distribution.
- Analyze column :Phases.
- Show frequencies.
Example 123
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing four continuous columns (List Size, Opened, Clicked, and Opt-Outs) from a data table.
Code:
// Distribution
Distribution(
Continuous Distribution(
Column( :List Size )
),
Continuous Distribution(
Column( :Opened )
),
Continuous Distribution(
Column( :Clicked )
),
Continuous Distribution(
Column( :"Opt-Outs"n )
)
);
Code Explanation:
- Open distribution platform.
- Analyze List Size column.
- Analyze Opened column.
- Analyze Clicked column.
- Analyze Opt-Outs column.
Example 124
Summary: Fits a linear model using the EMS method with interactions and random effects to analyze the distribution of Time Of Stop, utilizing the Continuous Distribution platform in JMP.
Code:
// Distribution of Time Of Stop
Distribution(
Continuous Distribution(
Column( :Time Of Stop )
)
);
Code Explanation:
- Open Distribution platform.
- Select Continuous Distribution option.
- Choose Time Of Stop column.
Example 125
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing the relationships between SubAgency, Latitude, Longitude, and Accident variables.
Code:
// Distribution
Distribution(
Nominal Distribution(
Column( :SubAgency )
),
Continuous Distribution(
Column( :Latitude )
),
Continuous Distribution(
Column( :Longitude )
),
Nominal Distribution(
Column( :Accident )
)
);
Code Explanation:
- Open Distribution platform.
- Analyze SubAgency column.
- Analyze Latitude column.
- Analyze Longitude column.
- Analyze Accident column.
Example 126
Summary: Creates a distribution analysis for various factors, including churn flag, customer ID, average daily balance, interest paid, cash advances, and more. It uses the Distribution platform to visualize the data.
Code:
// JMP Distribution - All Factors
Distribution(
Nominal Distribution(
Column( :Churn Flag )
),
Nominal Distribution(
Column( :cust id )
),
Continuous Distribution(
Column( :Average Daily Balance )
),
Continuous Distribution(
Column( :Interest Paid )
),
Continuous Distribution(
Column( :Cash Advances )
),
Continuous Distribution(
Column( :Balance Transferred )
),
Nominal Distribution(
Column( :Marital Status )
),
Nominal Distribution(
Column( :Occupation Group )
),
Continuous Distribution(
Column(
:"Age of Account (Months)"n
)
),
Continuous Distribution(
Column( :Age Group )
),
Nominal Distribution(
Column( :LTV Group )
),
Continuous Distribution(
Column( :Bill Cycle )
),
Nominal Distribution(
Column( :Customer Type )
),
Nominal Distribution(
Column( :Gender )
),
Continuous Distribution(
Column( :Customer Value )
),
Continuous Distribution(
Column( :Credit Limit )
),
SendToReport(
Dispatch( {}, "cust id",
OutlineBox,
{Close( 1 )}
)
)
);
Code Explanation:
- Create distribution analysis.
- Analyze Churn Flag (nominal).
- Analyze cust id (nominal).
- Analyze Average Daily Balance (continuous).
- Analyze Interest Paid (continuous).
- Analyze Cash Advances (continuous).
- Analyze Balance Transferred (continuous).
- Analyze Marital Status (nominal).
- Analyze Occupation Group (nominal).
- Analyze Age of Account (Months) (continuous).
Example 127
Summary: Generates a distribution analysis of the BORO column, ordering results by count ascending and sending the report to the viewer. The script uses the nominal distribution method with SendToReport.
Code:
// Distribution of BORO
Distribution(
Nominal Distribution(
Column( :BORO ),
Order By( "Count Ascending" )
),
SendToReport(
Dispatch( {"BORO"}, "Frequencies",
OutlineBox,
{Close( 1 )}
)
)
);
Code Explanation:
- Open distribution analysis.
- Analyze BORO column.
- Use nominal distribution method.
- Order results by count ascending.
- Send report to viewer.
- Close frequencies outline box.
Example 128
Summary: Generates a distribution report for the nominal column BORO, ordered by ascending count, and sends it to the viewer with an outline box.
Code:
// Distribution of BORO 2
Distribution(
Nominal Distribution(
Column( :BORO ),
Order By( "Count Ascending" )
),
SendToReport(
Dispatch( {"BORO"}, "Frequencies",
OutlineBox,
{Close( 1 )}
)
)
);
Code Explanation:
- Generate distribution report.
- Analyze nominal column BORO.
- Order by ascending count.
- Send report to viewer.
- Close Frequencies outline box.
Example 129
Summary: Generates a distribution analysis of the CRITICAL FLAG column using a nominal distribution type and sends the report to output, dispatching the CRITICAL FLAG report with frequencies outline box closed.
Code:
// Distribution of CRITICAL FLAG
Distribution(
Nominal Distribution(
Column( :CRITICAL FLAG )
),
SendToReport(
Dispatch( {"CRITICAL FLAG"},
"Frequencies", OutlineBox,
{Close( 1 )}
)
)
);
Code Explanation:
- Generate distribution analysis.
- Use nominal distribution type.
- Analyze column CRITICAL FLAG.
- Send report to output.
- Dispatch CRITICAL FLAG report.
- Close Frequencies outline box.
Example 130
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing the National Origin column in the Split Plot data table.
Code:
// Distribution of Region
Distribution(
Nominal Distribution(
Column( :National Origin )
)
);
Code Explanation:
- Open Distribution platform.
- Select Nominal Distribution option.
- Analyze National Origin column.
Example 131
Summary: Fits a linear model using the EMS method with interactions and random effects, utilizing the Distribution platform to analyze continuous data.
Code:
// Distribution
Distribution(
Continuous Distribution(
Column( :Octane ),
Quantiles( 0 ),
Summary Statistics( 0 ),
Outlier Box Plot( 0 )
)
);
Code Explanation:
- Open distribution platform.
- Select continuous distribution option.
- Specify column :Octane.
- Disable quantiles display.
- Disable summary statistics.
- Disable outlier box plot.
Example 132
Summary: Opens a data table, fits a linear model using the EMS method with interactions and random effects, and generates quantiles for multiple continuous variables.
Code:
// Distribution Factors
Distribution(
Continuous Distribution(
Column( :Temperature )
),
Continuous Distribution(
Column( :Time )
),
Continuous Distribution(
Column( :Amount )
),
Nominal Distribution(
Column( :Seed )
),
Continuous Distribution(
Column( :Water )
),
Continuous Distribution(
Column( :Alcohol )
),
Continuous Distribution(
Column( :Ether )
),
Nominal Distribution(
Column( :Reactor )
),
SendToReport(
Dispatch( {"Temperature"},
"Quantiles", OutlineBox,
Close( 1 )
),
Dispatch( {"Time"}, "Quantiles",
OutlineBox,
Close( 1 )
),
Dispatch( {"Amount"}, "Quantiles",
OutlineBox,
Close( 1 )
),
Dispatch( {"Water"}, "Quantiles",
OutlineBox,
Close( 1 )
),
Dispatch( {"Alcohol"},
"Quantiles", OutlineBox,
Close( 1 )
),
Dispatch( {"Ether"}, "Quantiles",
OutlineBox,
Close( 1 )
)
)
);
Code Explanation:
- Open distribution analysis.
- Analyze Temperature as continuous.
- Analyze Time as continuous.
- Analyze Amount as continuous.
- Analyze Seed as nominal.
- Analyze Water as continuous.
- Analyze Alcohol as continuous.
- Analyze Ether as continuous.
- Analyze Reactor as nominal.
- Close Quantiles for all variables.
Example 133
Summary: Generates a distribution report for Yield, Assay, and Impurity columns, analyzing each column separately with capability analysis and sending the results to a report.
Code:
// Distribution Responses
Distribution(
Continuous Distribution(
Column( :Yield ),
Capability Analysis( LSL( 90 ) )
),
Continuous Distribution(
Column( :Assay ),
Capability Analysis( LSL( 98 ) )
),
Continuous Distribution(
Column( :Impurity ),
Capability Analysis( USL( 1 ) )
),
SendToReport(
Dispatch( {"Yield"}, "Quantiles",
OutlineBox,
Close( 1 )
),
Dispatch( {"Yield"},
"Capability Analysis",
OutlineBox,
Close( 1 )
),
Dispatch( {"Assay"}, "Quantiles",
OutlineBox,
Close( 1 )
),
Dispatch( {"Assay"},
"Capability Analysis",
OutlineBox,
Close( 1 )
),
Dispatch( {"Impurity"},
"Quantiles", OutlineBox,
Close( 1 )
),
Dispatch( {"Impurity"},
"Capability Analysis",
OutlineBox,
Close( 1 )
)
)
);
Code Explanation:
- Create distribution report.
- Analyze Yield column.
- Set LSL for Yield.
- Analyze Assay column.
- Set LSL for Assay.
- Analyze Impurity column.
- Set USL for Impurity.
- Hide Quantiles for Yield.
- Hide Capability Analysis for Yield.
- Hide Quantiles and Capability Analysis for Assay and Impurity.
Example 134
Summary: Generates a distribution analysis of the CRITICAL FLAG column, using a nominal distribution method with histograms only, and orders the results by count ascending.
Code:
// Distribution of CRITICAL FLAG
Distribution(
Nominal Distribution(
Column( :CRITICAL FLAG ),
Order By( "Count Ascending" )
),
Histograms Only
);
Code Explanation:
- Generate distribution analysis.
- Use nominal distribution method.
- Analyze CRITICAL FLAG column.
- Order results by count ascending.
- Display histograms only.
Example 135
Summary: Fits a linear model using the EMS method with interactions and random effects to analyze the distribution of RECORD DATE-GRADE DATE.
Code:
// Distribution of RECORD DATE-GRADE DATE
Distribution(
Continuous Distribution(
Column(
:"RECORD DATE-GRADE DATE"n
)
)
);
Code Explanation:
- Open Distribution platform.
- Select Continuous Distribution option.
- Specify "RECORD DATE-GRADE DATE" column.
Example 136
Summary: This script fits a linear model using the EMS method with interactions and random effects, utilizing the Distribution platform to visualize the distribution of BORO[CAMIS] based on CAMIS and BORO columns.
Code:
// Distribution of BORO[CAMIS]
Distribution(
Nominal Distribution(
Column(
Referenced Column(
"BORO[CAMIS]",
Reference(
Column( :CAMIS ),
Reference(
Column( :BORO )
)
)
)
),
Order By( "Count Ascending" )
)
);
Code Explanation:
- Open distribution platform.
- Select nominal distribution.
- Specify BORO[CAMIS] column.
- Reference CAMIS column.
- Reference BORO column.
- Combine referenced columns.
- Order by count ascending.
Example 137
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing Wafer, Lot, P1, P2, and P3 columns in a data table.
Code:
// Distribution
Distribution(
Nominal Distribution(
Column( :Wafer )
),
Nominal Distribution(
Column( :Lot )
),
Continuous Distribution(
Column( :P1 )
),
Continuous Distribution(
Column( :P2 )
),
Nominal Distribution( Column( :P3 ) )
);
Code Explanation:
- Open Distribution platform.
- Analyze Wafer column.
- Analyze Lot column.
- Analyze P1 column.
- Analyze P2 column.
- Analyze P3 column.
Example 138
Summary: Generates a distribution report for the CRITICAL FLAG column, ordered by count ascending, and sends it to output with frequencies outline box closed.
Code:
// Distribution of CRITICAL FLAG 2
Distribution(
Nominal Distribution(
Column( :CRITICAL FLAG ),
Order By( "Count Ascending" )
),
SendToReport(
Dispatch( {"CRITICAL FLAG"},
"Frequencies", OutlineBox,
{Close( 1 )}
)
)
);
Code Explanation:
- Create distribution report.
- Analyze nominal data.
- Select CRITICAL FLAG column.
- Order by count ascending.
- Send report to output.
- Close frequencies outline box.
Example 139
Summary: Fits a linear model using the EMS method with interactions and random effects to analyze the relationship between Topic 2 and Location, utilizing nominal distribution methods for both variables.
Code:
// Distribution of Topic - CLEAN, Location
Distribution(
Nominal Distribution(
Column( :Topic 2 )
),
Nominal Distribution(
Column( :Location )
)
);
Code Explanation:
- Create distribution analysis.
- Analyze Topic 2 column.
- Use nominal distribution method.
- Analyze Location column.
- Use nominal distribution method.
Example 140
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing the 'Center' column data from a distribution analysis.
Code:
// Distribution of Center
Distribution(
Nominal Distribution(
Column( :Center )
)
);
Code Explanation:
- Create distribution analysis.
- Use nominal distribution method.
- Analyze "Center" column data.
Example 141
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing the 'Validation' column in a data table.
Code:
// Distribution of Validation
Distribution(
Nominal Distribution(
Column( :Validation )
)
);
Code Explanation:
- Create distribution analysis.
- Use nominal distribution.
- Analyze column "Validation".
Example 142
Summary: Generates a distribution report for four nominal variables: Violation Type, Property Damage, Race, and Belts. The script uses the EMS method to fit a linear model with interactions and random effects.
Code:
// Distribution of Predictors
Distribution(
Nominal Distribution(
Column( :Violation Type )
),
Nominal Distribution(
Column( :Property Damage )
),
Nominal Distribution(
Column( :Race )
),
Nominal Distribution(
Column( :Belts )
)
);
Code Explanation:
- Create distribution report.
- Analyze "Violation Type".
- Analyze "Property Damage".
- Analyze "Race".
- Analyze "Belts".
Example 143
Summary: Fits a linear model using the EMS method with interactions and random effects, utilizing the Distribution platform to analyze the CRITICAL FLAG column.
Code:
// (1)-Distribution
Distribution(
Nominal Distribution(
Column( :CRITICAL FLAG )
)
);
Code Explanation:
- Open table.
- Access Distribution platform.
- Select Nominal Distribution option.
- Choose CRITICAL FLAG column.
Example 144
Summary: Opens a data table, fits a linear model using the EMS method with interactions and random effects, and sends the report to output.
Code:
// (2)-Distribution
Distribution(
Nominal Distribution(
Column(
Referenced Column(
"BORO[CAMIS]",
Reference(
Column( :CAMIS ),
Reference(
Column( :BORO )
)
)
)
),
Order By( "Count Ascending" )
),
SendToReport(
Dispatch( {"BORO[CAMIS]"},
"Frequencies", OutlineBox,
{Close( 1 )}
)
)
);
Code Explanation:
- Open distribution analysis.
- Use nominal distribution.
- Select referenced column.
- Reference CAMIS column.
- Reference BORO column.
- Order by count ascending.
- Send report to output.
- Close frequencies outline box.
Example 145
Summary: Generates a distribution analysis report for GDP per Capita, featuring an outlier box and histogram, with customizable frame sizes and marker labels.
Code:
// Distribution: GDP per Capita
Distribution(
Continuous Distribution(
Column( :GDP per Capita ),
Vertical( 0 )
),
SendToReport(
Dispatch( {"GDP per Capita"},
"Distrib Outlier Box",
FrameBox,
{Frame Size( 208, 76 ),
Marker Size( 2 ),
DispatchSeg(
Marker Seg( 1 ),
label offset(
{5, -68, -27},
{6, -29, 38},
{7, 17, 29},
{8, -72, -26}
)
)}
),
Dispatch( {"GDP per Capita"},
"Distrib Histogram", FrameBox,
{Frame Size( 208, 82 )}
)
)
);
Code Explanation:
- Open distribution analysis.
- Select GDP per Capita column.
- Set vertical orientation.
- Configure outlier box frame size.
- Adjust marker size.
- Set label offsets for markers.
- Configure histogram frame size.
- Display outlier box.
- Display histogram.
- Finalize report settings.
Example 146
Summary: Generates a distribution analysis for the 'Octane' column, calculates summary statistics, and sends the report to output. It also adjusts the frame size of the histogram and outlier box.
Code:
// Distribution of Octane and Test Set
Distribution(
Continuous Distribution(
Column( :Octane ),
Summary Statistics( 0 )
),
Nominal Distribution(
Column( :Test Set )
),
SendToReport(
Dispatch( {}, "Distrib Histogram",
FrameBox,
{Frame Size( 233, 235 )}
),
Dispatch( {},
"Distrib Outlier Box",
FrameBox,
{Frame Size( 37, 235 )}
)
)
);
Code Explanation:
- Create distribution analysis.
- Analyze continuous column 'Octane'.
- Calculate summary statistics.
- Analyze nominal column 'Test Set'.
- Send report to output.
- Adjust histogram frame size.
- Adjust outlier box frame size.
Example 147
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing various nominal distributions related to substance use and sexual behavior.
Code:
// Distributions
Distribution(
Stack( 1 ),
Nominal Distribution(
Column(
:
"Drove 1+ times when drinking"n
),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Nominal Distribution(
Column(
:Smoked cigarette before 13
),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Nominal Distribution(
Column(
:Smoked daily for 30 days
),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Nominal Distribution(
Column(
:Had first drink before 13
),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Nominal Distribution(
Column(
:
"Five+ drinks 1+ past 30 days"n
),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Nominal Distribution(
Column(
:Tried marijuana before 13
),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Nominal Distribution(
Column(
:
"Used cocaine 1+ times in life"n
),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Nominal Distribution(
Column(
:
"Sniffed glue 1+ times in life"n
),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Nominal Distribution(
Column(
:
"Used meth 1+ times in life"n
),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Nominal Distribution(
Column(
:
"Used ecstasy 1+ times in life"n
),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Nominal Distribution(
Column( :Had sex before 13 ),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Nominal Distribution(
Column(
:
"Had sex with 4+ people in life"n
),
Horizontal Layout( 1 ),
Vertical( 0 )
)
);
Code Explanation:
- Generate distribution report.
- Stack plots vertically.
- Analyze "Drove 1+ times when drinking".
- Use horizontal layout.
- Analyze "Smoked cigarette before 13".
- Use horizontal layout.
- Analyze "Smoked daily for 30 days".
- Use horizontal layout.
- Analyze "Had first drink before 13".
- Use horizontal layout.
Example 148
Summary: Visualizes the distribution of member status using a nominal distribution platform in JMP, providing an interactive analysis of the data.
Code:
// Distribution of Member Status
Distribution(
Nominal Distribution(
Column( :Member Status )
)
);
Code Explanation:
- Open distribution platform.
- Select nominal distribution.
- Analyze column "Member Status".
Example 149
Summary: Visualizes the cumulative distribution function (CDF) of 'Member First Associated Date' to analyze its distribution, with interactive features like reference lines and customizable X-axis formatting.
Code:
// CDF of Members
Distribution(
Continuous Distribution(
Column(
:Member First Associated Date
),
Quantiles( 0 ),
Summary Statistics( 0 ),
CDF Plot( 1 )
),
SendToReport(
Dispatch(
{
"Member First Associated Date",
"CDF Plot"}, "1", ScaleBox,
{Format( "m/y", 7 ),
Min( 3519936000 ),
Max( 3560000000 ),
Interval( "Month" ), Inc( 6 ),
Minor Ticks( 0 ),
Label Row Nesting( 2 ),
Add Ref Line(
3524688000, "Solid",
"Black", "EA1", 1
),
Add Ref Line(
3534883200, "Solid",
"Black", "EA2", 1
),
Add Ref Line(
3537388800, "Solid",
"Black", "EA3", 1
),
Add Ref Line(
3539548800, "Solid",
"Black", "EA4", 1
),
Add Ref Line(
3542140800, "Solid",
"Black", "EA5", 1
),
Add Ref Line(
3544992000, "Solid",
"Black", "EA6", 1
),
Add Ref Line(
3547670400, "Solid",
"Black", "EA7", 1
),
Add Ref Line(
3550694400, "Solid",
"Black", "EA8", 1
),
Add Ref Line(
3556483200, "Solid",
"Black", "GA", 1
)}
),
Dispatch(
{
"Member First Associated Date",
"CDF Plot"}, "2", ScaleBox,
{Min( -0.0302604166666667 ),
Max( 1.06250709725839 ),
Inc( 0.2 ), Minor Ticks( 1 )}
)
)
);
Code Explanation:
- Create distribution analysis.
- Use continuous distribution.
- Analyze 'Member First Associated Date' column.
- Disable quantiles summary.
- Enable CDF plot.
- Format X-axis as "m/y".
- Set X-axis min and max values.
- Set X-axis interval to months.
- Add multiple reference lines.
- Configure Y-axis scale.
Example 150
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing various variables such as Body System or Organ Class, Severity/Intensity, Serious Event, Age, Sex, Race, and Death Description.
Code:
// Distributions
Distribution(
Nominal Distribution(
Column(
:Body System or Organ Class
),
Order By( "Count Ascending" )
),
Nominal Distribution(
Column( :"Severity/Intensity"n )
),
Nominal Distribution(
Column( :Serious Event )
),
Continuous Distribution(
Column( :Age )
),
Nominal Distribution(
Column( :Sex )
),
Nominal Distribution(
Column( :Race )
),
Nominal Distribution(
Column( :Death Description ),
Order By( "Count Ascending" )
)
);
Code Explanation:
- Create distribution analysis.
- Analyze Body System or Organ Class.
- Order by count ascending.
- Analyze Severity/Intensity.
- Analyze Serious Event.
- Analyze Age.
- Analyze Sex.
- Analyze Race.
- Analyze Death Description.
- Order by count ascending.
Example 151
Summary: Generates a distribution analysis to visualize the relationship between 'Event Type' and 'Failure', using referenced columns for analysis, with histograms only and sending the report to a dashboard.
Code:
// Dashboard 3 - Element 2
Distribution(
Nominal Distribution(
Column(
Referenced Column(
"Event Type[event_key]",
Reference(
Column( :event_key ),
Reference(
Column(
:Event Type
)
)
)
)
)
),
Nominal Distribution(
Column( :Failure )
),
Histograms Only,
SendToReport(
Dispatch( {},
"Event Type[event_key]",
OutlineBox,
{Set Title( "Event Type" )}
)
)
);
Code Explanation:
- Create a distribution analysis.
- Analyze "Event Type[event_key]" column.
- Use referenced columns for analysis.
- Reference "event_key" column.
- Reference "Event Type" column.
- Analyze "Failure" column.
- Display histograms only.
- Send report to dashboard.
- Set title for "Event Type" outline box.
- Label as "Event Type".
Example 152
Summary: Opens a data table, creates nominal distributions for 'Asset ID[asset_key]' and 'Validation', and displays histograms only.
Code:
// Distribution of Asset ID[asset_key], Validation
Distribution(
Nominal Distribution(
Column(
Referenced Column(
"Asset ID[asset_key]",
Reference(
Column( :asset_key ),
Reference(
Column(
:Asset ID
)
)
)
)
)
),
Nominal Distribution(
Column( :Validation )
),
Histograms Only
);
Code Explanation:
- Open table.
- Access "Asset ID[asset_key]" column.
- Reference "asset_key" column.
- Reference "Asset ID" column.
- Create nominal distribution.
- Analyze "Asset ID[asset_key]" data.
- Create nominal distribution.
- Analyze "Validation" data.
- Display histograms only.
- Execute analysis.
Example 153
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing the 'Banding?' column in a Nominal Distribution platform.
Code:
// Distribution (Band Type)
Distribution(
Nominal Distribution(
Column( :Banding? )
)
);
Code Explanation:
- Open Distribution platform.
- Select Nominal Distribution option.
- Analyze "Banding?" column.
Example 154
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing various nominal and continuous variables from a dataset.
Code:
// Distribution (All other variables)
Distribution(
Nominal Distribution(
Column( :cylinder number )
),
Nominal Distribution(
Column( :customer )
),
Nominal Distribution(
Column( :job number )
),
Nominal Distribution(
Column( :grain screened )
),
Nominal Distribution(
Column( :proof on ctd ink )
),
Nominal Distribution(
Column( :blade mfg )
),
Nominal Distribution(
Column( :paper type )
),
Nominal Distribution(
Column( :ink type )
),
Nominal Distribution(
Column( :direct steam )
),
Nominal Distribution(
Column( :solvent type )
),
Nominal Distribution(
Column( :type on cylinder )
),
Nominal Distribution(
Column( :press type )
),
Nominal Distribution(
Column( :press )
),
Nominal Distribution(
Column( :unit number )
),
Nominal Distribution(
Column( :cylinder size )
),
Nominal Distribution(
Column( :paper mill location )
),
Nominal Distribution(
Column( :plating tank )
),
Continuous Distribution(
Column( :proof cut )
),
Continuous Distribution(
Column( :viscosity )
),
Continuous Distribution(
Column( :caliper )
),
Continuous Distribution(
Column( :ink temperature )
),
Continuous Distribution(
Column( :humidity )
),
Continuous Distribution(
Column( :roughness )
),
Continuous Distribution(
Column( :blade pressure )
),
Continuous Distribution(
Column( :varnish pct )
),
Continuous Distribution(
Column( :press speed )
),
Continuous Distribution(
Column( :ink pct )
),
Continuous Distribution(
Column( :solvent pct )
),
Continuous Distribution(
Column( :ESA Voltage )
),
Continuous Distribution(
Column( :ESA Amperage )
),
Continuous Distribution(
Column( :wax )
),
Continuous Distribution(
Column( :hardener )
),
Continuous Distribution(
Column( :roller durometer )
),
Continuous Distribution(
Column( :current density )
),
Continuous Distribution(
Column( :anode space ratio )
),
Continuous Distribution(
Column( :chrome content )
)
);
Code Explanation:
- Generate distribution report.
- Analyze nominal variable: cylinder number.
- Analyze nominal variable: customer.
- Analyze nominal variable: job number.
- Analyze nominal variable: grain screened.
- Analyze nominal variable: proof on ctd ink.
- Analyze nominal variable: blade mfg.
- Analyze nominal variable: paper type.
- Analyze nominal variable: ink type.
- Analyze continuous variable: proof cut.
Example 155
Summary: Opens a data table, analyzes multiple columns, fits a normal distribution to the 'Clearance' column, and generates reports for quantiles and moments of the same column.
Code:
// Distribution
Distribution(
Continuous Distribution(
Column( :Current )
),
Continuous Distribution(
Column( :Clearance ),
Fit Distribution(
Normal(
Goodness of Fit( 1 )
)
)
),
Continuous Distribution(
Column( :Thickness )
),
Nominal Distribution(
Column( :Eqp_Id )
),
Continuous Distribution(
Column( :Yield )
),
Nominal Distribution(
Column( :Operator )
),
SendToReport(
Dispatch( {"Clearance"},
"Quantiles", OutlineBox,
Close( 1 )
),
Dispatch( {"Clearance"},
"Moments", OutlineBox,
Close( 1 )
)
)
);
Code Explanation:
- Open distribution platform.
- Analyze 'Current' column.
- Analyze 'Clearance' column.
- Fit normal distribution to 'Clearance'.
- Enable goodness of fit test.
- Analyze 'Thickness' column.
- Analyze 'Eqp_Id' column.
- Analyze 'Yield' column.
- Analyze 'Operator' column.
- Hide 'Clearance' quantiles and moments.
Example 156
Summary: Fits a linear model using the EMS method with interactions and random effects to analyze yield, current, clearance, thickness, equipment ID, operator, wafer, and lot number data.
Code:
// Distribution 2
Distribution(
Continuous Distribution(
Column( :Yield ),
PpK Capability Labeling( 1 )
),
Continuous Distribution(
Column( :Current ),
PpK Capability Labeling( 1 )
),
Continuous Distribution(
Column( :Clearance ),
PpK Capability Labeling( 1 )
),
Continuous Distribution(
Column( :Thickness ),
PpK Capability Labeling( 1 )
),
Nominal Distribution(
Column( :Eqp_Id )
),
Nominal Distribution(
Column( :Operator )
),
Nominal Distribution(
Column( :Wafer )
),
Nominal Distribution(
Column( :Lot Number )
)
);
Code Explanation:
- Open Distribution platform.
- Analyze Yield column.
- Enable PpK labeling.
- Analyze Current column.
- Enable PpK labeling.
- Analyze Clearance column.
- Enable PpK labeling.
- Analyze Thickness column.
- Enable PpK labeling.
- Analyze Eqp_Id column.
- Analyze Operator column.
- Analyze Wafer column.
- Analyze Lot Number column.
Example 157
Summary: Fits a linear model using the EMS method with interactions and random effects to analyze the relationship between Yield and its influencing factors, utilizing PpK capability labeling.
Code:
// Distribution (Yeild)
Distribution(
Continuous Distribution(
Column( :Yield ),
PpK Capability Labeling( 1 )
)
);
Code Explanation:
- Open distribution analysis.
- Select continuous distribution.
- Choose Yield column.
- Enable PpK capability labeling.
Example 158
Summary: Calculates the distribution of Thickness values using a Normal fit, with no quantiles or summary statistics calculated.
Code:
// Spec Limit Calculations
Distribution(
Continuous Distribution(
Column( :Thickness ),
Quantiles( 0 ),
Summary Statistics( 0 ),
Fit Distribution( Normal )
)
);
Code Explanation:
- Open Distribution platform.
- Select Continuous Distribution.
- Analyze Thickness column.
- Disable Quantiles calculation.
- Disable Summary Statistics.
- Fit Normal distribution.
Example 159
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing various columns from a data table and generating quantiles reports for selected continuous variables.
Code:
// Distribution
Distribution(
Nominal Distribution(
Column( :Lot Acceptance )
),
Nominal Distribution(
Column( :API Particle Size )
),
Continuous Distribution(
Column( :Mill Time )
),
Nominal Distribution(
Column( :Screen Size )
),
Nominal Distribution(
Column( :MgSt Supplier )
),
Nominal Distribution(
Column( :Lactose Supplier )
),
Nominal Distribution(
Column( :Sugar Supplier )
),
Nominal Distribution(
Column( :Talc Supplier )
),
Continuous Distribution(
Column( :Blend Time )
),
Continuous Distribution(
Column( :Blend Speed )
),
Nominal Distribution(
Column( :Compressor )
),
Continuous Distribution(
Column( :Force )
),
Nominal Distribution(
Column( :Coating Supplier )
),
Continuous Distribution(
Column( :Coating Viscosity )
),
Continuous Distribution(
Column( :Inlet Temp )
),
Continuous Distribution(
Column( :Exhaust Temp )
),
Continuous Distribution(
Column( :Spray Rate )
),
Continuous Distribution(
Column( :Atom. Pressure )
),
SendToReport(
Dispatch( {"Mill Time"},
"Quantiles", OutlineBox,
Close( 1 )
),
Dispatch( {"Blend Time"},
"Quantiles", OutlineBox,
Close( 1 )
),
Dispatch( {"Blend Speed"},
"Quantiles", OutlineBox,
Close( 1 )
),
Dispatch( {"Force"}, "Quantiles",
OutlineBox,
Close( 1 )
),
Dispatch( {"Coating Viscosity"},
"Quantiles", OutlineBox,
Close( 1 )
),
Dispatch( {"Inlet Temp"},
"Quantiles", OutlineBox,
Close( 1 )
),
Dispatch( {"Exhaust Temp"},
"Quantiles", OutlineBox,
Close( 1 )
),
Dispatch( {"Spray Rate"},
"Quantiles", OutlineBox,
Close( 1 )
),
Dispatch( {"Atom. Pressure"},
"Quantiles", OutlineBox,
Close( 1 )
)
)
);
Code Explanation:
- Create distribution analysis.
- Analyze nominal column: Lot Acceptance.
- Analyze nominal column: API Particle Size.
- Analyze continuous column: Mill Time.
- Analyze nominal column: Screen Size.
- Analyze nominal column: MgSt Supplier.
- Analyze nominal column: Lactose Supplier.
- Analyze nominal column: Sugar Supplier.
- Analyze nominal column: Talc Supplier.
- Analyze continuous column: Blend Time.
- Analyze continuous column: Blend Speed.
- Analyze nominal column: Compressor.
- Analyze continuous column: Force.
- Analyze nominal column: Coating Supplier.
- Analyze continuous column: Coating Viscosity.
- Analyze continuous column: Inlet Temp.
- Analyze continuous column: Exhaust Temp.
- Analyze continuous column: Spray Rate.
- Analyze continuous column: Atom. Pressure.
- Close Quantiles report for Mill Time.
- Close Quantiles report for Blend Time.
- Close Quantiles report for Blend Speed.
- Close Quantiles report for Force.
- Close Quantiles report for Coating Viscosity.
- Close Quantiles report for Inlet Temp.
- Close Quantiles report for Exhaust Temp.
- Close Quantiles report for Spray Rate.
- Close Quantiles report for Atom. Pressure.
Example 160
Summary: Runs a comprehensive analysis of Mill Time, Screen Size, Blend Time, Blend Speed, and Spray Rate using the EMS method with interactions and random effects.
Code:
// Distribution 2
Distribution(
Continuous Distribution(
Column( :Mill Time )
),
Nominal Distribution(
Column( :Screen Size )
),
Continuous Distribution(
Column( :Blend Time )
),
Continuous Distribution(
Column( :Blend Speed )
),
Continuous Distribution(
Column( :Spray Rate ),
Normal Quantile Plot( 1 ),
Fit Distribution(
Normal(
Goodness of Fit( 1 )
)
),
Capability Analysis(
LSL( 395 ),
USL( 408 )
)
),
Nominal Distribution(
Column( :Lot Acceptance )
)
);
Code Explanation:
- Create distribution analysis.
- Analyze Mill Time continuously.
- Analyze Screen Size nominally.
- Analyze Blend Time continuously.
- Analyze Blend Speed continuously.
- Analyze Spray Rate continuously.
- Generate normal quantile plot.
- Fit normal distribution.
- Perform goodness of fit test.
- Conduct capability analysis.
Example 161
Summary: Generates distribution plots for three outcome variables, including nominal distributions for Visits and Visits with Samples, as well as a continuous distribution for Prescriptions. It also applies a local data filter to the data.
Code:
// Distribution Plots for Three Outcome Variables
Distribution(
Automatic Recalc( 1 ),
Nominal Distribution(
Column( :Visits )
),
Nominal Distribution(
Column( :Visits with Samples )
),
Continuous Distribution(
Column( :Prescriptions )
),
Local Data Filter(
Location( {56, 74} ),
Mode,
Add Filter(
columns(
Transform Column(
"Month",
Ordinal,
Formula(
Month( :Date )
)
)
)
)
)
);
Code Explanation:
- Create distribution plots.
- Enable automatic recalculation.
- Plot nominal distribution for Visits.
- Plot nominal distribution for Visits with Samples.
- Plot continuous distribution for Prescriptions.
- Add local data filter.
- Set filter location.
- Set filter mode.
- Add filter for transformed Month column.
- Define transformation formula for Month.
Example 162
Summary: This script fits a linear model using the EMS method with interactions and random effects to analyze the 'Center' column in a data table, utilizing the Distribution platform.
Code:
//
Distribution(
Nominal Distribution(
Column( :Center )
)
);
Code Explanation:
- Open script.
- Launch Distribution platform.
- Select Nominal Distribution option.
- Analyze "Center" column.
Example 163
Summary: Opens a data table, sets automatic recalculation on, and analyzes various columns using the EMS method with interactions and random effects, displaying histograms only.
Code:
// Distribution
Distribution(
Automatic Recalc( 1 ),
Continuous Distribution(
Column( :Run order )
),
Continuous Distribution(
Column( :A )
),
Continuous Distribution(
Column( :B )
),
Continuous Distribution(
Column( :C )
),
Nominal Distribution(
Column( :Reagent Type )
),
Continuous Distribution(
Column( :Conversion ),
Capability Analysis( 0 )
),
Histograms Only
);
Code Explanation:
- Open distribution analysis.
- Set automatic recalculation on.
- Analyze Run order column.
- Analyze A column.
- Analyze B column.
- Analyze C column.
- Analyze Reagent Type column.
- Analyze Conversion column with capability analysis.
- Display histograms only.
- End distribution analysis.
Example 164
Summary: Generates a distribution analysis for three columns (Priority, Age, and Open locations) using the SendToReport function in JMP. It customizes the colors of the histograms and sets line and fill colors for each column.
Code:
// Distribution (Priority, Age of Defect in Days, Open Loc)
Distribution(
Nominal Distribution(
Column( :Priority )
),
Continuous Distribution(
Column(
:"Age(days) since reported"n
)
),
Nominal Distribution(
Column( :Open locations )
),
SendToReport(
Dispatch( {"Priority"},
"Distrib Nom Hist", FrameBox,
{
DispatchSeg(
Hist Seg( 1 ),
{
Line Color(
{112, 79, 56}
),
Fill Color(
"Light Orange"
)}
)}
),
Dispatch(
{"Age(days) since reported"},
"Distrib Histogram", FrameBox,
{
DispatchSeg(
Hist Seg( 1 ),
{
Line Color(
{58, 110, 110}
),
Fill Color(
"Medium Light Cyan"
)}
)}
),
Dispatch( {"Open locations"},
"Distrib Nom Hist", FrameBox,
{
DispatchSeg(
Hist Seg( 1 ),
{
Line Color(
{87, 56, 112}
),
Fill Color(
"Light Purple"
)}
)}
)
)
);
Code Explanation:
- Create distribution analysis.
- Analyze Priority column.
- Analyze Age column.
- Analyze Open locations column.
- Customize Priority histogram colors.
- Set Priority line color.
- Set Priority fill color.
- Customize Age histogram colors.
- Set Age line color.
- Set Age fill color.
Example 165
Summary: Fits a linear model using the EMS method with interactions and random effects, utilizing the Distribution platform to visualize the critical flag distribution.
Code:
// 01. Distribution Critical
Distribution(
Nominal Distribution(
Column( :CRITICAL FLAG ),
Order By( "Count Ascending" )
),
Histograms Only
);
Code Explanation:
- Open Distribution dialog.
- Select Nominal Distribution.
- Choose CRITICAL FLAG column.
- Order by Count Ascending.
- Display only Histograms.
Example 166
Summary: Fits a linear model using the EMS method with interactions and random effects to analyze the 'RECORD DATE-GRADE DATE' column in the provided data table.
Code:
// 04. Inspection Latency
Distribution(
Continuous Distribution(
Column(
:"RECORD DATE-GRADE DATE"n
)
)
);
Code Explanation:
- Open distribution analysis.
- Select continuous distribution.
- Choose column for analysis.
- Analyze "RECORD DATE-GRADE DATE"n.
Example 167
Summary: This JSL script distributes a nominal variable :BORO based on its count in ascending order, providing an interactive visualization of the distribution.
Code:
// 07. Distribution of BORO
Distribution(
Nominal Distribution(
Column( :BORO ),
Order By( "Count Ascending" )
)
);
Code Explanation:
- Launch Distribution platform.
- Select Nominal Distribution option.
- Specify column :BORO.
- Set order by Count Ascending.
Example 168
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing various columns in a data table and displaying histograms only.
Code:
// Distribution
Distribution(
Arrange in Rows( 3 ),
Nominal Distribution(
Column( :Car )
),
Continuous Distribution(
Column( :Year )
),
Continuous Distribution(
Column( :New Price )
),
Continuous Distribution(
Column( :Current Price )
),
Continuous Distribution(
Column( :Maintenance )
),
Continuous Distribution(
Column( :Decline Amount )
),
Continuous Distribution(
Column( :Decline Percent )
),
Continuous Distribution(
Column( :Percent Paid )
),
Continuous Distribution(
Column( :Net Used Value )
),
Histograms Only
);
Code Explanation:
- Create distribution analysis.
- Arrange in 3 rows.
- Analyze Car column.
- Analyze Year column.
- Analyze New Price column.
- Analyze Current Price column.
- Analyze Maintenance column.
- Analyze Decline Amount column.
- Analyze Decline Percent column.
- Analyze Percent Paid column.
- Analyze Net Used Value column.
- Display histograms only.
Example 169
Summary: Analyze height data with a continuous distribution, enabling normal quantile plots and outlier box plots, while filtering weight values between 65 and 125.
Code:
Open("data_table.jmp");
Distribution(
Automatic Recalc( 1 ),
Continuous Distribution( Column( :height ), Quantiles( 0 ), Summary Statistics( 0 ), Outlier Box Plot( 0 ), Normal Quantile Plot( 1 ) ),
Local Data Filter( Add Filter( columns( :weight ), Where( :weight >= 65 & :weight <= 125 ) ) )
);
Code Explanation:
- Open data table;
- Launch Distribution platform.
- Enable automatic recalculation.
- Analyze height column.
- Disable quantiles calculation.
- Disable summary statistics.
- Disable outlier box plot.
- Enable normal quantile plot.
- Add local data filter.
- Filter weight between 65 and 125.
Example 170
Summary: Opens a data table, initiates a Distribution analysis for the 'weight' column, and generates a CDF plot with custom scaling.
Code:
Open("data_table.jmp");
Distribution(
Continuous Distribution(
Column( :weight ),
Quantiles( 0 ),
Summary Statistics( 0 ),
Histogram( 0 ),
Vertical( 0 ),
Outlier Box Plot( 0 ),
CDF Plot( 1 )
),
SendToReport( Dispatch( {"weight", "CDF Plot"}, "2", ScaleBox, {Min( 0 ), Max( 1 ), Inc( 0.2 ), Minor Ticks( 1 )} ) )
);
Code Explanation:
- Open data table.
- Initiate Distribution analysis.
- Select continuous distribution.
- Analyze weight column.
- Disable quantiles display.
- Disable summary statistics.
- Disable histogram display.
- Disable vertical plot.
- Disable outlier box plot.
- Enable CDF plot.
Example 171
Summary: Opens a data table and fits a normal distribution to the PMS1 column using the Distribution platform in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Continuous Distribution( Column( :PMS1 ), Fit Distribution( Normal ) ) );
Code Explanation:
- Open data table;
- Assign dataset to variable
dt. - Create distribution object.
- Specify continuous distribution.
- Select column PMS1.
- Fit normal distribution.
- Assign result to variable
obj.
Example 172
Summary: Opens a data table, fits a linear model using the EMS method with interactions and random effects, and dispatches to a scale box for visualization.
Code:
Open("data_table.jmp");
Distribution(
Continuous Distribution( Column( :weight ) ),
Nominal Distribution( Column( :age ) ),
SendToReport(
Dispatch( {"weight"}, "1", ScaleBox,
{Scale( "Log", {Log( 2 )} ), Format( "Best", 12 ), Min( 60 ), Max( 200 ), Inc( 1 ), Minor Ticks( 1 )}
)
)
);
Code Explanation:
- Open data table;
- Launch Distribution platform.
- Analyze weight column continuously.
- Analyze age column nominally.
- Send report to current window.
- Dispatch to "weight" scale box.
- Set scale to log base 2.
- Format numbers as best with 12 digits.
- Set axis minimum to 60.
- Set axis maximum to 200.
Example 173
Summary: Performs the distribution analysis of adverse reactions using a nominal distribution platform with histogram display and mosaic plot configuration.
Code:
Open("data_table.jmp");
Distribution( Nominal Distribution( Column( :ADVERSE REACTION ), Histogram( 0 ), Mosaic Plot( 1 ) ) );
Code Explanation:
- Open data table;
- Launch Distribution platform.
- Select Nominal Distribution option.
- Choose ADVERSE REACTION column.
- Enable Histogram display.
- Disable Mosaic Plot display.
Example 174
Summary: Analyze weight distribution for males in a data table, utilizing the Distribution platform to create a continuous and nominal distribution model.
Code:
dt = Open("data_table.jmp");
dist = dt << Distribution( Continuous Distribution( Column( :weight ) ), Nominal Distribution( Column( :age ) ), Where( :sex == "M" ) );
app = JMP App();
Code Explanation:
- Open data table;
- Create distribution analysis.
- Analyze weight for males.
- Analyze age for males.
- Launch JMP application.
Example 175
Summary: Creates a distribution analysis report for male subjects, combining continuous and nominal distributions with filtering by sex.
Code:
dt = Open("data_table.jmp");
dist = dt << Distribution( Continuous Distribution( Column( :weight ) ), Nominal Distribution( Column( :age ) ), Where( :sex == "M" ) );
app = JMP App();
app << Combine Windows( {Report( dist )} );
Code Explanation:
- Open data table.
- Create distribution analysis.
- Specify continuous column for weight.
- Specify nominal column for age.
- Filter data for male sex.
- Create JMP application object.
- Combine windows into one report.
Example 176
Summary: Creates a distribution analysis with automatic recalculation, analyzing continuous weight and nominal age columns, and applying a local data filter for ages 12 and 17.
Code:
dt = Open("data_table.jmp");
Distribution(
Automatic Recalc( 1 ),
Continuous Distribution( Column( :weight ) ),
Nominal Distribution( Column( :age ) ),
Local Data Filter(
Inverse( 1 ),
Add Filter( columns( :age ), Where( :age == {12, 17} ), Display( :age, Size( 160, 90 ), List Display ) )
)
);
Code Explanation:
- Open data table.
- Create distribution analysis.
- Enable automatic recalculation.
- Analyze continuous weight column.
- Analyze nominal age column.
- Add local data filter.
- Set filter inversion.
- Add filter for age column.
- Filter ages 12 and 17.
- Display age filter.
Example 177
Summary: Analyze a data table by creating a distribution analysis with automatic recalculation, filtering weight between 64 and 130, and displaying normal quantile plots.
Code:
Open("data_table.jmp");
Distribution(
Automatic Recalc( 1 ),
Continuous Distribution( Column( :height ), Quantiles( 0 ), Summary Statistics( 0 ), Outlier Box Plot( 0 ), Normal Quantile Plot( 1 ) ),
Local Data Filter( Add Filter( columns( :weight ), Where( :weight >= 64 & :weight <= 130 ) ) )
);
Code Explanation:
- Open data_table data
- Create distribution analysis.
- Set automatic recalculation on.
- Analyze height column.
- Disable quantiles display.
- Disable summary statistics display.
- Disable outlier box plot.
- Enable normal quantile plot.
- Add local data filter.
- Filter weight between 64 and 130.
Example 178
Summary: Fits a normal distribution to a continuous column, with automatic recalculation and local data filtering by MW range.
Code:
Open("data_table.jmp");
Distribution(
Automatic Recalc( 1 ),
Continuous Distribution( Column( :Steam Flow ), Fit Distribution( Normal ) ),
Local Data Filter( Add Filter( columns( :MW ), Where( :MW >= 20.1112 & :MW <= 21.78 ) ) )
);
Code Explanation:
- Open data table.
- Create distribution analysis.
- Enable automatic recalculation.
- Analyze continuous column.
- Fit normal distribution.
- Add local data filter.
- Filter by MW range.
- Set MW lower bound.
- Set MW upper bound.
- Display filtered results.
Example 179
Summary: Performs the distribution analysis of a data table, filtering sports data for Basketball and Tennis using Local Data Filter and displaying the filtered results.
Code:
Open("data_table.jmp");
Distribution(
Multiple Response Distribution( Column( :sports ) ),
Local Data Filter(
Add Filter(
columns( :sports ),
Match Any( Where( :sports == {"Basketball", "Tennis"} ) ),
Display( :sports, Find( Set Text( "" ) ) )
)
)
);
Code Explanation:
- Open data table.
- Create distribution analysis.
- Set multiple response column.
- Add local data filter.
- Specify filter columns.
- Match basketball and tennis.
- Display sports column.
- Clear filter text.
Example 180
Summary: Performs a distribution analysis with automatic recalculation for Alaska, weighted by population, and filtered locally for ID column in the specified data table.
Code:
Open("data_table.jmp");
Distribution(
SendToByGroup( Bygroup Default ),
Stack( 1 ),
SendToByGroup( {:Region == "Alaska"}, Automatic Recalc( 1 ) ),
Weight( :Population ),
Nominal Distribution( Column( :Year ), Horizontal Layout( 1 ), Vertical( 0 ) ),
By( :Region ),
SendToByGroup( {:Region == "Alaska"}, Local Data Filter( Add Filter( columns( :ID ), Where( :ID == 0 ) ) ) )
);
Code Explanation:
- Open data table;
- Initiate Distribution analysis.
- Set default grouping.
- Stack data for analysis.
- Apply automatic recalculation for Alaska.
- Weight data by population.
- Analyze Year column distribution.
- Group results by Region.
- Filter Alaska data locally.
- Apply filter to ID column.
Example 181
Summary: Performs the distribution analysis of investigation types with automatic recalculation, nominal distribution, and local data filtering by event date.
Code:
Open("data_table.jmp");
Distribution(
Automatic Recalc( 1 ),
Nominal Distribution( Column( :Investigation Type ) ),
Local Data Filter( Add Filter( columns( :Event Date ) ) )
);
Code Explanation:
- Open data table;
- Create distribution analysis.
- Enable automatic recalculation.
- Analyze nominal distribution.
- Select investigation type column.
- Add local data filter.
- Filter by event date column.
Example 182
Summary: Analyze a data table by fitting a linear model using the EMS method with interactions and random effects, while also creating a mosaic plot for age and filtering local data.
Code:
Open("data_table.jmp");
Distribution(
Automatic Recalc( 1 ),
Continuous Distribution( Column( :weight ) ),
Nominal Distribution( Column( :age ), Mosaic Plot( 1 ) ),
Local Data Filter(
Inverse( 1 ),
Add Filter( columns( :age ), Where( :age == {12, 17} ), Display( :age, Size( 160, 90 ), List Display ) )
)
);
Code Explanation:
- Open data table.
- Launch Distribution platform.
- Enable automatic recalculation.
- Analyze weight with continuous distribution.
- Analyze age with nominal distribution.
- Create mosaic plot for age.
- Add local data filter.
- Invert filter logic.
- Filter age for 12 and 17.
- Display filtered age list.
Example 183
Summary: Performs the distribution analysis of a nominal variable, generating a report with customized layout and visualizations.
Code:
Open("data_table.jmp");
Distribution(
Nominal Distribution( Column( :age ) ),
SendToReport(
Dispatch( {"age", "Frequencies"}, "Count", NumberColBox,
{Background Color( "Light Yellow" ), Text Color( "Dark Blue" ), Set Heading( "Count" )}
)
)
);
Code Explanation:
- Open data table;
- Create distribution analysis.
- Analyze age column.
- Customize report layout.
- Change count background color.
- Set count text color.
- Rename count heading.
Example 184
Summary: Analyzes and creates reports for distribution statistics for a specified column in a JMP data table, utilizing the Distribution platform to generate reports with customizable list boxes.
Code:
dt = Open("data_table.jmp");
d = dt << Distribution( Column( :height ) );
r = d << report;
lb = r[List Box( 6 )];
lb << Set Horizontal( 1 );
lb = r[List Box( 7 )];
Code Explanation:
- Open data table;
- Create distribution analysis for height.
- Retrieve report object.
- Select sixth ListBox.
- Set ListBox horizontal.
- Select seventh ListBox.
Example 185
Summary: Generates a report with two list boxes, one set to horizontal and another with a border, using data from an open JMP data table.
Code:
dt = Open("data_table.jmp");
d = dt << Distribution( Column( :height ) );
r = d << report;
lb = r[List Box( 6 )];
lb << Set Horizontal( 1 );
lb = r[List Box( 7 )];
lb << Border( 1 );
Code Explanation:
- Open data table;
- Generate distribution for height.
- Retrieve report object.
- Access 6th List Box.
- Set List Box horizontal.
- Access 7th List Box.
- Add border to List Box.
Example 186
Summary: Configures a report object with list boxes and alignment settings for data visualization in JMP.
Code:
Names Default To Here( 1 );
dt = Open("data_table.jmp");
d = dt << Distribution( Column( :height ) );
r = d << report;
lb = r[List Box( 6 )];
lb << Set Horizontal( 1 );
lb = r[List Box( 7 )];
lb << Vertical Alignment( "Bottom" );
Code Explanation:
- Set default names.
- Open data table;
- Create distribution for height.
- Retrieve report object.
- Select 6th List Box.
- Set horizontal alignment.
- Select 7th List Box.
- Set vertical alignment to bottom.
Example 187
Summary: Analyze a continuous distribution in a data table, generating summary statistics and sorting quantiles for visualization.
Code:
dt under test = Open("data_table.jmp");
obj = Distribution(
Continuous Distribution( Column( :weight ), Summary Statistics( 0 ) ),
SendToReport( Dispatch( {"Distributions", "weight", "Quantiles"}, "", TableBox, {Sort By Column( 2, 0 )} ) )
);
Code Explanation:
- Open table.
- Create distribution object.
- Analyze weight column.
- Display summary statistics.
- Sort quantiles table.
Example 188
Summary: Performs the distribution analysis of a continuous weight column, enabling automatic recalculation and customizing the scale box with a logistic percent transformation.
Code:
dt = Open("data_table.jmp");
Distribution(
Automatic Recalc( 1 ),
Continuous Distribution( Column( :weight ) ),
SendToReport( Dispatch( {"weight"}, "1", ScaleBox, {Format( "Custom", Formula( Round( Logist Percent( value / 200 ), 2 ) ), 12 )} ) )
);
Code Explanation:
- Open data table;
- Initiate Distribution analysis.
- Enable automatic recalculation.
- Analyze continuous weight column.
- Customize weight scale box.
- Set custom format formula.
- Apply logistic percent transformation.
- Divide value by 200.
- Round result to 2 decimal places.
- Display formatted values in scale.
Example 189
Summary: Performs the distribution analysis of the 'age' column using a Nominal Distribution with horizontal layout, count axis, and automatic recalculation.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution(
Nominal Distribution( Column( :age ), Horizontal Layout( 1 ), Count Axis( 1 ), Show Counts( 1 ), Frequencies( 0 ) ),
Automatic Recalc( 1 )
);
Code Explanation:
- Open data table;
- Create distribution object.
- Analyze age column.
- Use horizontal layout.
- Set count axis.
- Display counts.
- Hide frequencies.
- Enable automatic recalculation.
Example 190
Summary: Creates a nominal distribution plot with automatic recalculation, displaying counts on the left axis.
Code:
Names Default To Here( 1 );
dt = Open("data_table.jmp");
obj = dt << Distribution(
Nominal Distribution( Column( :age ), Horizontal Layout( 1 ), Count Axis( 1 ), Show Counts( 1 ), Frequencies( 0 ) ),
Automatic Recalc( 1 )
);
obj << Axes on Left( 1 );
Code Explanation:
- Set default names.
- Open data table;
- Create distribution object.
- Specify nominal distribution.
- Set horizontal layout.
- Enable count axis.
- Show counts.
- Disable frequencies.
- Enable automatic recalculation.
- Set axes on left.
Example 191
Summary: Performs the distribution analysis of a multiple response column in JMP, generating histograms only and sending the report to output with pin annotation.
Code:
Open("data_table.jmp");
Distribution(
Multiple Response Distribution( Column( :sports ) ),
Histograms Only,
SendToReport(
Dispatch( {"sports"}, "Distrib Nom Hist", FrameBox,
Add Pin Annotation(
Seg( Hist Seg( 1 ) ),
Index( {8, 9} ),
Index Row( {8, 9} ),
UniqueID( 498010648 ),
FoundPt( {152, 302} ),
Origin( {0.00625, 8.32424242424242} )
)
)
)
);
Code Explanation:
- Open data table.
- Create distribution analysis.
- Select multiple response column.
- Display histograms only.
- Send report to output.
- Dispatch to "sports" histogram.
- Add pin annotation.
- Specify segment for annotation.
- Define index points.
- Set unique ID and found point.
Example 192
Summary: Analyze age distribution by sex, filtering for female group and applying height filter, with interactive features like Local Data Filter and By Group.
Code:
Open("data_table.jmp");
Distribution(
SendToByGroup( {:sex == "F"} ),
Nominal Distribution( Column( :age ), Frequencies( 0 ) ),
By( :sex ),
Group Options( Local Data Filter( Add Filter( columns( :height ), Where( :height >= 60 ) ) ) ),
Automatic Recalc( 1 ),
SendToByGroup(
{:sex == "F"},
SendToReport(
Dispatch( {"age"}, "Distrib Nom Hist", FrameBox,
{Set Graphlet(
Picture(
Try(
loader = If( Class Exists( "hllLoader" ),
New Object( "hllLoader" ),
Include( "$BUILTIN_SCRIPTS/hllib.jsl" )
);
loader:setDebug( 0 );
hlp = loader:lazyLoad( "hllPresets" );
hlp:launchMarker();
)
),
Title( "Marker Preset" ),
Reapply( 1 )
), Add Pin Annotation(
Seg( Hist Seg( 1 ) ),
Index( {0, 1} ),
Index Row( 1 ),
UniqueID( 0 ),
FoundPt( {301, 341} ),
Origin( {0.0571428571428572, 0.149819494584838} ),
Offset( {-283, 80} ),
RightOfCenter( 0 ),
Tag Line( 1 )
)}
)
)
),
SendToByGroup(
{:sex == "M"},
SendToReport(
Dispatch( {"age"}, "Distrib Nom Hist", FrameBox,
{Set Graphlet(
Picture(
Try(
loader = If( Class Exists( "hllLoader" ),
New Object( "hllLoader" ),
Include( "$BUILTIN_SCRIPTS/hllib.jsl" )
);
loader:setDebug( 0 );
hlp = loader:lazyLoad( "hllPresets" );
hlp:launchMarker();
,
Write(
"
Hover Label: Unable to launch Preset, please check that the Preset library is
available at $BUILTIN_SCRIPTS/hllib.jsl"
);
Write( Eval Insert( "
Exception: ^exception_msg^" ) );
Empty();
)
),
Title( "Marker Preset" ),
Reapply( 1 )
)}
)
)
)
);
Code Explanation:
- Open data table.
- Create distribution analysis.
- Filter for female group.
- Analyze age distribution.
- Group by sex.
- Apply height filter.
- Automatically recalculate results.
- Set graphlet for female group.
- Add pin annotation for female group.
- Set graphlet for male group.
Example 193
Summary: Creates a distribution analysis for GDP per Capita, utilizing the EMS method to fit a linear model with interactions and random effects.
Code:
Open("data_table.jmp");
Distribution(
Continuous Distribution( Column( :GDP per Capita ), Quantiles( 0 ), Summary Statistics( 0 ), Vertical( 0 ) ),
SendToReport(
Dispatch( {"GDP per Capita"}, "Distrib Outlier Box", FrameBox,
{Add Pin Annotation(
Seg( Box Plot Seg( 1 ) ),
Index( {1, 1} ),
Index Row( -1 ),
UniqueID( 1 ),
FoundPt( {69, 92} ),
Origin( {3840.62058884895, 0.45304347826087} ),
Offset( {-2, 84} ),
RightOfCenter( 0 ),
Tag Line( 1 )
), Add Pin Annotation(
Seg( Marker Seg( 1 ) ),
Index( 159 ),
Index Row( 159 ),
UniqueID( 159 ),
FoundPt( {181, 90} ),
Origin( {56475.3527566223, 0.5} ),
RightOfCenter( 0 ),
Tag Line( 1 )
)}
)
)
);
Code Explanation:
- Open data table;
- Create distribution analysis.
- Select GDP per Capita column.
- Configure continuous distribution settings.
- Send report to JMP.
- Dispatch Distrib Outlier Box frame.
- Add pin annotation for box plot segment.
- Set pin annotation properties.
- Add another pin annotation for marker segment.
- Set second pin annotation properties.
Example 194
Summary: Analyze and visualize continuous weight data with nominal age information, generating a histogram with pin annotation for specific index points.
Code:
Open("data_table.jmp");
Distribution(
Continuous Distribution( Column( :weight ) ),
Nominal Distribution( Column( :age ) ),
SendToReport(
Dispatch( {"weight"}, "Distrib Histogram", FrameBox,
Add Pin Annotation(
Seg( Hist Seg( 1 ) ),
Index( {36, 48} ),
Index Row( {36, 48} ),
UniqueID( 36 ),
FoundPt( {105, 182} ),
Origin( {0.003675, 128.752622867495} ),
RightOfCenter( 0 ),
Tag Line( 1 )
)
)
)
);
Code Explanation:
- Open data table.
- Create distribution analysis.
- Analyze continuous weight column.
- Analyze nominal age column.
- Send report to analysis.
- Dispatch to weight histogram.
- Add pin annotation to frame.
- Segment histogram for annotation.
- Set index for annotation points.
- Configure annotation properties.
Example 195
Summary: Analyze a data table by fitting a linear model using the EMS method with interactions and random effects, displaying histograms only for Region, Country, and Year variables.
Code:
Open("data_table.jmp");
Distribution(
Weight( :Pop ),
Nominal Distribution( Column( :Region ) ),
Nominal Distribution( Column( :Country ) ),
Continuous Distribution( Column( :Year ) ),
Histograms Only,
SendToReport(
Dispatch( {"Region"}, "Distrib Nom Hist", FrameBox,
Add Pin Annotation(
Seg( Hist Seg( 1 ) ),
Index( {8, 9} ),
Index Row( {8, 9} ),
UniqueID( 580058520 ),
FoundPt( {136, 131} ),
Origin( {0, 7.79963898916967} )
)
),
Dispatch( {"Country"}, "Distrib Nom Hist", FrameBox,
Add Pin Annotation(
Seg( Hist Seg( 1 ) ),
Index( {79, 80} ),
Index Row( {79, 80} ),
UniqueID( 583209551 ),
FoundPt( {509, 436} ),
Origin( {0.00245193647255503, 78.5188034188034} )
)
),
Dispatch( {"Year"}, "Distrib Histogram", FrameBox,
Add Pin Annotation(
Seg( Hist Seg( 1 ) ),
Index( {0, 12} ),
Index Row( {0, 12} ),
UniqueID( 586405056 ),
FoundPt( {709, 318} ),
Origin( {0.00436333240456952, 1951.19374682324} )
)
)
)
);
Code Explanation:
- Open data table;
- Create distribution analysis.
- Set weight for population.
- Analyze region nominal distribution.
- Analyze country nominal distribution.
- Analyze year continuous distribution.
- Display histograms only.
- Add pin annotation to Region histogram.
- Add pin annotation to Country histogram.
- Add pin annotation to Year histogram.
Example 196
Summary: Creates a Distribution analysis with local data filtering by age, summarizing the height column using the EMS method.
Code:
Open("data_table.jmp");
Distribution(
Continuous Distribution( Column( :height ), Quantiles( 0 ), Summary Statistics( 0 ) ),
Local Data Filter( Add Filter( columns( :age ) ) )
);
Code Explanation:
- Open data table;
- Create Distribution analysis.
- Analyze height column.
- Disable quantiles display.
- Disable summary statistics.
- Add local data filter.
- Filter by age column.
Example 197
Summary: Analyze and visualize continuous data in a JMP distribution, including customization of box plot appearance and removal of outlier fences.
Code:
Open("data_table.jmp");
Distribution(
Continuous Distribution( Column( :weight ) ),
SendToReport(
Dispatch( {"weight"}, "Distrib Outlier Box", FrameBox, {DispatchSeg( Box Plot Seg( 1 ), {Fences( 0 ), Line Width( 3 )} )} ),
Dispatch( {"weight"}, "Quantiles", OutlineBox, {Close( 1 )} ),
Dispatch( {"weight"}, "Summary Statistics", OutlineBox, {Close( 1 )} )
)
);
Code Explanation:
- Open data table;
- Create distribution analysis.
- Analyze continuous weight column.
- Customize boxplot appearance.
- Remove outlier fences.
- Set box plot line width to 3.
- Close quantiles outline.
- Close summary statistics outline.
Example 198
Summary: Performs the distribution analysis for a continuous variable, displaying percents and counts using column properties in JMP.
Code:
Open("data_table.jmp");
Distribution( Continuous Distribution( Column( :Price ), Always use column properties( 1 ), Show Percents( 1 ), Show Counts( 1 ) ) );
Code Explanation:
- Open data table;
- Launch Distribution platform.
- Select Price column.
- Use column properties.
- Show percents.
- Show counts.
Example 199
Summary: Creates a distribution analysis for height and weight columns, grouped by sex and filtered for age 13 or 15.
Code:
dt = Open("data_table.jmp");
dt << Distribution(
Continuous Distribution( Column( :height ) ),
Continuous Distribution( Column( :weight ) ),
By( :sex ),
Where( :age == 13 | :age == 15 )
);
Code Explanation:
- Open data table.
- Create distribution analysis.
- Analyze height column.
- Analyze weight column.
- Group by sex.
- Filter for age 13 or 15.
Example 200
Summary: Generates a distribution report for nominal column :age, filtering data for age 12 or 13.
Code:
Open("data_table.jmp");
Distribution( Nominal Distribution( Column( :age ) ), Where( :age == 12 | :age == 13 ) );
Code Explanation:
- Open data table;
- Generate distribution report.
- Analyze nominal column :age.
- Filter for age 12 or 13.
Example 201
Summary: Fits a linear model using the EMS method with interactions and random effects to analyze the relationship between weight and sex in a dataset.
Code:
Open("data_table.jmp") << Distribution( Continuous Distribution( Column( :weight ) ), By( :sex ) );
Code Explanation:
- Open data table;
- Generate distribution analysis.
- Analyze weight column.
- Group by sex variable.
Example 202
Summary: Creates a distribution analysis with multiple response variables, grouped by sex and arranged in rows, using the Distribution platform.
Code:
dt = Open("data_table.jmp");
grp = dt << Distribution(
Nominal Distribution( Column( :age ) ),
Multiple Response Distribution( Column( :sports ) ),
By( :sex ),
Group Options( Layout( "Arrange in Rows" ), N Across( 3 ), Return Group( 1 ) )
);
Code Explanation:
- Open data table.
- Create distribution analysis.
- Analyze age column.
- Analyze sports column.
- Group by sex.
- Arrange groups in rows.
- Set 3 columns per row.
- Return first group.
Example 203
Summary: Analyze and visualize population age distribution in Central America, utilizing a Distribution platform with column switcher and local data filter.
Code:
dt = Open("data_table.jmp");
dist = dt << Distribution(
Continuous Distribution( Column( :"Pop Age 0-19"n ), Always use column properties( 1 ) ),
Local Data Filter( Add Filter( columns( :Region ), Where( :Region == "Central America" ), Display( :Region, N Items( 11 ) ) ) ),
Column Switcher( :"Pop Age 0-19"n, {:Pop, :"Pop Age 0-19"n, :"Pop Age 20-59"n, :"Pop Age 60+"n} )
);
Report( dist ) << Save Window Report( "$TEMP/filterswitcher.jrp", embed data( 0 ) );
Report( dist ) << Close Window;
Code Explanation:
- Open data table;
- Create distribution analysis.
- Analyze "Pop Age 0-19" column.
- Enable column properties.
- Add local data filter.
- Filter by Region: Central America.
- Display 11 items for Region.
- Add column switcher.
- Switch between population age columns.
- Save report to filterswitcher.jrp.
- Close the report window.
Example 204
Summary: Creates a distribution analysis with a continuous distribution, local data filter, and column switcher to visualize population age distribution in Central America.
Code:
dt = Open("data_table.jmp");
dist = dt << Distribution(
Continuous Distribution( Column( :"Pop Age 0-19"n ), Always use column properties( 1 ) ),
Local Data Filter( Add Filter( columns( :Region ), Where( :Region == "Central America" ), Display( :Region, N Items( 11 ) ) ) ),
Column Switcher( :"Pop Age 0-19"n, {:Pop, :"Pop Age 0-19"n, :"Pop Age 20-59"n, :"Pop Age 60+"n} )
);
Report( dist ) << Save Window Report( "$TEMP/filterswitcher.jrp", embed data( 0 ) );
Report( dist ) << Close Window;
Open( "$TEMP/filterswitcher.jrp" );
Code Explanation:
- Open table.
- Create distribution analysis.
- Add continuous distribution.
- Set column properties.
- Add local data filter.
- Set filter criteria.
- Add column switcher.
- Save report window.
- Close report window.
- Open saved report.
Example 205
Summary: Analyze and visualize multiple columns in a JMP data table, including CDF plots, quantile box plots, standard error bars, and density axes.
Code:
dt under test = Open("data_table.jmp");
obj = Distribution(
Continuous Distribution( Column( :CD3 ), CDF Plot( 1 ) ),
Continuous Distribution( Column( :CD8 ), Vertical( 0 ), Normal Quantile Plot( 1 ) ),
Continuous Distribution( Column( :MCB ), Quantile Box Plot( 1 ) ),
Continuous Distribution( Column( :Prin1 ), Std Error Bars( 1 ), Capability Analysis( LSL( -2 ), USL( 2 ), Target( 0 ) ) ),
Continuous Distribution( Column( :Prin2 ), Count Axis( 1 ), Prob Axis( 1 ), Density Axis( 1 ), Fit Distribution( Normal ) ),
SendToReport(
Dispatch( {"Distributions", "CD3"}, "Distrib Histogram", FrameBox, {DispatchSeg( Hist Seg( 1 ), Bin Span( 24, 0 ) )} ),
Dispatch( {"Distributions", "CD8"}, "5", ScaleBox,
{Scale( "Normal" ), Min( 0.00015996800639872 ), Max( 0.999840031993601 ), Inc( 0 ), Minor Ticks( 0 ), Show Major Grid( 1 )}
),
Dispatch( {"Distributions", "MCB"}, "1", ScaleBox,
{Scale( "Log" ), Format( "Fixed Dec", 10, 6 ), Min( 1 ), Max( 2000 ), Inc( 1 ), Minor Ticks( 1 )}
),
)
);
Code Explanation:
- Open data table.
- Create distribution analysis object.
- Analyze CD3 column with CDF plot.
- Analyze CD8 column with vertical orientation and normal quantile plot.
- Analyze MCB column with quantile box plot.
- Analyze Prin1 column with standard error bars and capability analysis.
- Analyze Prin2 column with count, probability, and density axes, fit normal distribution.
- Adjust CD3 histogram bin span to 24.
- Set CD8 scale to normal, min, max, and grid settings.
- Set MCB scale to log, format, min, max, and minor ticks.
Example 206
Summary: Creates a distribution object for the CO column in a data table, utilizing the Distribution platform in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Column( :CO ) );
Code Explanation:
- Open data table;
- Create distribution object for CO column.
Example 207
Summary: Fits a LogNormal distribution to the CO column in a data table, enabling density curve and goodness of fit analysis with fixed sigma parameter at 0.2.
Code:
dt under test = Open("data_table.jmp");
obj = dt under test << Distribution( Column( :CO ) );
obj << Fit Distribution(
LogNormal(
Density Curve( 1 ),
Goodness of Fit( 1 ),
Fix Parameters( sigma( 0.2 ) ),
Quantiles( 0.05, 0.95 ),
Set Spec Limits for KSigma( 3 )
)
);
Code Explanation:
- Open data table.
- Create distribution object for CO column.
- Fit LogNormal distribution.
- Enable density curve.
- Enable goodness of fit.
- Fix sigma parameter to 0.2.
- Calculate quantiles at 0.05 and 0.95.
- Set specification limits for 3 sigma.
Example 208
Summary: Runs a comprehensive analysis of the continuous distribution for :y, including frequency plots, quantile box plots, normal quantile plots, and stem and leaf plots, while fitting various distributions and calculating summary statistics.
Code:
dt under test = Open("data_table.jmp");
obj = Distribution(
Freq( :x ),
Continuous Distribution(
Column( :y ),
Show Counts( 1 ),
Quantile Box Plot( 1 ),
Normal Quantile Plot( 1 ),
Stem and Leaf( 1 ),
CDF Plot( 1 ),
Fit Distribution( All ),
Fit Distribution( Poisson ),
Fit Distribution( GammaPoisson ),
Fit Distribution( Binomial( Sample Size( 100 ) ) ),
Fit Distribution( Beta Binomial( Sample Size( 100 ) ) ),
Tolerance Interval( Alpha( 0.95 ), Proportion( 0.9 ) ),
Confidence Interval( 0.95 ),
Prediction Interval( 0.95, 1 ),
Test Std Dev( 1 ),
Test Mean( 0, Wilcoxon Signed Rank( 1 ) ),
Custom Quantiles( 0.95, [1, 0.995, 0.975, 0.9, 0.75, 0.5, 0.25, 0.1, 0.025, 0.005, 0] ),
Customize Summary Statistics(
Sum Wgt( 1 ),
Sum( 1 ),
Variance( 1 ),
Skewness( 1 ),
Kurtosis( 1 ),
CV( 1 ),
N Missing( 1 ),
N Zero( 1 ),
N Unique( 1 ),
Uncorrected SS( 1 ),
Corrected SS( 1 ),
Median( 1 ),
Mode( 1 ),
Trimmed Mean( 1 ),
Geometric Mean( 1 ),
Range( 1 ),
Interquartile Range( 1 ),
Median Absolute Deviation( 1 ),
Show all modes( 1 )
),
Capability Analysis( LSL( 0.1 ), USL( 0.3 ), Target( 0.2 ), Sigma( 2 ), Subgroup Size( 5 ), Moving Range( 2 ) )
)
);
Code Explanation:
- Open data table;
- Create Distribution analysis object.
- Set frequency column to :x.
- Analyze continuous distribution for :y.
- Show counts in plots.
- Enable quantile box plot.
- Enable normal quantile plot.
- Enable stem and leaf plot.
- Enable CDF plot.
- Fit all distributions.
- Fit Poisson distribution.
- Fit GammaPoisson distribution.
- Fit Binomial distribution with sample size 100.
- Fit Beta Binomial distribution with sample size 100.
- Calculate tolerance interval with alpha 0.95 and proportion 0.9.
- Calculate confidence interval at 0.95 level.
- Calculate prediction interval at 0.95 level with 1 future observation.
- Test standard deviation.
- Test mean against 0 using Wilcoxon Signed Rank.
- Calculate custom quantiles.
- Customize summary statistics.
- Perform capability analysis with LSL 0.1, USL 0.3, target 0.2, sigma 2, subgroup size 5, and moving range 2.
Example 209
Summary: Creates a histogram for 'country' data, enabling vertical display, standard error bars, and separate bars with blue color, count axis, probability axis, and density axis.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Column( :country ), );
obj << Histogram( 1 );
obj << Vertical( 1 );
obj << Std Error Bars( 1 );
obj << Separate Bars( 1 );
obj << Histogram Color( Blue );
obj << Count Axis( 1 );
obj << Prob Axis( 1 );
obj << Density Axis( 1 );
obj << Show Percents( 1 );
Code Explanation:
- Open data table;
- Create distribution object for "country".
- Add histogram to object.
- Enable vertical display.
- Add standard error bars.
- Use separate bars.
- Set histogram color to blue.
- Enable count axis.
- Enable probability axis.
- Enable density axis.
- Show percents.
Example 210
Summary: Creates a histogram with standard error bars, separate bars for different categories, and interactive features to display counts and percents.
Code:
dt under test = Open("data_table.jmp");
obj = dt under test << Distribution( Column( :country ), );
obj << Histogram( 1 );
obj << Vertical( 1 );
obj << Std Error Bars( 1 );
obj << Separate Bars( 1 );
obj << Histogram Color( Blue );
obj << Count Axis( 1 );
obj << Prob Axis( 1 );
obj << Density Axis( 1 );
obj << Show Percents( 1 );
obj << Show Counts( 1 );
Code Explanation:
- Open data table;
- Create distribution object for country column.
- Add histogram to distribution object.
- Enable vertical orientation for histogram.
- Add standard error bars to histogram.
- Separate bars for different categories.
- Set histogram color to blue.
- Enable count axis.
- Enable probability axis.
- Enable density axis.
- Show percents on histogram.
- Show counts on histogram.
Example 211
Summary: Fits a linear model using the EMS method with interactions and random effects to analyze height and weight data, grouped by sex and filtered for age 13 or 15.
Code:
Open("data_table.jmp");
Distribution(
Continuous Distribution( Column( :height ) ),
Continuous Distribution( Column( :weight ) ),
By( :sex ),
Where( :age == 13 | :age == 15 )
);
Code Explanation:
- Open data table;
- Generate distribution analysis.
- Analyze height column.
- Analyze weight column.
- Group by sex.
- Filter for age 13 or 15.
Example 212
Summary: Creates a mosaic plot with reversed scale and cell labeling for age distribution, utilizing the Distribution platform in JMP.
Code:
Open("data_table.jmp");
Distribution(
Nominal Distribution( Column( :age ), Mosaic Plot( 1 ) ),
SendToReport(
Dispatch( {"age"}, "1", ScaleBox, {Reversed Scale} ),
Dispatch( {"age"}, "Distrib Mosaic", FrameBox, {DispatchSeg( MosaicSeg( 1 ), Cell Labeling( "Show Counts" ) )} )
)
);
Code Explanation:
- Open data table;
- Launch Distribution platform.
- Analyze age column.
- Create mosaic plot.
- Reverse scale for age.
- Show counts in cells.
- Send report to viewer.
Example 213
Summary: Performs the distribution analysis of a continuous column, displaying counts and configuring scale settings for visualization.
Code:
Open("data_table.jmp");
Distribution(
Continuous Distribution( Column( :weight ), Show Counts( 1 ), Outlier Box Plot( 0 ) ),
SendToReport( Dispatch( {"weight"}, "1", ScaleBox, {Min( 77.4098270332766 ), Max( 181.964353088835 ), Inc( 20 ), Minor Ticks( 1 )} ) )
);
Code Explanation:
- Open data table;
- Initiate Distribution analysis.
- Analyze continuous weight column.
- Display counts for weight.
- Disable outlier box plot.
- Send report to window.
- Configure weight scale settings.
- Set minimum weight value.
- Set maximum weight value.
- Define increment for weight scale.
Example 214
Summary: Creates a distribution analysis with multiple responses for the 'sports' column, utilizing a horizontal layout and disabling vertical display.
Code:
Open("data_table.jmp");
Distribution(
Multiple Response Distribution( Column( :sports ), Horizontal Layout( 1 ), Vertical( 0 ) ),
SendToReport(
Dispatch( {"sports"}, "Distrib Nom Hist", FrameBox,
{Set Graphlet(
Picture(
Try(
loader = If( Class Exists( "hllLoader" ),
New Object( "hllLoader" ),
Include( "$BUILTIN_SCRIPTS/hllib.jsl" )
);
loader:setDebug( 0 );
hlp = loader:lazyLoad( "hllPresets" );
hlp:launchMarker();
)
),
Title( "Marker Preset" ),
Reapply( 1 )
), {Add Pin Annotation(
Seg( Hist Seg( 1 ) ),
Index( {16, 17} ),
Index Row( {16, 17} ),
UniqueID( 1935747216 ),
FoundPt( {204, 111} ),
Origin( {15.7909090909091, 0.0598214285714286} ),
Offset( {76, 312} ),
RightOfCenter( 1 ),
Tag Line( 1 )
), Add Pin Annotation(
Seg( Hist Seg( 1 ) ),
Index( {5, 6} ),
Index Row( {5, 6} ),
UniqueID( 1935747205 ),
FoundPt( {96, 143} ),
Origin( {5.31818181818182, 0.03125} ),
Offset( {-86, 278} ),
RightOfCenter( 0 ),
Tag Line( 1 )
)}}
)
)
);
Code Explanation:
- Open data table;
- Create distribution analysis.
- Set multiple response for sports column.
- Configure horizontal layout.
- Disable vertical display.
- Initialize graphlet picture.
- Load necessary scripts.
- Set debug mode off.
- Lazy load presets.
- Launch marker preset.
Example 215
Summary: Performs the distribution analysis of lot_id in a data table, utilizing the Distribution platform to visualize the data.
Code:
Open("data_table.jmp");
Distribution( Y( :lot_id ) );
Code Explanation:
- Open data table;
- Create distribution analysis.
- Set Y variable to lot_id.
Example 216
Summary: Analyze a continuous distribution by generating a quantile box plot for the height column, utilizing the Distribution platform in JMP.
Code:
dt under test = Open("data_table.jmp");
obj = Distribution( Continuous Distribution( Column( :height ), Quantile Box Plot( 1 ) ) );
Code Explanation:
- Open data table.
- Create distribution object.
- Analyze height column.
- Generate quantile box plot.
Example 217
Summary: Analyze height data grouped by sex using a Distribution object, opening a specified data table.
Code:
dt under test = Open("data_table.jmp");
obj = Distribution( Continuous Distribution( Column( :height ) ), By( :sex ) );
Code Explanation:
- Open data table;
- Create Distribution object.
- Analyze height column.
- Group by sex variable.
Example 218
Summary: Fits a LogNormal distribution to column CO in a data table, with diagnostic plot features enabled for visualization.
Code:
dt under test = Open("data_table.jmp");
obj = dt under test << Distribution( Column( :CO ) );
obj << Fit Distribution(
LogNormal( Diagnostic Plot( Rotate( 0 ), Confidence Limits( 0 ), Line of Fit( 0 ), Median Reference Line( 1 ) ) )
);
Code Explanation:
- Open data table;
- Create distribution object for column CO.
- Fit LogNormal distribution.
- Enable median reference line.
- Disable confidence limits.
- Disable line of fit.
- Rotate diagnostic plot.
Example 219
Summary: Performs the distribution analysis of a Height column in a data table, customizing summary statistics to include N(0), Variance(1), and Skewness(1).
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Column( :Height ) );
obj << Customize Summary Statistics( N( 0 ), Variance( 1 ), Skewness( 1 ) );
Code Explanation:
- Open data table.
- Create distribution analysis.
- Select Height column.
- Customize summary statistics.
- Exclude count statistic.
- Include variance statistic.
- Include skewness statistic.
Example 220
Summary: Performs the distribution analysis for Height, including customized summary statistics with count, variance, skewness, and mode, using the Distribution platform in JMP.
Code:
dt under test = Open("data_table.jmp");
obj = dt under test << Distribution( Column( :Height ) );
obj << Customize Summary Statistics( N( 0 ), Variance( 1 ), Skewness( 1 ) );
obj << Customize Summary Statistics( Mode( 1 ), Show All Modes( 1 ) );
Code Explanation:
- Open data table;
- Create distribution analysis for Height.
- Customize summary statistics.
- Include count, variance, skewness.
- Customize summary statistics again.
- Include mode, show all modes.
Example 221
Summary: Analyze a data table by creating a distribution object with multiple variables and selecting rows where age is greater than 50.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution(
Automatic Recalc( 1 ),
Nominal Distribution( Column( :sex ) ),
Nominal Distribution( Column( :marital status ) ),
Continuous Distribution( Column( :age ) ),
Nominal Distribution( Column( :country ) ),
Nominal Distribution( Column( :size ) ),
Nominal Distribution( Column( :type ) )
);
dt << Select Where( :age > 50 );
Code Explanation:
- Open data table;
- Create distribution analysis object.
- Set automatic recalculation.
- Analyze "sex" column.
- Analyze "marital status" column.
- Analyze "age" column.
- Analyze "country" column.
- Analyze "size" column.
- Analyze "type" column.
- Select rows where age > 50.
Example 222
Summary: Performs the distribution analysis of a data table, selecting rows where 'age' is greater than 50 and excluding selected rows.
Code:
dt under test = Open("data_table.jmp");
obj = dt under test << Distribution(
Automatic Recalc( 1 ),
Nominal Distribution( Column( :sex ) ),
Nominal Distribution( Column( :marital status ) ),
Continuous Distribution( Column( :age ) ),
Nominal Distribution( Column( :country ) ),
Nominal Distribution( Column( :size ) ),
Nominal Distribution( Column( :type ) )
);
dt under test << Select Where( :age > 50 );
dt undertest << Exclude;
Code Explanation:
- Open data table;
- Create distribution analysis.
- Enable automatic recalculation.
- Analyze "sex" as nominal.
- Analyze "marital status" as nominal.
- Analyze "age" as continuous.
- Analyze "country" as nominal.
- Analyze "size" as nominal.
- Analyze "type" as nominal.
- Select rows where "age" > 50.
- Exclude selected rows.
Example 223
Summary: Analyze continuous distribution for the 'age' column in a data table, utilizing automatic recalculation and distribution modeling.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Automatic Recalc( 1 ), Continuous Distribution( Column( :age ) ), );
Code Explanation:
- Open data table;
- Create Distribution object.
- Set automatic recalculation.
- Analyze continuous distribution.
- Focus on "age" column.
Example 224
Summary: Fits various continuous distributions to a dataset, including extreme value, exponential, gamma, beta, and normal mixtures with 3 clusters.
Code:
dt under test = Open("data_table.jmp");
obj = dt under test << Distribution( Automatic Recalc( 1 ), Continuous Distribution( Column( :age ) ), );
obj << Fit Distribution( Extreme Value );
obj << Fit Distribution( Exponential );
obj << Fit Distribution( Gamma );
obj << Fit Distribution( Beta );
obj << Fit Distribution( Normal Mixtures( Clusters( 3 ) ) );
Code Explanation:
- Open table.
- Create distribution object.
- Fit extreme value distribution.
- Fit exponential distribution.
- Fit gamma distribution.
- Fit beta distribution.
- Fit normal mixtures distribution.
- Specify 3 clusters.
- Automatic recalculation enabled.
- Analyze age column.
Example 225
Summary: Fits a LogNormal distribution to column CO in a data table, utilizing the Distribution platform.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Column( :CO ) );
obj << Fit Distribution( LogNormal );
Code Explanation:
- Open data table;
- Create distribution object for column CO.
- Fit LogNormal distribution to data.
Example 226
Summary: Fits a LogNormal distribution to the CO column in a data table, generating a diagnostic plot with median reference line and various options disabled.
Code:
dt under test = Open("data_table.jmp");
obj = dt under test << Distribution( Column( :CO ) );
obj << Fit Distribution( LogNormal );
obj << (Fit Handle[1] << Diagnostic Plot( Rotate( 0 ), Confidence Limits( 0 ), Line of Fit( 0 ), Median Reference Line( 1 ) ));
Code Explanation:
- Open data table;
- Create distribution object for CO column.
- Fit LogNormal distribution.
- Access first fit handle.
- Generate diagnostic plot.
- Rotate plot 0 degrees.
- Disable confidence limits.
- Disable line of fit.
- Enable median reference line.
Example 227
Summary: Fits a Weibull distribution to a data table, with optional specification limits and quantile saving, followed by a secondary fit using the LogNormal distribution.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Column( "pop- m" ) );
obj << Fit Distribution(
Weibull(
Spec Limits( LSL( 0 ), USL( 10 ), Target( 5 ) ),
Save Fitted Quantiles,
Save Density Formula,
Save Spec Limits,
Make Parms Table,
Save Transformed
)
);
obj << Fit Distribution( LogNormal );
Code Explanation:
- Open table.
- Create distribution object.
- Fit Weibull distribution.
- Set spec limits.
- Save fitted quantiles.
- Save density formula.
- Save spec limits.
- Make parms table.
- Save transformed data.
- Fit LogNormal distribution.
Example 228
Summary: Fits a Weibull distribution to a dataset, with optional specification limits and quantile saving, followed by a LogNormal fit and removal of the second fit.
Code:
dt under test = Open("data_table.jmp");
obj = dt under test << Distribution( Column( "pop- m" ) );
obj << Fit Distribution(
Weibull(
Spec Limits( LSL( 0 ), USL( 10 ), Target( 5 ) ),
Save Fitted Quantiles,
Save Density Formula,
Save Spec Limits,
Make Parms Table,
Save Transformed
)
);
obj << Fit Distribution( LogNormal );
obj << (Fit Handle[2] << Remove Fit);
Code Explanation:
- Open data table;
- Create distribution object for "pop- m".
- Fit Weibull distribution.
- Set spec limits: LSL=0, USL=10, Target=5.
- Save fitted quantiles.
- Save density formula.
- Save spec limits.
- Make parms table.
- Save transformed data.
- Fit LogNormal distribution.
- Remove second fit.
Example 229
Summary: Analyze continuous data by fitting a linear model using the EMS method with interactions and random effects, utilizing the Distribution function in JMP.
Code:
dt under test = Open("data_table.jmp");
obj = Distribution( Freq( :age ), Continuous Distribution( Column( :height ) ), );
Code Explanation:
- Open data table;
- Assign data table to variable.
- Create distribution object.
- Set frequency column to age.
- Analyze height column.
- Use continuous distribution method.
Example 230
Summary: Creates a histogram and shadowgram for continuous data analysis, utilizing automatic recalculation and distribution analysis.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Automatic Recalc( 1 ), Continuous Distribution( Column( :age ) ), );
obj << Histogram( 1 );
obj << Shadowgram( 1 );
Code Explanation:
- Open data table;
- Create distribution object for "age".
- Enable automatic recalculation.
- Add continuous distribution analysis.
- Generate histogram.
- Add shadowgram to histogram.
Example 231
Summary: Creates a distribution object for continuous data, displaying a histogram and shadowgram with vertical alignment.
Code:
dt under test = Open("data_table.jmp");
obj = dt under test << Distribution( Automatic Recalc( 1 ), Continuous Distribution( Column( :age ) ), );
obj << Histogram( 1 );
obj << Shadowgram( 1 );
obj << Vertical( 0 );
Code Explanation:
- Open data table;
- Create distribution object.
- Add continuous distribution for age.
- Display histogram.
- Display shadowgram.
- Set shadowgram vertical.
Example 232
Summary: Analyze a continuous distribution for age, generating summary statistics with customized display options and horizontal layout.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Automatic Recalc( 1 ), Continuous Distribution( Column( :age ) ), );
obj << Summary Statistics( 1 );
obj << Customize Summary Statistics( Mean( 0 ), Std Dev( 0 ), N( 1 ), );
obj << Horizontal Layout( 1 );
Code Explanation:
- Open data table.
- Create distribution object.
- Enable automatic recalculation.
- Analyze continuous distribution for age.
- Show summary statistics.
- Customize summary statistics.
- Exclude mean from display.
- Exclude standard deviation from display.
- Include count in display.
- Arrange layout horizontally.
Example 233
Summary: Creates a distribution object with automatic recalculation, displaying summary statistics for the 'age' column in a horizontal layout.
Code:
dt under test = Open("data_table.jmp");
obj = dt under test << Distribution( Automatic Recalc( 1 ), Continuous Distribution( Column( :age ) ), );
obj << Summary Statistics( 1 );
obj << Customize Summary Statistics( Mean( 0 ), Std Dev( 0 ), N( 1 ), );
obj << Horizontal Layout( 1 );
obj << Axes on Left( 1 );
Code Explanation:
- Open data table;
- Create distribution object.
- Set automatic recalculation.
- Add age column distribution.
- Enable summary statistics.
- Customize summary statistics.
- Hide mean statistic.
- Hide standard deviation statistic.
- Show count statistic.
- Arrange layout horizontally.
- Move axes to left.
Example 234
Summary: Creates a nominal distribution for the 'age' column, enabling count, probability, and density axes on the left.
Code:
dt under test = Open("data_table.jmp");
obj = Distribution(
Nominal Distribution(
Column( :age ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Count Axis( 1 ),
Prob Axis( 1 ),
Density Axis( 1 ),
Axes on Left( 1 )
)
);
Code Explanation:
- Open data table;
- Create Distribution object.
- Set nominal distribution.
- Select column :age.
- Use horizontal layout.
- Disable vertical layout.
- Enable count axis.
- Enable probability axis.
- Enable density axis.
- Place axes on left.
Example 235
Summary: Performs the distribution analysis of a column in a data table, specifying the country as the column for analysis.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Column( :country ), );
Code Explanation:
- Open data table.
- Assign data table to variable.
- Create distribution object.
- Specify column for analysis.
Example 236
Summary: Creates a distribution object for 'country' with frequencies, horizontal layout, and probability axis in JMP.
Code:
dt under test = Open("data_table.jmp");
obj = dt under test << Distribution( Column( :country ), );
obj << Frequencies( 1 );
obj << Horizontal Layout( 1 );
obj << Axes on Left( 1 );
obj << Prob Axis( 1 );
Code Explanation:
- Open data table;
- Create distribution object for "country".
- Enable frequencies.
- Set horizontal layout.
- Place axes on left.
- Enable probability axis.
Example 237
Summary: Creates a distribution object for 'age' and generates a mosaic plot, while disabling outlier box plots.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Column( :age ), );
obj << Outlier Box Plot( 0 );
obj << Mosaic Plot( 1 );
Code Explanation:
- Open data table;
- Create distribution object for "age".
- Disable outlier box plot.
- Enable mosaic plot.
Example 238
Summary: Vizualizes a distribution plot for the 'age' column in a data table, including an outlier box plot and mosaic plot, ordered by count descending.
Code:
dt under test = Open("data_table.jmp");
obj = dt under test << Distribution( Column( :age ), );
obj << Outlier Box Plot( 0 );
obj << Mosaic Plot( 1 );
obj << Order By( "Count Descending" );
Code Explanation:
- Open data table.
- Create distribution object.
- Disable outlier box plot.
- Enable mosaic plot.
- Order by count descending.
Example 239
Summary: Creates a distribution object for 'sex' and tests probabilities with hypothesized values at 0.4 and 0.6, enabling confidence intervals.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Column( :sex ), );
obj << Test Probabilities( Test( Hypothesized ), 0.4, f, 0.6, f );
Code Explanation:
- Open data table;
- Create distribution object for 'sex'.
- Test probabilities for hypothesized values.
- Set hypothesized value at 0.4.
- Enable confidence interval for 0.4.
- Set hypothesized value at 0.6.
- Enable confidence interval for 0.6.
Example 240
Summary: Analyze sex distribution in a data table, specifying test probabilities and confidence intervals.
Code:
dt under test = Open("data_table.jmp");
obj = dt under test << Distribution( Column( :sex ), );
obj << Test Probabilities( Test( Hypothesized ), 0.4, f, 0.6, f );
obj << Confidence Interval( 0.95 );
Code Explanation:
- Open data table;
- Create Distribution object for :sex.
- Set test probabilities for sex.
- Specify hypothesized probability.
- Set confidence interval level.
Example 241
Summary: Analyze the 'age' column in a data table, generating normal quantile and box plots to visualize distributional properties.
Code:
dt under test = Open("data_table.jmp");
obj = dt under test << Distribution( Automatic Recalc( 1 ), Continuous Distribution( Column( :age ) ), );
obj << Normal Quantile Plot( 1 );
obj << Outlier Box Plot( 0 );
obj << Quantile Box Plot( 1 );
Code Explanation:
- Open data_table data
- Create distribution object.
- Analyze age column.
- Enable automatic recalculation.
- Generate normal quantile plot.
- Disable outlier box plot.
- Enable quantile box plot.
Example 242
Summary: Analyze continuous distribution for age by generating a normal quantile plot and disabling outlier box plots.
Code:
dt under test = Open("data_table.jmp");
obj = dt under test << Distribution( Automatic Recalc( 1 ), Continuous Distribution( Column( :age ) ), );
obj << Normal Quantile Plot( 1 );
obj << Outlier Box Plot( 0 );
Code Explanation:
- Open data_table data
- Create Distribution object for age.
- Enable automatic recalculation.
- Analyze continuous distribution for age.
- Generate normal quantile plot.
- Disable outlier box plot.
Example 243
Summary: Fits multiple continuous distributions to a dataset, including Normal, LogNormal, Weibull, and Weibull with threshold models.
Code:
dt under test = Open("data_table.jmp");
obj = dt under test << Distribution( Automatic Recalc( 1 ), Continuous Distribution( Column( :age ) ), );
obj << Fit Distribution( Normal );
obj << Fit Distribution( LogNormal );
obj << Fit Distribution( Weibull );
obj << Fit Distribution( Weibull with threshold );
Code Explanation:
- Open data table;
- Create Distribution object for :age.
- Enable automatic recalculation.
- Add Continuous Distribution for :age.
- Fit Normal distribution.
- Fit LogNormal distribution.
- Fit Weibull distribution.
- Fit Weibull with threshold distribution.
Example 244
Summary: Creates a distribution object with quantile box plots and customized styles for visualizing continuous data.
Code:
dt under test = Open("data_table.jmp");
obj = Distribution(
Continuous Distribution( Column( :weight ), Quantile Box Plot( 1 ) ),
SendToReport(
Dispatch( {}, "Distrib Box", FrameBox,
{DispatchSeg( Box Plot Seg( 1 ), {Box Style( "Quantile" ), Line Color( "Dark Green" ), Line Style( "Dotted" )} )}
),
Dispatch( {}, "Distrib Outlier Box", FrameBox,
{DispatchSeg( Box Plot Seg( 1 ), {Box Style( "Outlier" ), Line Color( "Medium Dark Blue" ), Line Style( "Dashed" )} )}
)
)
);
Code Explanation:
- Open data table.
- Create distribution object.
- Specify weight column.
- Add quantile box plot.
- Send report to display.
- Customize quantile box style.
- Set quantile line color.
- Apply dotted line style.
- Customize outlier box style.
- Set outlier line color.
Example 245
Summary: Analyze and visualize continuous data distribution for the 'age' column, including quantile box plots, outlier detection, stem and leaf plots, and cumulative distribution function (CDF) plots.
Code:
dt under test = Open("data_table.jmp");
obj = dt under test << Distribution( Automatic Recalc( 1 ), Continuous Distribution( Column( :age ) ), );
obj << Quantile Box Plot( 1 );
obj << Outlier Box Plot Row Cutoff( 302 );
obj << Stem and Leaf( 1 );
obj << CDF Plot( 1 );
Code Explanation:
- Open data table;
- Create distribution object.
- Analyze age column.
- Add quantile box plot.
- Set outlier cutoff to 302.
- Add stem and leaf plot.
- Add CDF plot.
Example 246
Summary: Creates a continuous distribution for the 'age' column, displaying quantiles with an increment of 0.05.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Automatic Recalc( 1 ), Continuous Distribution( Column( :age ) ), );
obj << Quantiles( 1 );
obj << Set Quantile Increment( 0.05 );
Code Explanation:
- Open data table;
- Create distribution object for "age".
- Enable automatic recalculation.
- Display continuous distribution.
- Show quantiles.
- Set quantile increment to 0.05.
Example 247
Summary: Analyze continuous column :age in a data table, displaying quantiles with custom increments and values.
Code:
dt under test = Open("data_table.jmp");
obj = dt under test << Distribution( Automatic Recalc( 1 ), Continuous Distribution( Column( :age ) ), );
obj << Quantiles( 1 );
obj << Set Quantile Increment( 0.05 );
obj << Custom Quantiles( 0.975, [0.075, 0.1, 0.125, 0.975, 0.99] );
Code Explanation:
- Open data table;
- Create distribution object.
- Analyze continuous column :age.
- Enable automatic recalculation.
- Display quantiles.
- Set quantile increment to 0.05.
- Add custom quantiles: 0.975, 0.075, 0.1, 0.125, 0.975, 0.99.
Example 248
Summary: Analyze a data table by creating a Distribution object with automatic recalculation, analyzing multiple columns (sex, marital status, age, country, size, and type), and applying a local data filter for males.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution(
Automatic Recalc( 1 ),
Nominal Distribution( Column( :sex ) ),
Nominal Distribution( Column( :marital status ) ),
Continuous Distribution( Column( :age ) ),
Nominal Distribution( Column( :country ) ),
Nominal Distribution( Column( :size ) ),
Nominal Distribution( Column( :type ) ),
Local Data Filter( Add Filter( columns( :sex ), Where( :sex == "Male" ) ), Mode( Show( 1 ), Include( 1 ) ) )
);
Code Explanation:
- Open data table;
- Create Distribution object.
- Enable automatic recalculation.
- Analyze "sex" column.
- Analyze "marital status" column.
- Analyze "age" column.
- Analyze "country" column.
- Analyze "size" column.
- Analyze "type" column.
- Apply local data filter for males.
Example 249
Summary: Performs the distribution analysis of a data table, including automatic recalculation and filtering for males in the 'sex' column.
Code:
dt under test = Open("data_table.jmp");
obj = dt under test << Distribution(
Automatic Recalc( 1 ),
Nominal Distribution( Column( :sex ) ),
Nominal Distribution( Column( :marital status ) ),
Continuous Distribution( Column( :age ) ),
Nominal Distribution( Column( :country ) ),
Nominal Distribution( Column( :size ) ),
Nominal Distribution( Column( :type ) ),
Local Data Filter( Add Filter( columns( :sex ), Where( :sex == "Male" ) ), Mode( Show( 1 ), Include( 1 ) ) )
);
obj << Save Scipt to Report;
Code Explanation:
- Open data table;
- Create distribution analysis object.
- Enable automatic recalculation.
- Analyze "sex" column distribution.
- Analyze "marital status" column distribution.
- Analyze "age" column distribution.
- Analyze "country" column distribution.
- Analyze "size" column distribution.
- Analyze "type" column distribution.
- Apply local data filter for males.
Example 250
Summary: Fits various continuous distributions to a dataset, including smooth curve, Johnson Su, Johnson Sb, Johnson Sl, and GLog models.
Code:
dt under test = Open("data_table.jmp");
obj = dt under test << Distribution( Automatic Recalc( 1 ), Continuous Distribution( Column( :age ) ), );
obj << Fit Distribution( Smooth Curve );
obj << Fit Distribution( Johnson Su );
obj << Fit Distribution( Johnson Sb );
obj << Fit Distribution( Johnson Sl );
obj << Fit Distribution( GLog );
Code Explanation:
- Open table.
- Create distribution object.
- Fit smooth curve.
- Fit Johnson Su.
- Fit Johnson Sb.
- Fit Johnson Sl.
- Fit GLog.
Example 251
Summary: Analyze a continuous distribution by stacking columns and fitting a linear model using the EMS method with interactions and random effects.
Code:
dt under test = Open("data_table.jmp");
obj = Distribution( Stack( 1 ), Continuous Distribution( Column( :height ) ) );
Code Explanation:
- Open data table.
- Create distribution object.
- Stack columns for analysis.
- Analyze continuous distribution.
- Focus on height column.
Example 252
Summary: Performs a distribution analysis to visualize the age variable, including histogram, standard error bars, and density axis, with customizable bin width and color.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Automatic Recalc( 1 ), Continuous Distribution( Column( :age ) ), );
obj << Histogram( 1 );
obj << Std Error Bars( 1 );
obj << Set Bin Width( 8 );
obj << Histogram Color( Red );
obj << Count Axis( 1 );
obj << Prob Axis( 1 );
obj << Density Axis( 1 );
obj << Show Percents( 1 );
Code Explanation:
- Open data table;
- Create distribution analysis.
- Select continuous distribution.
- Choose column "age".
- Enable histogram.
- Add standard error bars.
- Set bin width to 8.
- Change histogram color to red.
- Enable count axis.
- Enable probability axis.
- Enable density axis.
- Display percents.
Example 253
Summary: Vizualizes a continuous distribution for 'age' in a data table, with interactive features such as standard error bars and customizable bin width.
Code:
dt under test = Open("data_table.jmp");
obj = dt under test << Distribution( Automatic Recalc( 1 ), Continuous Distribution( Column( :age ) ), );
obj << Histogram( 1 );
obj << Std Error Bars( 1 );
obj << Set Bin Width( 8 );
obj << Histogram Color( Red );
obj << Count Axis( 1 );
obj << Prob Axis( 1 );
obj << Density Axis( 1 );
obj << Show Percents( 1 );
obj << Show Counts( 1 );
Code Explanation:
- Open data table;
- Create distribution object for "age".
- Enable automatic recalculation.
- Display histogram for "age".
- Add standard error bars.
- Set bin width to 8.
- Change histogram color to red.
- Display count axis.
- Display probability axis.
- Display density axis.
- Show percents on axes.
- Show counts on axes.
Example 254
Summary: Tests mean against a specified value (60) with P-Value and Power animations in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Column( :Height ) );
obj << Test Mean( 60, PValue Animation, Power Animation );
win1 = Window( "P-Value for Testing Mean" );
win2 = Window( "Power for Testing Mean" );
win1 << close window;
Code Explanation:
- Open data table.
- Create distribution object.
- Test mean against 60.
- Enable PValue animation.
- Enable Power animation.
- Create PValue window.
- Create Power window.
- Close PValue window.
Example 255
Summary: Tests mean for a given column in a data table, enabling p-value and power animations.
Code:
dt under test = Open("data_table.jmp");
obj = dt under test << Distribution( Column( :Height ) );
obj << Test Mean( 60, PValue Animation, Power Animation );
win1 = Window( "P-Value for Testing Mean" );
win2 = Window( "Power for Testing Mean" );
win1 << close window;
win2 << close window;
Code Explanation:
- Open table.
- Create distribution object.
- Test mean at 60.
- Enable p-value animation.
- Enable power animation.
- Create p-value window.
- Create power window.
- Close p-value window.
- Close power window.
Example 256
Summary: Calculates statistical parameters for a continuous distribution, including mean, standard deviation, confidence interval, prediction interval, and tolerance interval.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Automatic Recalc( 1 ), Continuous Distribution( Column( :age ) ), );
obj << Test Mean( 85 );
obj << Test Std Dev( 30 );
obj << Confidence Interval( 0.98 );
obj << Prediction Interval( 0.98, 30 );
obj << Tolerance Interval( Alpha( 0.98 ), Proportion( 0.9 ), Lower );
Code Explanation:
- Open data table;
- Create distribution object for "age".
- Enable automatic recalculation.
- Test mean at 85.
- Test standard deviation at 30.
- Calculate 98% confidence interval.
- Calculate 98% prediction interval for 30.
- Calculate 98% tolerance interval for lower bound.
- Set proportion for tolerance interval to 90%.
Example 257
Summary: Runs a capability analysis for the 'age' column in a data table, testing mean and standard deviation against specified values, and calculating confidence, prediction, and tolerance intervals.
Code:
dt under test = Open("data_table.jmp");
obj = dt under test << Distribution( Automatic Recalc( 1 ), Continuous Distribution( Column( :age ) ), );
obj << Test Mean( 85 );
obj << Test Std Dev( 30 );
obj << Confidence Interval( 0.98 );
obj << Prediction Interval( 0.98, 30 );
obj << Tolerance Interval( Alpha( 0.98 ), Proportion( 0.9 ), Lower );
obj << Capability Analysis( LSL( 16 ), USL( 24 ), Target( 20 ) );
Code Explanation:
- Open data table;
- Create distribution for :age.
- Test mean against 85.
- Test standard deviation against 30.
- Calculate 98% confidence interval.
- Calculate 98% prediction interval for 30.
- Calculate lower 98% tolerance interval for 90% proportion.
- Perform capability analysis.
- Set LSL to 16.
- Set USL to 24.
- Set target to 20.
Example 258
Summary: Performs the distribution analysis of multiple columns in a data table, including sex, marital status, age, country, size, and type, using the Distribution platform with automatic recalculation and uniform scaling.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution(
Automatic Recalc( 1 ),
Nominal Distribution( Column( :sex ) ),
Nominal Distribution( Column( :marital status ) ),
Continuous Distribution( Column( :age ) ),
Nominal Distribution( Column( :country ) ),
Nominal Distribution( Column( :size ) ),
Nominal Distribution( Column( :type ) )
);
obj << Uniform Scaling( 1 );
Code Explanation:
- Open data_table data
- Launch Distribution platform.
- Set automatic recalculation.
- Analyze sex column.
- Analyze marital status column.
- Analyze age column.
- Analyze country column.
- Analyze size column.
- Analyze type column.
- Apply uniform scaling.
Example 259
Summary: Analyze categorical and continuous variables in a data table, applying uniform scaling and arranging outputs in rows.
Code:
dt under test = Open("data_table.jmp");
obj = dt under test << Distribution(
Automatic Recalc( 1 ),
Nominal Distribution( Column( :sex ) ),
Nominal Distribution( Column( :marital status ) ),
Continuous Distribution( Column( :age ) ),
Nominal Distribution( Column( :country ) ),
Nominal Distribution( Column( :size ) ),
Nominal Distribution( Column( :type ) )
);
obj << Uniform Scaling( 1 );
obj << ArrangeInRows( 3 );
Code Explanation:
- Open data table;
- Create Distribution object.
- Set automatic recalculation.
- Analyze "sex" column.
- Analyze "marital status" column.
- Analyze "age" column.
- Analyze "country" column.
- Analyze "size" column.
- Analyze "type" column.
- Apply uniform scaling.
- Arrange outputs in rows.
Example 260
Summary: Creates a distribution object from two columns in a data table, utilizing the Distribution function.
Code:
Names Default To Here( 1 );
dt = Open("data_table.jmp");
obj = Distribution( Column( :Age, :Weight ) );
Code Explanation:
- Set default names scope.
- Open data table.
- Create distribution object.
Example 261
Summary: Analyze the Height column using a Distribution object with a horizontal layout and count axis, opening a data table in JMP.
Code:
dt = Open("data_table.jmp");
obj = Distribution( Column( :Height ), Horizontal Layout( 1 ), Count Axis( 1 ) );
Code Explanation:
- Open data table;
- Create distribution object.
- Analyze Height column.
- Use horizontal layout.
- Place count axis on left.
Example 262
Summary: Creates a distribution object with horizontal layout and count axis, enabling axes on the left.
Code:
Names Default To Here( 1 );
dt = Open("data_table.jmp");
obj = Distribution( Column( :Height ), Horizontal Layout( 1 ), Count Axis( 1 ) );
obj << Axes on Left( 1 );
Code Explanation:
- Set default names.
- Open data table;
- Create distribution object.
- Set horizontal layout.
- Enable count axis.
- Move axes to left.
Example 263
Summary: Analyze a data table by fitting a linear model using the EMS method with interactions and random effects, utilizing Distribution platform to visualize the results.
Code:
Open("data_table.jmp");
Distribution(
Continuous Distribution( Column( :weight ), Vertical( 0 ) ),
Nominal Distribution( Column( :age ), Vertical( 0 ), Count Axis( 1 ), Axes on Left( 1 ) )
);
Code Explanation:
- Open data table.
- Launch Distribution platform.
- Analyze weight column.
- Set vertical axis to zero.
- Analyze age column.
- Set vertical axis to zero.
- Use count axis for age.
- Place axes on left.
Example 264
Summary: Analyze a data table by fitting a linear model using the EMS method with interactions and random effects, utilizing Distribution platform to visualize continuous and nominal distributions.
Code:
Open("data_table.jmp");
Distribution( Continuous Distribution( Column( :weight ), ), Nominal Distribution( Column( :age ), Count Axis( 1 ), Axes on Left( 1 ) ) );
Code Explanation:
- Open data table;
- Launch Distribution platform.
- Analyze weight with continuous distribution.
- Analyze age with nominal distribution.
- Set count axis for age.
- Position axes on left.
Example 265
Summary: Analyze height data by creating a distribution object and analyzing the 'Height' column.
Code:
dt = Open("data_table.jmp");
obj = Distribution( Column( :Height ) );
Code Explanation:
- Open data table.
- Create distribution object.
- Analyze height column.
Example 266
Summary: Creates a distribution object with a count axis for the 'Height' column in a data table, utilizing the Distribution platform.
Code:
Names Default To Here( 1 );
dt = Open("data_table.jmp");
obj = Distribution( Column( :Height ) );
obj << Count Axis( 1 );
Code Explanation:
- Set default names.
- Open data table.
- Create distribution object.
- Add count axis to distribution.
Example 267
Summary: Creates a density plot for the 'Height' column in a data table, enabling visualization of its distribution.
Code:
Names Default To Here( 1 );
dt = Open("data_table.jmp");
obj = Distribution( Column( :Height ) );
obj << Density Axis( 1 );
Code Explanation:
- Set default names scope.
- Open data table;
- Create distribution object for height.
- Enable density axis on plot.
Example 268
Summary: Creates a distribution object with a horizontal layout for visualizing data from a specified column in a JMP data table.
Code:
Names Default To Here( 1 );
dt = Open("data_table.jmp");
obj = Distribution( Column( :Height ) );
obj << Horizontal Layout( 1 );
Code Explanation:
- Set default names.
- Open data table.
- Create distribution object.
- Set horizontal layout.
Example 269
Summary: Creates a probability distribution plot for the 'Height' column in a data table, utilizing the Distribution platform.
Code:
Names Default To Here( 1 );
dt = Open("data_table.jmp");
obj = Distribution( Column( :Height ) );
obj << Prob Axis( 1 );
Code Explanation:
- Set default names.
- Open data table.
- Create distribution object.
- Add probability axis.
Example 270
Summary: Creates a distribution object for height with bin width set to 5, using the Open and Distribution functions in JMP.
Code:
Names Default To Here( 1 );
dt = Open("data_table.jmp");
obj = Distribution( Column( :Height ) );
obj << Set Bin Width( 5 );
Code Explanation:
- Set default names.
- Open data table;
- Create distribution object for height.
- Set bin width to 5.
Example 271
Summary: Vizualizes height distribution by enabling count display for a specified data table.
Code:
Names Default To Here( 1 );
dt = Open("data_table.jmp");
obj = Distribution( Column( :Height ) );
obj << Show Counts( 1 );
Code Explanation:
- Set default names context.
- Open data table.
- Create distribution object for height.
- Enable count display.
Example 272
Summary: Analyze a data table by fitting a linear model using the EMS method with interactions and random effects, grouping by health description.
Code:
Open("data_table.jmp");
Distribution(
Continuous Distribution( Column( :How much do you weigh ) ),
Continuous Distribution( Column( :Body Mass Index Percentage ) ),
Nominal Distribution( Column( :What is your sex ) ),
Nominal Distribution( Column( :How old are you ) ),
By( :How do you describe your health )
);
Code Explanation:
- Open data table;
- Create distribution analysis.
- Analyze weight distribution.
- Analyze BMI percentage distribution.
- Analyze sex distribution.
- Analyze age distribution.
- Group by health description.
Example 273
Summary: Creates a distribution object with continuous and nominal distributions, displaying histograms only for the height column.
Code:
dt under test = Open("data_table.jmp");
obj = Distribution( Continuous Distribution( Column( :height ) ), Nominal Distribution( Column( :age ) ), Histograms Only, );
Code Explanation:
- Open table.
- Create distribution object.
- Analyze height column.
- Analyze age column.
- Display histograms only.
Example 274
Summary: Fits a linear model using the EMS method with interactions and random effects, analyzing multiple responses in a data table.
Code:
Open("data_table.jmp");
Distribution( Multiple Response Distribution( Column( :Brush Delimited ) ) );
Code Explanation:
- Open data table;
- Launch Distribution platform.
- Analyze multiple responses.
- Specify response column.
Example 275
Summary: Performs the distribution analysis of a nominal column 'Name' in a data table, utilizing the Distribution platform to visualize the data.
Code:
Open("data_table.jmp");
Distribution( Nominal Distribution( Column( :Name ) ) );
Code Explanation:
- Open data table;
- Create distribution analysis.
- Analyze nominal column "Name".
Example 276
Summary: Creates mosaic plots for TREATMENT GROUP, ADVERSE REACTION, and ADR SEVERITY columns in a data table, with customized font sizes for scale boxes.
Code:
Open( “$SAMPLE_DATA/AdverseR.jmp” );
Distribution(
Nominal Distribution( Column( :TREATMENT GROUP ), Mosaic Plot( 1 ) ),
Nominal Distribution( Column( :ADVERSE REACTION ), Mosaic Plot( 1 ) ),
Nominal Distribution( Column( :ADR SEVERITY ), Mosaic Plot( 1 ) ),
SendToReport(
Dispatch( {}, "1", ScaleBox, {Label Row( Set Font Size( 9 ) )} ),
Dispatch( {}, "7", ScaleBox, {Label Row( Set Font Size( 18 ) )} ),
Dispatch( {}, "1", ScaleBox, {Label Row( Set Font Size( 22 ) )} )
)
);
Code Explanation:
- Open data table;
- Create distribution analysis.
- Analyze TREATMENT GROUP column.
- Generate mosaic plot.
- Analyze ADVERSE REACTION column.
- Generate mosaic plot.
- Analyze ADR SEVERITY column.
- Generate mosaic plot.
- Set font size for first scale box.
- Set font size for seventh scale box.
Example 277
Summary: Creates a distribution analysis for the 'height' column, utilizing a stacked horizontal layout with quantile box plots and saving the journal to a temporary file.
Code:
bc = Open("data_table.jmp");
d = Distribution(
Stack( 1 ),
Continuous Distribution( Column( :height ), Summary Statistics( 0 ), Horizontal Layout( 1 ), Vertical( 0 ), Quantile Box Plot( 1 ) )
);
d << save journal( "$temp\test.jrn" );
Open( "$temp\test.jrn" );
Close( bc, nosave );
Code Explanation:
- Open data table.
- Create distribution analysis.
- Stack columns horizontally.
- Analyze height column.
- Disable summary statistics.
- Enable horizontal layout.
- Disable vertical layout.
- Enable quantile box plot.
- Save journal to temp.
- Open saved journal.
Example 278
Summary: Analyze a continuous distribution for 'Transform[height]' by disabling quantiles, summary statistics, and outlier box plots, while sending the report to Distribution with Power scale.
Code:
dt = Open("data_table.jmp");
Distribution(
Continuous Distribution(
Column( Transform Column( "Transform[height]", Formula( :height - 60 ) ) ),
Quantiles( 0 ),
Summary Statistics( 0 ),
Outlier Box Plot( 0 )
),
SendToReport(
Dispatch( {"Transform[height]"}, "1", ScaleBox, {Scale( "Power" ), Min( -10 ), Max( 12.5 ), Inc( 5 ), Minor Ticks( 1 )} )
)
);
Code Explanation:
- Open data table;
- Create new column "Transform[height]".
- Apply formula to "Transform[height]": height - 60.
- Launch Distribution platform.
- Analyze continuous distribution for "Transform[height]".
- Disable quantiles report.
- Disable summary statistics report.
- Disable outlier box plot.
- Send report to Distribution platform.
- Set scale type to "Power" for "Transform[height]".
Example 279
Summary: Analyze age and height variables by fitting a linear model using the EMS method with interactions and random effects.
Code:
dt under test = Open("data_table.jmp");
obj = Distribution( Weight( :age ), Continuous Distribution( Column( :height ) ), );
Code Explanation:
- Open data table;
- Create Distribution object.
- Analyze age variable.
- Apply continuous distribution.
- Focus on height column.
Example 280
Summary: Analyze height data for female subjects by creating a distribution object and filtering the data table.
Code:
dt under test = Open("data_table.jmp");
obj = Distribution( Continuous Distribution( Column( :height ) ), Where( :sex == "F" ) );
Code Explanation:
- Open data table.
- Create distribution object.
- Analyze height column.
- Filter for female sex.
Example 281
Summary: Analyze weight distribution for female subjects based on age, utilizing a continuous and nominal distribution platform in JMP.
Code:
Open("data_table.jmp");
Distribution( Continuous Distribution( Column( :weight ) ), Nominal Distribution( Column( :age ) ), Where( :sex == "F" ) );
Code Explanation:
- Open data table.
- Launch Distribution platform.
- Analyze weight column.
- Analyze age column.
- Filter for female sex.
Example 282
Summary: Creates a distribution object with continuous and nominal variables from a data table, utilizing the Distribution function.
Code:
dt under test = Open("data_table.jmp");
obj = Distribution( Continuous Distribution( Column( :height ) ), Nominal Distribution( Column( :age ) ), );
Code Explanation:
- Open data table.
- Assign table to variable.
- Create distribution object.
- Analyze continuous column.
- Analyze nominal column.
Example 283
Summary: Tests mean for a distribution of height data, setting the test mean value to 60 and enabling PValue animation.
Code:
Open("data_table.jmp");
obj = Distribution( Column( :Height ) );
obj << Test Mean( 60, PValue Animation );
Code Explanation:
- Open data table;
- Create distribution object for height.
- Perform test mean on height.
- Set test mean value to 60.
- Enable PValue animation.
Example 284
Summary: Tests mean for a specified column in a data table, with P-Value animation enabled.
Code:
dt under test = Open("data_table.jmp");
obj = Distribution( Column( :Height ) );
obj << Test Mean( 60, PValue Animation );
obj = Window( "P-Value for Testing Mean" );
Code Explanation:
- Open table.
- Create distribution object.
- Test mean at 60.
- Enable PValue animation.
- Access P-Value window.
Example 285
Summary: Analyzes and creates reports for a nominal distribution for the 'age' column, utilizing the Distribution platform to create an outline box with a custom title.
Code:
dt under test = Open("data_table.jmp");
obj = Distribution(
Nominal Distribution( Column( :age ) ),
SendToReport(
Dispatch( {}, "age", OutlineBox,
{Set Title( "age - Testing, Ordinal values should not have tickmarks (especially not offset tickmarks)" )}
)
)
);
Code Explanation:
- Open data table;
- Create distribution analysis.
- Analyze nominal distribution of age.
- Send report settings.
- Dispatch age outline box.
- Set title for age analysis.
- Specify title content.
Example 286
Summary: Fits a normal distribution to the 'Profit($M)' column in a data table, displaying diagnostic plots and density curves.
Code:
dt under test = Open("data_table.jmp");
obj = Distribution(
Continuous Distribution(
Column( :Name( "Profit($M)" ) ),
Fit Distribution( Normal( Diagnostic Plot( Median Reference Line( 0 ) ), Density Curve( 0 ) ) )
)
);
Code Explanation:
- Open data table;
- Create Distribution object.
- Analyze Profit($M) column.
- Fit Normal distribution.
- Add Median reference line.
- Display Density curve.
Example 287
Summary: Fits a lognormal distribution to the 'Sales' column in a data table, utilizing the Distribution platform.
Code:
dt under test = Open("data_table.jmp");
obj = Distribution( Continuous Distribution( Column( :Name( "Sales($M)" ) ), Fit Distribution( LogNormal ) ) );
Code Explanation:
- Open data table;
- Assign data table to variable.
- Create distribution object.
- Specify continuous distribution.
- Select sales column.
- Fit lognormal distribution.
Example 288
Summary: Performs the distribution analysis of the 'weight' column in a data table, with automatic recalculation and standard error bars, filtered by the 'sex' column.
Code:
Open("data_table.jmp") << Distribution(
Automatic Recalc( 1 ),
Continuous Distribution( Column( :weight ), Vertical( 0 ), Std Error Bars( 1 ) ),
Local Data Filter( Mode( Include( 0 ) ), Add Filter( columns( :sex ) ) )
);
Code Explanation:
- Open data table;
- Initiate Distribution analysis.
- Enable automatic recalculation.
- Analyze weight column.
- Display vertical distribution.
- Show standard error bars.
- Add local data filter.
- Set filter mode to include.
- Filter by sex column.
Example 289
Summary: Analyze continuous height data with a local data filter for female subjects, utilizing automatic recalculation and display settings.
Code:
dt = Open("data_table.jmp");
Distribution(
Automatic Recalc( 1 ),
Continuous Distribution( Column( :height ) ),
Local Data Filter( Add Filter( columns( :age ), Display( :age, Size( 160, 90 ), List Display ) ) ),
Where( :sex == "F" )
);
Code Explanation:
- Open data table.
- Access Distribution platform.
- Enable automatic recalculation.
- Analyze continuous height column.
- Add local data filter.
- Set filter for age column.
- Display age filter list.
- Apply filter size settings.
- Filter data for female sex.
Example 290
Summary: Creates a shadowgram for the 'Height' column in a data table, utilizing the Distribution platform.
Code:
Names Default To Here( 1 );
dt = Open("data_table.jmp");
obj = Distribution( Column( :Height ) );
obj << Shadowgram( 1 );
Code Explanation:
- Set default names to here.
- Open data table;
- Create distribution object for height.
- Add shadowgram to distribution object.
Example 291
Summary: Creates a nominal distribution for age with histogram color and percentage display, then saves the journal to a temporary file.
Code:
Open("data_table.jmp");
d = Distribution( Nominal Distribution( Column( :age ), Histogram Color( "Medium Light Red" ), Show Percents( 1 ) ) );
dj = d << get journal( "$temp\jmp18DistJournal.jrn" );
dj = Substitute( dj, "percent", "NEWJOURNALENTRY,percent" );
Code Explanation:
- Open data table.
- Create distribution object.
- Set nominal distribution for age.
- Apply histogram color.
- Display percentages.
- Retrieve journal.
- Save journal to temp file.
- Substitute text in journal.
- Update journal entry.
- Save modified journal.
Example 292
Summary: Analyze a data table by filtering rows based on a transformed column and then applying continuous and nominal distributions to specific columns.
Code:
Open("data_table.jmp");
Distribution(
Transform Column( "myCol", Character, Formula( Word( 1, :sex ) ) ),
Continuous Distribution( Column( :weight ) ),
Nominal Distribution( Column( :age ) ),
Where( :myCol == "F" )
);
Code Explanation:
- Open data table;
- Create new column "myCol".
- Transform "myCol" to character.
- Set "myCol" formula to first word of :sex.
- Analyze continuous distribution of :weight.
- Analyze nominal distribution of :age.
- Filter data where "myCol" equals "F".
Example 293
Summary: Selects and excludes data based on a specific condition, generating a report with filtered results.
Code:
dt = Open("data_table.jmp");
obj = Distribution(
Continuous Distribution( Column( :weight ) ),
Local Data Filter(
Location( {0, 0} ),
Add Filter( columns( :age ), Where( :age == 12 ) ),
Mode( Select( 0 ), Show( 1 ), Include( 1 ) )
)
);
dt << Select Where( :age == 12 );
dt << Exclude();
rpt = obj << Report;
actN = Close( dt, NoSave );
Code Explanation:
- Open data table;
- Create distribution object.
- Set continuous distribution for weight.
- Add local data filter.
- Set filter location.
- Filter age column for 12.
- Configure filter mode.
- Select rows where age is 12.
- Exclude selected rows.
- Generate report and close dataset.
Example 294
Summary: Selects and excludes data based on specific conditions, generating a filtered report.
Code:
dt = Open("data_table.jmp");
obj = Distribution(
Continuous Distribution( Column( :weight ) ),
Local Data Filter(
Location( {0, 0} ),
Add Filter( columns( :age ), Where( :age == 12 ) ),
Mode( Select( 0 ), Show( 1 ), Include( 1 ) )
)
);
obj << Automatic Recalc( 0 );
dt << Select Where( :age == 12 );
dt << Exclude();
rpt = obj << Report;
Code Explanation:
- Open data table;
- Create Distribution object.
- Set weight for continuous distribution.
- Add Local Data Filter.
- Set filter location to (0, 0).
- Add age filter for age 12.
- Set filter mode to select, show, include.
- Disable automatic recalculation.
- Select rows where age is 12.
- Exclude selected rows.
Example 295
Summary: Process of filtering a data table by age 12 and generating reports using a distribution object with local data filters.
Code:
filePath = "$Sample_Data\data_table.jmp";
dt = Open("data_table.jmp");
obj = Distribution(
Continuous Distribution( Column( :weight ) ),
Local Data Filter(
Location( {0, 0} ),
Add Filter( columns( :age ), Where( :age == 12 ) ),
Mode( Select( 0 ), Show( 1 ), Include( 1 ) )
)
);
dt << Select Where( :age == 12 );
dt << Exclude();
rpt = obj << Report;
Close( dt, NoSave );
dt = Open("data_table.jmp");
obj = Distribution(
Continuous Distribution( Column( :weight ) ),
Local Data Filter(
Location( {0, 0} ),
Add Filter( columns( :age ), Where( :age == 12 ) ),
Mode( Select( 0 ), Show( 1 ), Include( 1 ) )
)
);
obj << Automatic Recalc( 0 );
dt << Select Where( :age == 12 );
dt << Exclude();
rpt = obj << Report;
Code Explanation:
- Define file path.
- Open data table;
- Create distribution object for weight.
- Add local data filter for age 12.
- Select rows where age is 12.
- Exclude selected rows.
- Generate report from distribution object.
- Close "data_table.jmp" without saving.
- Reopen "data_table.jmp".
- Create new distribution object for weight.
- Add same local data filter for age 12.
- Disable automatic recalculation.
- Select rows where age is 12.
- Exclude selected rows.
- Generate report from distribution object.
Example 296
Summary: Selects and excludes data rows based on a specific filter condition, generating a report from the filtered data.
Code:
dt = Open("data_table.jmp");
obj = Distribution(
Continuous Distribution( Column( :weight ) ),
Local Data Filter(
Location( {0, 0} ),
Add Filter( columns( :age ), Where( :age == 12 ) ),
Mode( Select( 0 ), Show( 1 ), Include( 1 ) )
)
);
dt << Select Where( :age == 12 );
dt << Exclude();
rpt = obj << Report;
Code Explanation:
- Open data table;
- Create Distribution object.
- Add continuous distribution for weight.
- Enable Local Data Filter.
- Set filter location to (0,0).
- Add age filter for age 12.
- Set filter mode to select, show, include.
- Select rows where age is 12.
- Exclude selected rows.
- Generate report from object.
Example 297
Summary: Analyze a continuous distribution for the 'Age' column, filtered by 'Sex' = 'F', and generates summary statistics.
Code:
dt = Open("data_table.jmp");
dist = dt << Distribution( Automatic Recalc( 1 ), Continuous Distribution( Column( :Age ) ) );
ldf = dist << Local Data Filter( Add Filter( columns( :Sex ), Where( :Sex == "F" ) ), Mode( Select( 0 ), Show( 1 ), Include( 1 ) ) );
sumStats1 = Report( dist )["Summary Statistics"][Table Box( 1 )] << get;
ldf << Display( :Sex, Single Category Display );
sumStats2 = Report( dist )["Summary Statistics"][Table Box( 1 )] << get;
Code Explanation:
- Open data table;
- Create distribution analysis.
- Enable automatic recalculation.
- Analyze Age column.
- Add local data filter.
- Filter by Sex = "F".
- Display filter options.
- Retrieve summary statistics.
- Change display to single category.
- Retrieve updated summary statistics.
Example 298
Summary: Process of filtering a data table based on specific conditions, including location and demographic criteria, and saves the filtered data to a new script.
Code:
dt = Open("data_table.jmp");
dist = dt << Distribution( Automatic Recalc( 1 ), Continuous Distribution( Column( :height ) ) );
df = dist << Local Data Filter(
Location( {795, 137} ),
Add Filter( columns( :age, :sex ), Where( :age == {12, 14, 16} ), Where( :sex == "M" ) ),
Mode( Select( 0 ), Show( 1 ), Include( 1 ) )
);
faves = df << Add Favorites();
df << Delete All;
df << Add Filter( columns( :age, :sex ), Where( :age == {13, 15, 17} ), Where( :sex == "F" ) );
faves2 = df << Add Favorites( "Female odd age" );
df << Remove Favorites();
df << Save script to data table;
skript = Char( dt << Get Property( "Local Data Filter" ) );
Code Explanation:
- Open data table;
- Create distribution for height.
- Add local data filter.
- Set filter location.
- Define age and sex filters.
- Set filter mode.
- Add favorites to filter.
- Delete all filters.
- Add new filter for female odd ages.
- Save script to data table.
Example 299
Summary: Creates and manages local data filters in a JMP data table, including filtering by specific age ranges and sexes, adding favorites, and removing filters.
Code:
dt = Open("data_table.jmp");
dist = dt << Distribution( Automatic Recalc( 1 ), Continuous Distribution( Column( :height ) ) );
df = dist << Local Data Filter(
Location( {795, 137} ),
Add Filter( columns( :age, :sex ), Where( :age == {12, 14, 16} ), Where( :sex == "M" ) ),
Mode( Select( 0 ), Show( 1 ), Include( 1 ) )
);
fave = df << Add Favorites( "Male even age" );
df << Delete All;
df << Add Filter( columns( :age, :sex ), Where( :age == {13, 15, 17} ), Where( :sex == "F" ) );
fave2 = df << Add Favorites( "Female odd age" );
df << Remove Favorites( "Male even age" );
df << Save script to data table;
skript = dt << Get Property( "Local Data Filter" );
df << Remove Favorites( "Female odd age" );
df << Remove Favorites( "" );
Try( df << Remove Favorites( "1" ) );
df << Remove Favorites();
Code Explanation:
- Open data table.
- Create distribution analysis for height.
- Add local data filter to distribution.
- Set filter location to {795, 137}.
- Filter by age 12, 14, 16 and sex "M".
- Set filter mode to select, show, and include.
- Add "Male even age" to favorites.
- Delete all filters.
- Add new filter by age 13, 15, 17 and sex "F".
- Add "Female odd age" to favorites.
Example 300
Summary: Creates and manages local data filters with specific conditions, adding favorites and deleting all filters as needed.
Code:
dt = Open("data_table.jmp");
dist = dt << Distribution( Automatic Recalc( 1 ), Continuous Distribution( Column( :height ) ) );
df = dist << Local Data Filter(
Location( {795, 137} ),
Add Filter( columns( :age, :sex ), Where( :age == {12, 14, 16} ), Where( :sex == "M" ) ),
Mode( Select( 0 ), Show( 1 ), Include( 1 ) )
);
df << Add Favorites( "Male even age" );
df << Delete All;
df << Add Filter( columns( :age, :sex ), Where( :age == {13, 15, 17} ), Where( :sex == "F" ) );
df << Add Favorites( "Female odd age" );
df << Delete All;
Try( df << Apply Favorites( "" ) );
Try( df << Apply Favorites( "abcxyz123" ) );
df << Apply Favorites( "Male even age" );
df << Save script to data table;
skript = dt << Get Property( "Local Data Filter" );
df << Apply Favorites( "Female odd age" );
df << Save script to data table;
skript = dt << Get Property( "Local Data Filter 2" );
Code Explanation:
- Open data table;
- Create distribution for height.
- Add local data filter.
- Set filter location.
- Add age and sex filters.
- Set filter mode.
- Add "Male even age" favorite.
- Delete all filters.
- Add new age and sex filters.
- Add "Female odd age" favorite.
Example 301
Summary: Analyze a continuous weight column using capability analysis with local data filtering by age 12, generating a report.
Code:
dt = Open("data_table.jmp");
obj = Distribution(
Continuous Distribution( Column( :weight ) ),
Capability Analysis( LSL( 1 ), Target( 2 ) ),
Local Data Filter(
Location( {0, 0} ),
Add Filter( columns( :age ), Where( :age == 12 ) ),
Mode( Select( 0 ), Show( 1 ), Include( 1 ) )
)
);
obj << Automatic Recalc( 0 );
dt << Select Where( :sex == "F" );
dt << Exclude();
rpt = obj << Report;
Code Explanation:
- Open data table;
- Create Distribution object.
- Analyze continuous weight column.
- Perform capability analysis.
- Set LSL to 1.
- Set target to 2.
- Enable local data filter.
- Position filter at (0, 0).
- Filter by age 12.
- Generate report.
Example 302
Summary: Analyzes and creates reports for weight data for females with age 12, utilizing a Distribution object with capability analysis and local data filtering.
Code:
dt = Open("data_table.jmp");
obj = Distribution(
Continuous Distribution( Column( :weight ) ),
Capability Analysis( LSL( 1 ), Target( 2 ) ),
Local Data Filter(
Location( {0, 0} ),
Add Filter( columns( :age ), Where( :age == 12 ) ),
Mode( Select( 0 ), Show( 1 ), Include( 1 ) )
)
);
dt << Select Where( :sex == "F" );
dt << Exclude();
rpt = obj << Report;
Close( dt, NoSave );
dt = Open("data_table.jmp");
obj = Distribution(
Continuous Distribution( Column( :weight ) ),
Capability Analysis( LSL( 1 ), Target( 2 ) ),
Local Data Filter(
Location( {0, 0} ),
Add Filter( columns( :age ), Where( :age == 12 ) ),
Mode( Select( 0 ), Show( 1 ), Include( 1 ) )
)
);
obj << Automatic Recalc( 0 );
dt << Select Where( :sex == "F" );
dt << Exclude();
rpt = obj << Report;
Code Explanation:
- Open data table;
- Create distribution object.
- Analyze weight column.
- Perform capability analysis.
- Add local data filter.
- Filter age equal to 12.
- Set filter mode to select.
- Select females.
- Exclude selected rows.
- Generate report.
Example 303
Summary: Fits a normal distribution to a continuous column, applying a local data filter with age and sex constraints, and generating a report.
Code:
dt = Open("data_table.jmp");
obj = Distribution( Continuous Distribution( Column( :weight ), Fit Distribution( Normal ) ) );
obj << Local Data Filter(
Location( {0, 0} ),
Add Filter( columns( :age ), Where( :age == 12 ) ),
Mode( Select( 0 ), Show( 1 ), Include( 1 ) )
);
obj << Automatic Recalc( 0 );
dt << Select Where( :sex == "F" );
dt << Exclude();
rpt = obj << Report;
Code Explanation:
- Open table.
- Fit normal distribution.
- Create local data filter.
- Set filter location.
- Add age filter.
- Configure filter mode.
- Disable automatic recalculation.
- Select female records.
- Exclude selected records.
- Generate report.
Example 304
Summary: Process of filtering a data table to select females with age 12 and excludes them, then generates a report from a distribution object.
Code:
dt = Open("data_table.jmp");
obj = Distribution( Continuous Distribution( Column( :weight ), Fit Distribution( Normal ) ) );
obj << Local Data Filter(
Location( {0, 0} ),
Add Filter( columns( :age ), Where( :age == 12 ) ),
Mode( Select( 0 ), Show( 1 ), Include( 1 ) )
);
dt << Select Where( :sex == "F" );
dt << Exclude();
rpt = obj << Report;
Close( dt, NoSave );
dt = Open("data_table.jmp");
obj = Distribution( Continuous Distribution( Column( :weight ), Fit Distribution( Normal ) ) );
obj << Local Data Filter(
Location( {0, 0} ),
Add Filter( columns( :age ), Where( :age == 12 ) ),
Mode( Select( 0 ), Show( 1 ), Include( 1 ) )
);
obj << Automatic Recalc( 0 );
dt << Select Where( :sex == "F" );
dt << Exclude();
rpt = obj << Report;
Code Explanation:
- Open data table.
- Create distribution object for weight.
- Add local data filter for age 12.
- Select females in data table.
- Exclude selected rows.
- Generate report from distribution object.
- Close data table without saving.
- Reopen data table.
- Recreate distribution object for weight.
- Add local data filter for age 12 again.
Example 305
Summary: Creates a distribution analysis with an outlier box and marker draw column, saving the report as a PDF file.
Code:
folderPathTmp = "$DESKTOP";
dt = Open("data_table.jmp");
dist = Distribution(
Continuous Distribution( Column( :height ) ),
SendToReport(
Dispatch( {"height"}, "Distrib Outlier Box", FrameBox, {DispatchSeg( Marker Seg( 1 ), Set Marker Draw Column( :picture ) )} )
)
);
dist << save pdf( folderPathTmp || "/JMP-10556.pdf" );
Code Explanation:
- Define
folderPathTmp. - Open data table.
- Create distribution analysis.
- Configure outlier box.
- Set marker draw column.
- Save report as PDF.
Example 306
Summary: Analyze height data by sex, generating a frequency table and setting custom orders for both variables.
Code:
dt2 = Open("data_table.jmp");
DstObj = dt2 << Distribution( Nominal Distribution( Column( :height ) ), Automatic Recalc( 1 ) );
OnewayObj = dt2 << Oneway( Y( :height ), X( :sex ), Means( 1 ), Mean Diamonds( 1 ), Automatic Recalc( 1 ) );
dt2:height << Set Property( "Value Order", {Custom Order( {70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, 56, 55, 52, 51} )} );
dt2:sex << Set Property( "Value Order", {Custom Order( {"M", "F"} )} );
ValsTable2 = (Report( Dstobj ) << Parent)["Frequencies"][Table Box( 1 )] << make into data table;
vals2 = :level << get as matrix;
Code Explanation:
- Open data table;
- Create distribution for height.
- Enable automatic recalculation.
- Create oneway analysis for height by sex.
- Set custom order for height values.
- Set custom order for sex values.
- Extract frequency table from distribution.
- Convert level column to matrix.
Example 307
Summary: Creates a distribution analysis for two nominal columns, 'In what grade are you' and 'How old are you', generating a new data table with frequencies.
Code:
dtOrder = Open("data_table.jmp");
Dist = dtOrder << Distribution(
Nominal Distribution( Column( :In what grade are you ) ),
Nominal Distribution( Column( :How old are you ) )
);
dtNew = Report( Dist )[Outline Box( "Distributions" )][Outline Box( "In what grade are you" )][Outline Box( "Frequencies" )][Table Box( 1 )
] << Make Into Data Table;
dtNew:Level << Set Selected;
dtNew:Level << Get values;
Code Explanation:
- Open data table.
- Create distribution analysis.
- Analyze grade column.
- Analyze age column.
- Extract frequencies table.
- Convert to new data table.
- Select all levels.
- Retrieve level values.
Example 308
Summary: Analyze continuous distribution for the 'Order Year' column, utilizing a Distribution platform to visualize outliers with an outlier box plot.
Code:
dt1 = Open("data_table.jmp");
dist = dt1 << Distribution( Continuous Distribution( Column( :Order Year ), Outlier Box Plot( 0 ) ) );
dist << close window;
Code Explanation:
- Open data table.
- Create distribution analysis.
- Select continuous distribution.
- Analyze "Order Year" column.
- Add outlier box plot.
- Close outlier box plot option.
- Close distribution window.
Example 309
Summary: Calculates and compares summary statistics for single and married individuals based on age distribution, utilizing JMP's Distribution platform.
Code:
dt = Open("data_table.jmp");
dist = dt << Distribution( Y( :age ) );
dist << Automatic Recalc( 1 );
dt << select where( :marital status == "Single" );
dt << Hide and Exclude( 1 );
sumStats1 = Report( dist )["Summary Statistics"][Table Box( 1 )] << get as matrix;
certStats1 = [31.4285714285714, 5.26819192454548, 0.37629942318182, 32.1707106754606, 30.6864321816823, 196, 0];
dt << Clear Row States;
dt << Select Where( :marital status == "Married" );
dt << Hide and Exclude;
sumStats2 = Report( dist )["Summary Statistics"][Table Box( 1 )] << get as matrix;
certSTats2 = [29.4205607476636, 6.95272090511927, 0.672144899712939, 30.7531533853441, 28.087968109983, 107, 0];
Code Explanation:
- Open data table;
- Create distribution for age.
- Enable automatic recalculation.
- Select single marital status rows.
- Hide and exclude selected rows.
- Get summary statistics matrix.
- Define certified statistics for singles.
- Clear row states.
- Select married marital status rows.
- Hide and exclude selected rows.
Example 310
Summary: Performs the distribution analysis for a specified column in a data table, saving the results to a temporary journal file and attempting to include it.
Code:
dt = Open("data_table.jmp");
dist = dt << Distribution( Column( :weight ) );
dist << Save Journal( "$TEMP/data_table.jrn" );
error = "";
Try( Include( "$TEMP/data_table.jrn" ), error = Char( exception_msg[1] ) );
Delete File( "$TEMP/data_table.jrn" );
Code Explanation:
- Open data table;
- Create distribution analysis for weight.
- Save distribution journal to temp.
- Initialize error variable.
- Attempt to include saved journal.
- Capture exception message if error occurs.
- Delete temporary journal file.
Example 311
Summary: Analyze and visualize multiple continuous distributions in a data table, including CDF plots, quantile box plots, standard error bars, and capability analysis.
Code:
dt under test = Open("data_table.jmp");
obj = Distribution(
Continuous Distribution( Column( :CD3 ), CDF Plot( 1 ) ),
Continuous Distribution( Column( :CD8 ), Vertical( 0 ), Normal Quantile Plot( 1 ) ),
Continuous Distribution( Column( :MCB ), Quantile Box Plot( 1 ) ),
Continuous Distribution( Column( :Prin1 ), Std Error Bars( 1 ), Capability Analysis( LSL( -2 ), USL( 2 ), Target( 0 ) ) ),
Continuous Distribution( Column( :Prin2 ), Count Axis( 1 ), Prob Axis( 1 ), Density Axis( 1 ), Fit Distribution( Normal ) ),
SendToReport(
Dispatch( {"Distributions", "CD3"}, "Distrib Histogram", FrameBox, {DispatchSeg( Hist Seg( 1 ), Bin Span( 24, 0 ) )} ),
Dispatch( {"Distributions", "CD8"}, "5", ScaleBox,
{Scale( "Normal" ), Min( 0.00015996800639872 ), Max( 0.999840031993601 ), Inc( 0 ), Minor Ticks( 0 ), Show Major Grid( 1 )}
),
Dispatch( {"Distributions", "MCB"}, "1", ScaleBox,
{Scale( "Log" ), Format( "Fixed Dec", 10, 6 ), Min( 1 ), Max( 2000 ), Inc( 1 ), Minor Ticks( 1 )}
),
Dispatch( {"Distributions", "Prin1"}, "Distrib Histogram", FrameBox,
{DispatchSeg( LabelSeg( 1 ), {Font( {"Segoe UI", 7} )} ), DispatchSeg( LabelSeg( 2 ), {Font( {"Segoe UI", 7} )} ),
DispatchSeg( LabelSeg( 3 ), {Font( {"Segoe UI", 7} )} )}
)
)
);
Code Explanation:
- Open data_table data
- Create Distribution object.
- Analyze CD3 column.
- Plot CDF for CD3.
- Analyze CD8 column.
- Add vertical line at 0 for CD8.
- Plot normal quantile for CD8.
- Analyze MCB column.
- Plot quantile box plot for MCB.
- Analyze Prin1 column.
- Add standard error bars for Prin1.
- Perform capability analysis on Prin1.
- Analyze Prin2 column.
- Enable count, probability, and density axes for Prin2.
- Fit normal distribution to Prin2.
- Customize reports for each distribution.
- Adjust histogram bin span for CD3.
- Set scale for CD8.
- Set log scale for MCB.
- Customize fonts for Prin1 labels.
Example 312
Summary: Creates a distribution object to visualize and customize box plots for continuous data, with options to dispatch to different frames and style boxes.
Code:
dt under test = Open("data_table.jmp");
obj = Distribution(
Continuous Distribution( Column( :weight ), Quantile Box Plot( 1 ) ),
SendToReport(
Dispatch( {}, "Distrib Box", FrameBox,
{DispatchSeg(
Box Plot Seg( 1 ),
{Box Style( "Quantile" ), Line Color( "Dark Green" ), Line Style( "Dotted" )}
)}
),
Dispatch( {}, "Distrib Outlier Box", FrameBox,
{DispatchSeg(
Box Plot Seg( 1 ),
{Box Style( "Outlier" ), Line Color( "Medium Dark Blue" ), Line Style( "Dashed" )}
)}
)
)
);
Code Explanation:
- Open data table.
- Create distribution object.
- Analyze weight column.
- Enable quantile box plot.
- Customize report layout.
- Dispatch to distrib box frame.
- Set box style to quantile.
- Change line color to dark green.
- Apply dotted line style.
- Dispatch to outlier box frame.
Example 313
Summary: Fits a distribution to the Height column in a data table, with power animation enabled for visualizing the mean at 60.
Code:
Open("data_table.jmp");
obj = Distribution( Column( :Height ) );
obj = obj << Test Mean( 60, Power Animation );
Code Explanation:
- Open data table.
- Create distribution object for Height.
- Test mean of Height at 60.
- Enable power animation.
Example 314
Summary: Process of testing the mean value of a distribution, with power animation enabled for visualizing the results.
Code:
dt under test = Open("data_table.jmp");
obj = Distribution( Column( :Height ) );
obj = obj << Test Mean( 60, Power Animation );
obj = Window( "Power for Testing Mean" );
Code Explanation:
- Open data table;
- Create distribution object for Height.
- Perform mean test on Height.
- Set mean test value to 60.
- Enable power animation.
- Display power for testing mean window.
Example 315
Summary: Analyze Premium USD column by creating a distribution object with quantile box plot and normal quantile plot, while disabling quantiles display and summary statistics.
Code:
dt under test = Open("data_table.jmp");
obj = Distribution(
Continuous Distribution(
Column( :Premium USD ),
Quantiles( 0 ),
Summary Statistics( 0 ),
Quantile Box Plot( 1 ),
Normal Quantile Plot( 1 )
)
);
Code Explanation:
- Open data table.
- Create distribution object.
- Analyze Premium USD column.
- Disable quantiles display.
- Disable summary statistics.
- Enable quantile box plot.
- Enable normal quantile plot.
Example 316
Summary: Creates a distribution analysis with a normal fit to the weight column and nominal analysis of the age column, customizing histogram and line segment styles.
Code:
dt = Open( "$SAMPLE_DATA/data_table.jmp", invisible );
dist = dt << Distribution(
Continuous Distribution( Column( :weight ), Fit Distribution( Normal ) ),
Nominal Distribution( Column( :age ) )
);
Report( dist )[framebox( 1 )] << DispatchSeg( Hist Seg( 1 ), {Line Style( Dotted ), Fill Color( {0, 128, 0} ), Histogram Color( -32768 )} );
Report( dist )[framebox( 1 )] << DispatchSeg( Line Seg( 1 ), {Line Color( {0, 0, 255} ), Line Width( 5 )} );
frame = Report( dist )[framebox( 1 )];
segLine = (frame << Find Seg( Line Seg( 1 ) ));
segHist = (frame << Find Seg( Hist Seg( 1 ) ));
ls = Char( segHist << Get Line Style );
lc = segLine << Get Line Color;
Code Explanation:
- Open data table;
- Create distribution analysis.
- Fit normal distribution to weight.
- Analyze age as nominal.
- Modify histogram segment style.
- Set histogram fill color.
- Change histogram outline color.
- Customize line segment color.
- Increase line segment width.
- Retrieve line and histogram segments.
Example 317
Summary: Creates a distribution analysis report with frequencies, utilizing the EMS method to fit a linear model with interactions and random effects.
Code:
dt = Open("data_table.jmp");
dist = Distribution( Continuous Distribution( Column( :weight ) ), Nominal Distribution( Column( :age ) ) );
log = "";
log = Collapse Whitespace( Log Capture( Report( dist )["Frequencies"][Table Box( 1 )] << Delete Row( 1 ) ) );
Code Explanation:
- Open data table.
- Create distribution analysis.
- Initialize log variable.
- Capture report log.
- Collapse whitespace in log.
- Delete first row from frequencies table box.
Example 318
Summary: Vizualizes a distribution plot with interactive features, including frame box access and fill color customization.
Code:
dt = Open("data_table.jmp");
obj = Distribution( Continuous Distribution( Column( :height ) ), Continuous Distribution( Column( :weight ) ) );
(Report( obj )[FrameBox( 3 )] << Find Seg( Hist Seg( 1 ) )) << Fill Color( "Red" );
Code Explanation:
- Open data table.
- Create distribution object.
- Access third frame box.
- Find histogram segment.
- Set fill color to red.
Example 319
Summary: Runs the calculation and reporting of summary statistics (mean, sum, count, median, maximum, and standard deviation) for a continuous column in JMP.
Code:
dt = Open("data_table.jmp");
dist = Distribution( Continuous Distribution( Column( Transform Column( "Mean[height]", Formula( Col Mean( :height ) ) ) ) ) );
rpt = dist << report;
ActualValue = rpt[Number Col Box( 1 )][1];
dist << close window;
dist = Distribution( Continuous Distribution( Column( Transform Column( "Sum[height]", Formula( Col Sum( :height ) ) ) ) ) );
rpt = dist << report;
ActualValue = rpt[Number Col Box( 1 )][1];
dist << close window;
dist = Distribution( Continuous Distribution( Column( Transform Column( "Count[height]", Formula( Col Number( :height ) ) ) ) ) );
rpt = dist << report;
ActualValue = rpt[Number Col Box( 1 )][1];
dist << close window;
dist = Distribution( Continuous Distribution( Column( Transform Column( "Median[height]", Formula( Col Quantile( :height, 0.5 ) ) ) ) ) );
rpt = dist << report;
ActualValue = rpt[Number Col Box( 1 )][1];
dist << close window;
dist = Distribution( Continuous Distribution( Column( Transform Column( "Minimum[height]", Formula( Col Minimum( :height ) ) ) ) ) );
rpt = dist << report;
ActualValue = rpt[Number Col Box( 1 )][1];
dist << close window;
dist = Distribution( Continuous Distribution( Column( Transform Column( "Maximum[height]", Formula( Col Maximum( :height ) ) ) ) ) );
rpt = dist << report;
ActualValue = rpt[Number Col Box( 1 )][1];
dist << close window;
dist = Distribution( Continuous Distribution( Column( Transform Column( "Stdev[height]", Formula( Col Std Dev( :height ) ) ) ) ) );
rpt = dist << report;
ActualValue = rpt[Number Col Box( 1 )][1];
dist << close window;
Code Explanation:
- Open data table;
- Create "Mean[height]" column.
- Perform distribution analysis.
- Extract mean value.
- Close distribution window.
- Create "Sum[height]" column.
- Perform distribution analysis.
- Extract sum value.
- Close distribution window.
- Repeat steps 6-9 for count, median, minimum, maximum, and standard deviation.
Example 320
Summary: Analyze a continuous distribution by calculating the mean for each combination of height and sex, then reports and extracts quantiles from the results.
Code:
dt = Open("data_table.jmp");
dist = Distribution( Continuous Distribution( Column( Transform Column( "Mean[height][sex]", Formula( Col Mean( :height, :sex ) ) ) ) ) );
rpt = dist << report;
quant = rpt[Number Col Box( 1 )] << get as matrix;
dist << close window;
Code Explanation:
- Open data table.
- Create new column with mean.
- Perform distribution analysis.
- Retrieve report object.
- Extract quantiles from report.
- Close distribution window.
Example 321
Summary: Runs the transformation and renaming of a 'Year Week' column in a JMP data table, utilizing a Distribution object to create a new character-type column.
Code:
dt = Open("data_table.jmp");
dt << delete rows( 2 :: 228 );
obj = Distribution(
Nominal Distribution(
Column(
Transform Column(
"Year Week",
Character,
Formula(
Local( {w = Week Of Year( :date, 3 ), y = Year( :date ), m = Month( :date )},
Char( If( m / w >= 12, y + 1, w / m >= 52, y - 1, y ) ) || If( w >= 10, "W", "W0" ) || Char( w )
)
)
)
)
)
);
obj << close window;
Code Explanation:
- Open data table.
- Delete specific rows.
- Create distribution object.
- Define nominal distribution.
- Transform "Year Week" column.
- Convert to character type.
- Apply transformation formula.
- Extract week, year, month.
- Calculate transformed year.
- Concatenate year, week for new column.
Example 322
Summary: Creates and arranges continuous distributions for multiple variables, generating a report from the object and stacking distributions vertically and horizontally.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution(
Arrange in Rows( 3 ),
Continuous Distribution( Column( :Name( "pop- m" ) ) ),
Continuous Distribution( Column( :POP ) ),
Continuous Distribution( Column( :Max deg. F Jan ) ),
Continuous Distribution( Column( :OZONE ) ),
Continuous Distribution( Column( :CO ) ),
Continuous Distribution( Column( :SO2 ) ),
Continuous Distribution( Column( :NO ) ),
Continuous Distribution( Column( :PM10 ) ),
Continuous Distribution( Column( :Lead ) )
);
rpt = Report( obj );
obj << stack( 1 );
obj << close window;
obj = dt << Distribution(
Stack( 1 ),
Arrange in Rows( 4 ),
Continuous Distribution( Column( :Name( "pop- m" ) ), Horizontal Layout( 1 ), Vertical( 0 ) ),
Continuous Distribution( Column( :POP ), Horizontal Layout( 1 ), Vertical( 0 ) ),
Continuous Distribution( Column( :Max deg. F Jan ), Horizontal Layout( 1 ), Vertical( 0 ) ),
Continuous Distribution( Column( :OZONE ), Horizontal Layout( 1 ), Vertical( 0 ) ),
Continuous Distribution( Column( :CO ), Horizontal Layout( 1 ), Vertical( 0 ) ),
Continuous Distribution( Column( :SO2 ), Horizontal Layout( 1 ), Vertical( 0 ) ),
Continuous Distribution( Column( :NO ), Horizontal Layout( 1 ), Vertical( 0 ) ),
Continuous Distribution( Column( :PM10 ), Horizontal Layout( 1 ), Vertical( 0 ) ),
Continuous Distribution( Column( :Lead ), Horizontal Layout( 1 ), Vertical( 0 ) )
);
rpt = obj << report;
Code Explanation:
- Open data table;
- Create distribution object.
- Arrange in 3 rows.
- Add continuous distribution for "pop- m".
- Add continuous distribution for "POP".
- Add continuous distribution for "Max deg. F Jan".
- Add continuous distribution for "OZONE".
- Add continuous distribution for "CO".
- Add continuous distribution for "SO2".
- Add continuous distribution for "NO".
- Add continuous distribution for "PM10".
- Add continuous distribution for "Lead".
- Generate report from object.
- Stack distributions vertically.
- Close distribution window.
- Create new distribution object.
- Stack distributions horizontally.
- Arrange in 4 rows.
- Add continuous distribution for "pop- m".
- Add continuous distribution for "POP".
- Add continuous distribution for "Max deg. F Jan".
- Add continuous distribution for "OZONE".
- Add continuous distribution for "CO".
- Add continuous distribution for "SO2".
- Add continuous distribution for "NO".
- Add continuous distribution for "PM10".
- Add continuous distribution for "Lead".
- Generate report from object.
Example 323
Summary: Creates a distribution analysis object for testing mean at 60 with P-value animation in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Continuous Distribution( Column( :height ), Test Mean( 60, P Value Animation ) ) );
myani = Window( "P-Value for Testing Mean" );
Code Explanation:
- Open data table.
- Create distribution analysis object.
- Select height column for analysis.
- Test mean at 60.
- Enable P-value animation.
- Create new window for animation.
Example 324
Summary: Analyze continuous distributions for height and weight columns, testing mean values at 60 and 100 with P-Value Animation enabled.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution(
Continuous Distribution( Column( :height ), Test Mean( 60, P Value Animation ) ),
Continuous Distribution( Column( :weight ), Test Mean( 100, P Value Animation ) )
);
myani1 = Window( "P-Value for Testing Mean" );
Code Explanation:
- Open data table.
- Create distribution object.
- Analyze height column.
- Test mean at 60.
- Enable P Value Animation.
- Analyze weight column.
- Test mean at 100.
- Enable P Value Animation.
- Create new window.
- Name window "P-Value for Testing Mean".
Example 325
Summary: Selects and excludes specific rows, followed by the creation of a distribution object for analyzing age and sex columns, and generates a report.
Code:
dt = Open("data_table.jmp");
dt << select rows( {3, 4, 5} ) << exclude;
obj = dt << Distribution(
Nominal Distribution( Column( :age ), Order By( "Count Descending" ) ),
Nominal Distribution( Column( :sex ), Order By( "Count Descending" ) )
);
rpt = obj << report;
Code Explanation:
- Open table.
- Select specific rows.
- Exclude selected rows.
- Create distribution object.
- Analyze age column.
- Order by count descending.
- Analyze sex column.
- Order by count descending.
- Generate report object.
- Save report.
Example 326
Summary: Fits a continuous distribution model using the Negative Binomial method, generating a report with CDF plot and ZI fit.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Continuous Distribution( Column( :satell ), CDF Plot( 1 ), Fit ZI Negative Binomial ) );
rpt = obj << report;
Code Explanation:
- Open table.
- Create distribution object.
- Specify continuous distribution.
- Select column for analysis.
- Enable CDF plot.
- Fit ZI Negative Binomial model.
- Generate report.
Example 327
Summary: Analyze a data table by fitting a distribution to the response column, selecting all rows, and enabling automatic recalculation.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution(
Freq( :Count ),
Nominal Distribution( Column( :Response ), Test Probabilities( Test( Less than ), 0.5, f, 0.5, f ) )
);
dt << Select All Rows << delete rows;
obj << Automatic Recalc( 1 );
Code Explanation:
- Open data table;
- Create distribution object.
- Set frequency column.
- Analyze Response column.
- Test less than 0.5 probability.
- Delete all rows from table.
- Enable automatic recalculation.
Example 328
Summary: Fits a continuous distribution to the weight column, generating a report with confidence intervals and quantile profiler.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution(
Continuous Distribution(
Column( :weight ),
Fit Smooth Curve(
Bandwidth( 9.554767 ),
Quantile Profiler( 1, Confidence Intervals( 1 ), Term Value( Probability( 0.05, Lock( 0 ), Show( 1 ) ) ) )
)
)
);
rpt = obj << report;
Code Explanation:
- Open data table.
- Create distribution object.
- Analyze weight column.
- Fit smooth curve.
- Set bandwidth value.
- Enable quantile profiler.
- Display confidence intervals.
- Set probability threshold.
- Lock probability value.
- Generate report.
Example 329
Summary: Analyze a continuous distribution with normal mixtures using 2 and 3 clusters, generating a report object.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution(
Freq( :CO ),
Continuous Distribution(
Column( :POP ),
Fit Distribution( Normal Mixtures( Clusters( 3 ) ) ),
Fit Distribution( Normal Mixtures( Clusters( 2 ) ) )
)
);
rpt = obj << report;
Code Explanation:
- Open data table.
- Create distribution object.
- Set frequency column to CO.
- Analyze continuous distribution.
- Select population column.
- Fit normal mixtures with 3 clusters.
- Fit normal mixtures with 2 clusters.
- Generate report object.
Example 330
Summary: Fits a Beta Binomial distribution to a continuous column, utilizing the EMS method with interactions and random effects.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution(
Continuous Distribution(
Column( :CO ),
Quantiles( 0 ),
Summary Statistics( 0 ),
Histogram( 0 ),
Outlier Box Plot( 0 ),
Fit Distribution( Beta Binomial( Sample Size( 23 ), Goodness of Fit( 1 ) ) ),
Fit Beta Binomial( Sample Size( 23 ), Fix Parameters( [0.4 .] ), QQ Plot( 1 ), PP Plot( 1 ) )
)
);
dt << select all rows << delete rows;
obj << automatic recalc;
Code Explanation:
- Open data table;
- Create Distribution object.
- Set CO column for analysis.
- Disable Quantiles display.
- Disable Summary Statistics display.
- Disable Histogram display.
- Disable Outlier Box Plot display.
- Fit Beta Binomial distribution.
- Set sample size to 23.
- Enable Goodness of Fit test.
- Fit Beta Binomial distribution again.
- Fix parameters to [0.4].
- Enable QQ Plot display.
- Enable PP Plot display.
- Select all rows in dataset.
- Delete selected rows.
- Recalculate Distribution object automatically.
Example 331
Summary: Cutomizes summary statistics for a continuous distribution, including KStd Dev, KStd Dev Above Mean, and K*Std Dev Below Mean, with a specified alpha level and K multiplier.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution(
Continuous Distribution(
Column( :height ),
Customize Summary Statistics(
"K*Std Dev"n( 1 ),
"K*Std Dev Above Mean"n( 1 ),
"K*Std Dev Below Mean"n( 1 ),
Set Alpha Level( 0.05 ),
K Multiplier( 4 )
)
)
);
rpt = obj << repot;
Close( dt, no save );
Preferences( Distribution Summary Statistics( K Multiplier( 3, <<Off ) ) );
Code Explanation:
- Open data table;
- Create distribution object for height.
- Customize summary statistics.
- Set K multiplier to 4.
- Set alpha level to 0.05.
- Generate report.
- Close dataset without saving.
- Disable K multiplier in preferences.
Example 332
Summary: Fits a lognormal distribution to the 'height' column in a data table, generating a report object.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Continuous Distribution( Column( :height ), Fit Lognormal ) );
rpt = obj << report;
Code Explanation:
- Open data table;
- Create distribution object.
- Select continuous distribution.
- Analyze "height" column.
- Fit lognormal distribution.
- Generate report object.
Example 333
Summary: Creates and customizes a histogram segment with orange fill color, enabling automatic recalculation and redo analysis for multiple iterations with different layout options.
Code:
dt = Open("data_table.jmp");
dist = dt << Distribution( Nominal Distribution( Column( :I want to see the world ) ), );
fb = Report( dist )[FrameBox( 1 )];
hs = fb << Find Seg( Hist Seg( 1 ) );
hs << Fill Color( "Orange" );
dist << Automatic Recalc( 1 );
dist2 = dist << Redo Analysis;
fb2 = Report( dist2 )[FrameBox( 1 )];
hs2 = fb2 << Find Seg( Hist Seg( 1 ) );
dist = dt << Distribution( Nominal Distribution( Column( :I want to see the world ) ), );
fb = Report( dist )[FrameBox( 1 )];
hs = fb << Find Seg( Hist Seg( 1 ) );
hs << Fill Color( "Orange" );
dist << Stack( 1 );
dist2 = dist << Redo Analysis;
fb2 = Report( dist2 )[FrameBox( 1 )];
hs2 = fb2 << Find Seg( Hist Seg( 1 ) );
dist = dt << Distribution( Nominal Distribution( Column( :I want to see the world ) ), );
fb = Report( dist )[FrameBox( 1 )];
hs = fb << Find Seg( Hist Seg( 1 ) );
hs << Fill Color( "Orange" );
dist << Horizontal Layout( 1 );
dist2 = dist << Redo Analysis;
fb2 = Report( dist2 )[FrameBox( 1 )];
hs2 = fb2 << Find Seg( Hist Seg( 1 ) );
Code Explanation:
- Open data table.
- Create distribution analysis.
- Access first frame box.
- Find histogram segment.
- Set fill color to orange.
- Enable automatic recalculation.
- Redo analysis.
- Access first frame box of new report.
- Find histogram segment.
- Repeat steps 2-9 for stacking and horizontal layout.
Example 334
Summary: Fits a lognormal distribution to the CO column in a data table, generating a QQ plot and retrieving a report.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Column( :CO ) );
obj << Fit Lognormal;
test = "Lognormal";
obj << (Fit Handle[test] << QQ Plot( 1 ));
rpt = obj << report;
Code Explanation:
- Open data table.
- Create distribution object for CO column.
- Fit lognormal distribution.
- Assign "Lognormal" to test variable.
- Generate QQ plot for lognormal fit.
- Retrieve report from distribution object.
Example 335
Summary: Analyze continuous data by fitting a distribution to the 'height' column, customizing summary statistics with K*Std Dev, and setting alpha level and K multiplier.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution(
Continuous Distribution(
Column( :height ),
Customize Summary Statistics(
"K*Std Dev"n( 1 ),
"K*Std Dev Above Mean"n( 1 ),
"K*Std Dev Below Mean"n( 1 ),
Set Alpha Level( 0.05 ),
K Multiplier( 4 )
)
)
);
rpt = obj << repot;
Code Explanation:
- Open data table;
- Create distribution analysis.
- Select continuous distribution.
- Analyze height column.
- Customize summary statistics.
- Include K*Std Dev.
- Include K*Std Dev Above Mean.
- Include K*Std Dev Below Mean.
- Set alpha level to 0.05.
- Set K multiplier to 4.
Example 336
Summary: Process of filtering a continuous distribution for female subjects and generating a report.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Continuous Distribution( Column( :height ) ) );
myldf = obj << Local Data Filter( Add Filter( columns( :sex ), Where( :sex == "F" ) ) );
rpt = obj << report;
Code Explanation:
- Open table.
- Create distribution object.
- Add local data filter.
- Filter for females.
- Generate report.
Example 337
Summary: Analyze continuous data in a distribution platform, fitting a negative binomial distribution and generating reports with quantile profiler, PP plot, and QQ plot.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution(
Continuous Distribution(
Column( :CO ),
Quantiles( 0 ),
Moments( 0 ),
Histogram( 0 ),
Outlier Box Plot( 0 ),
Fit Negative Binomial( QQ Plot( 1 ), PP Plot( 1 ), Distribution Profiler( 1 ), Quantile
Profiler( 1 ) )
)
);
rpt = obj << report;
Code Explanation:
- Open data table.
- Launch Distribution platform.
- Select continuous distribution analysis.
- Analyze "CO" column.
- Disable quantiles calculation.
- Disable moments calculation.
- Disable histogram display.
- Disable outlier box plot.
- Fit negative binomial distribution.
- Enable QQ plot.
- Enable PP plot.
- Enable distribution profiler.
- Enable quantile profiler.
- Retrieve analysis report.
Example 338
Summary: Analyze a continuous variable and nominal variable, generating a report with customized headings using the Distribution platform in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution(
Continuous Distribution( Column( :weight ) ),
Nominal Distribution( Column( :age ) ),
SendToReport( Dispatch( {"age", "Frequencies"}, "Count", NumberColBox, {Set Heading( "~Count" )} ) )
);
Code Explanation:
- Open table.
- Create distribution object.
- Analyze continuous variable.
- Analyze nominal variable.
- Customize report title.
Example 339
Summary: Fits a Weibull distribution to a continuous column in a data table, generating a report with summary statistics.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Continuous Distribution( Column( :Name( "Serving/pkg" ) ), Fit Distribution( Weibull ) ) );
rpt = obj << report;
Code Explanation:
- Open data table;
- Create distribution object.
- Specify continuous distribution.
- Select column for analysis.
- Fit Weibull distribution.
- Generate distribution report.
Example 340
Summary: Fits a Johnson SL distribution to a continuous column, generating a report with detailed analysis.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution(
Freq( :Count ),
Continuous Distribution( Column( :Count ), Quantiles( 0 ), Moments( 0 ), Outlier Box Plot( 0 ), Fit Distribution( Johnson Sl ) )
);
rpt = obj << report;
Code Explanation:
- Open data table;
- Create distribution object.
- Set frequency column.
- Analyze continuous distribution.
- Specify count column.
- Disable quantiles.
- Disable moments.
- Disable outlier box plot.
- Fit Johnson SL distribution.
- Generate report.
Example 341
Summary: Fits three continuous distributions (Johnson Su, GLog, and Johnson Sb) to a specified column in a data table, generating a report with summary statistics.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution(
Continuous Distribution(
Column( :satell ),
Quantiles( 0 ),
Summary
Statistics( 0 ),
Outlier Box Plot( 0 ),
Fit Distribution( Johnson Su ),
Fit Distribution( GLog ),
Fit Distribution( Johnson Sb )
)
);
rpt = obj << report;
Code Explanation:
- Open data table.
- Launch Distribution platform.
- Select continuous distribution.
- Choose column "satell".
- Disable quantiles summary.
- Disable statistics summary.
- Disable outlier box plot.
- Fit Johnson Su distribution.
- Fit GLog distribution.
- Fit Johnson Sb distribution.
Example 342
Summary: Fits various continuous distributions to a Y column, including Normal, Johnson SL, SU, SB, GLog, and Normal Mixtures with Clusters.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution(
Continuous Distribution(
Column( :Y ),
Fit Distribution( Normal ),
Fit Distribution( Johnson Sl ),
Fit Distribution( Johnson Su ),
Fit Distribution( Johnson Sb ),
Fit Distribution( GLog ),
Fit Distribution( Normal Mixtures( Clusters( 2 ) ) ),
Fit Distribution( Beta Binomial( Sample Size( 80 ) ) ),
Fit Distribution( Binomial( Sample Size( 80 ) ) )
)
);
Code Explanation:
- Open table.
- Create distribution object.
- Select continuous distribution.
- Analyze Y column.
- Fit normal distribution.
- Fit Johnson SL distribution.
- Fit Johnson SU distribution.
- Fit Johnson SB distribution.
- Fit GLog distribution.
- Fit normal mixtures.
Example 343
Summary: Creates a custom distribution object with specified quantiles and moments, then retrieves the report as a matrix.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution(
Continuous Distribution( Column( :Zt ), Quantiles( 0 ), Moments( 0 ), Custom Quantiles( 0.95, [0.5, 0.25, 0.1, 0.025, 0.005] ) )
);
rpt = obj << report;
myx = rpt[Table Box( 2 )] << get as matrix;
Code Explanation:
- Open data table;
- Create distribution object.
- Set continuous distribution parameters.
- Disable default quantiles.
- Disable default moments.
- Enable custom quantiles.
- Specify custom quantile levels.
- Retrieve report object.
- Access second table box.
- Convert table box to matrix.
Example 344
Summary: Creates a continuous distribution object for column NPN1, including normal quantile and stem-and-leaf plots.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Continuous Distribution( Column( :NPN1 ), Normal Quantile Plot( 1 ), Stem and Leaf( 1 ) ) );
Code Explanation:
- Open data table;
- Create distribution object.
- Select continuous distribution.
- Specify column NPN1.
- Add normal quantile plot.
- Add stem and leaf plot.
Example 345
Summary: Fits a Weibull distribution to the Temperature column in a data table, generating a report object with the results.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Continuous Distribution( Column( :Temperature ), Fit Distribution( Weibull ) ) );
rpt = obj << report;
Code Explanation:
- Open data table;
- Create distribution object.
- Analyze temperature column.
- Fit Weibull distribution.
- Generate report object.
Example 346
Summary: Analyze and visualize the PNP1 column in a data table, generating a normal quantile plot and stem and leaf plot.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Continuous Distribution( Column( :PNP1 ), Normal Quantile Plot( 1 ), Stem and Leaf( 1 ) ) );
Code Explanation:
- Open data table.
- Create distribution object.
- Analyze PNP1 column.
- Generate normal quantile plot.
- Generate stem and leaf plot.
Example 347
Summary: Fits a GLog distribution to Quick's Weight Change data, generating a report object.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Continuous Distribution( Column( :Quick's Weight Change ), Fit Distribution( GLog ) ) );
rpt = obj << report;
Code Explanation:
- Open data table;
- Create distribution object.
- Select Quick's Weight Change column.
- Fit GLog distribution.
- Generate report object.
Example 348
Summary: Fits a Weibull distribution to height data, selecting and hiding specific rows for analysis.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Continuous Distribution( Column( :height ), Fit Distribution( Weibull ) ) );
dt << Select Rows( {1, 2, 3} ) << hide << exclude;
obj << Automatic Recalc( 1 );
Code Explanation:
- Open data table;
- Create distribution object.
- Fit Weibull distribution to height.
- Select rows 1, 2, 3.
- Hide selected rows.
- Exclude selected rows.
- Enable automatic recalculation.
Example 349
Summary: Creates a distribution analysis for height, including customization options and automatic recalculation, while also generating a separate distribution analysis for age with standard error and cumulative probability.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution(
Continuous Distribution( Column( :height ), Normal Quantile Plot( 1 ), Test Mean( 0 ) ),
SendToReport(
Dispatch( {"height"}, "Distrib Histogram", FrameBox, {Background Color( 71 )} ),
Dispatch( {"height"}, "Distrib Outlier Box", FrameBox, {DispatchSeg( Marker Seg( 1 ), {Marker( "Star" )} )} ),
Dispatch( {"height"}, "Distrib Quantile Plot", FrameBox,
{Background Color( 69 ), DispatchSeg( Marker Seg( 1 ), {Marker( "Right Triangle" )} )}
),
Dispatch( {"height", "Test Mean"}, "Distrib Test Mean", FrameBox, {Background Color( 73 )} )
)
);
rpt = obj << report;
actColor = rpt[FrameBox( 3 )] << get background color;
actColor2 = rpt[FrameBox( 2 )] << get background color;
actColor3 = rpt[FrameBox( 1 )] << get background color;
obj << stack;
actColora = rpt[FrameBox( 1 )] << get background color;
actColorb = rpt[FrameBox( 2 )] << get background color;
actColorc = rpt[FrameBox( 3 )] << get background color;
obj2 = dt << Distribution(
Nominal Distribution( Column( :age ) ),
SendToReport(
Dispatch( {"age", "Frequencies"}, "StdErr Prob", NumberColBox, {Visibility( "Visible" )} ),
Dispatch( {"age", "Frequencies"}, "Cum Prob", NumberColBox, {Visibility( "Visible" )} )
)
);
obj2 << Automatic Recalc( 1 );
Code Explanation:
- Open data table;
- Create distribution analysis for height.
- Enable normal quantile plot for height.
- Test mean of height against 0.
- Customize histogram background color.
- Customize outlier box marker style.
- Customize quantile plot background and marker style.
- Customize test mean background color.
- Retrieve initial background colors.
- Stack distribution analysis.
- Retrieve stacked background colors.
- Create distribution analysis for age.
- Display standard error and cumulative probability.
- Enable automatic recalculation.
Example 350
Summary: Selects and excludes rows, creation of a distribution object for age, and generation of a report from the data table.
Code:
dt = Open("data_table.jmp");
dt << select rows( {3, 4, 5} ) << exclude;
obj = dt << Distribution( Nominal Distribution( Column( :age ) ) );
rpt = obj << report;
Code Explanation:
- Open data table;
- Select rows 3, 4, 5.
- Exclude selected rows.
- Create distribution object for age.
- Generate report from object.
Example 351
Summary: Creates and configures a distribution analysis for the height column, enabling CDF plots with customized scale adjustments.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution(
Continuous Distribution( Column( :height ), Horizontal Layout( 1 ), Vertical( 0 ), CDF Plot( 1 ) ),
SendToReport( Dispatch( {"height", "CDF Plot"}, "2", ScaleBox, {Min( 0.0875 ), Max( 1.0875 ), Inc( 0.2 ), Minor Ticks( 1 )} ) )
);
obj << Stack( 1 );
rpt = obj << report;
Code Explanation:
- Open data table;
- Create distribution analysis.
- Analyze height column.
- Set horizontal layout.
- Disable vertical layout.
- Enable CDF plot.
- Adjust CDF plot scale.
- Stack plots vertically.
- Retrieve analysis report.
- Assign report to variable.
Example 352
Summary: Creates a distribution object with frequency column 'Profit' and continuous distribution for 'Revenue', utilizing the Distribution platform in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Freq( :Profit ), Continuous Distribution( Column( :Revenue ) ) );
Code Explanation:
- Open data table;
- Create distribution object.
- Set frequency column to "Profit".
- Add continuous distribution.
- Set column for continuous distribution to "Revenue".
Example 353
Summary: Fits a continuous distribution to log2in_TMS1 data, weighted by log2in_CG4847, and generates a report.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Weight( :log2in_CG4847 ), Continuous Distribution( Column( :log2in_TMS1 ), Fit Distribution( "All" ) ) );
rpt = obj << report;
Code Explanation:
- Open data table.
- Create distribution object.
- Set weight for log2in_CG4847.
- Analyze continuous distribution.
- Specify column for analysis.
- Fit all distributions.
- Generate report object.
Example 354
Summary: Creates a distribution object and report, setting the first height value to 100, and retrieving the maximum axis value.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Automatic Recalc( 1 ), Continuous Distribution( Column( :height ) ) );
Column( dt, "height" )[1] = 100;
rpt = obj << report;
actMax = rpt[AxisBox( 1 )] << get max;
Code Explanation:
- Open data table.
- Create distribution object.
- Set first height value to 100.
- Generate report object.
- Get maximum axis value.
Example 355
Summary: Fits a continuous distribution to the PMS1 column, utilizing a smooth curve and specification limits.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution(
Continuous Distribution(
Column( :PMS1 ),
Fit Distribution( Smooth Curve( Spec Limits( LSL( -50.0000000000001 ), USL( -49.9999999999998 ), Target( -50 ) ) ) ),
)
);
obj << stack( 1 );
Code Explanation:
- Open data table.
- Create distribution object.
- Select continuous distribution.
- Analyze PMS1 column.
- Fit smooth curve distribution.
- Set specification limits.
- Set target value.
- Stack results.
Example 356
Summary: Analyze and visualize multiple continuous variables using the Distribution platform in JMP, creating a stacked plot for each variable.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution(
Freq( :ORE_FEMALE_WK1_1 ),
Weight( :ORE_FEMALE_WK1_1 ),
Continuous Distribution( Column( :ORE_FEMALE_WK1_2 ), Stem and Leaf( 1 ) ),
Continuous Distribution( Column( :ORE_FEMALE_WK1_11 ), Stem and Leaf( 1 ) ),
Continuous Distribution( Column( :ORE_FEMALE_WK1_12 ), Stem and Leaf( 1 ) ),
Continuous Distribution( Column( :ORE_FEMALE_WK1_21 ), Stem and Leaf( 1 ) ),
Continuous Distribution( Column( :ORE_FEMALE_WK1_24 ), Stem and Leaf( 1 ) )
);
obj << stack;
Code Explanation:
- Open data table.
- Create distribution object.
- Set frequency column.
- Set weight column.
- Analyze ORE_FEMALE_WK1_2.
- Display stem and leaf plot.
- Analyze ORE_FEMALE_WK1_11.
- Display stem and leaf plot.
- Analyze ORE_FEMALE_WK1_12.
- Display stem and leaf plot.
- Analyze ORE_FEMALE_WK1_21.
- Display stem and leaf plot.
- Analyze ORE_FEMALE_WK1_24.
- Display stem and leaf plot.
- Stack distribution plots.
Example 357
Summary: Fits a linear model using the EMS method with interactions and random effects, generating reports at each stage.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Continuous Distribution( Column( :height ) ) );
rpt = obj << report;
obj << Automatic Recalc( 1 );
rpt = obj << report;
Code Explanation:
- Open data table;
- Create distribution object for height.
- Generate initial report.
- Enable automatic recalculation.
- Update report again.
Example 358
Summary: Fits a log-normal distribution to the height column in a data table, with diagnostic plots and goodness-of-fit analysis.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution(
Continuous Distribution(
Column( :height ),
Fit Distribution( LogNormal( Diagnostic Plot( Median Reference Line( 0 ) ), Goodness of Fit( 1 ), Save Fitted Quantiles ) )
)
);
dt << select all rows << delete rows;
Code Explanation:
- Open data table;
- Create distribution object.
- Select continuous distribution.
- Analyze height column.
- Fit log-normal distribution.
- Add median reference line.
- Enable goodness of fit.
- Save fitted quantiles.
- Select all rows.
- Delete selected rows.
Example 359
Summary: Fits a continuous distribution to column X1 in a data table, utilizing the SHASH method with fixed parameters.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Continuous Distribution( Column( :X1 ), Fit SHASH( Fix Parameters( [-3190 . . .] ) ) ) );
rpt = obj << report;
Code Explanation:
- Open data table.
- Create distribution object.
- Select X1 column for analysis.
- Fit SHASH distribution.
- Fix SHASH parameters.
- Generate report object.
Example 360
Summary: Analyze continuous distribution for 'Pin' column in a data table, utilizing SHASH distribution and fixing parameters from -25000.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution(
Freq( :Weight ),
Weight( :Weight ),
Continuous Distribution( Column( :Pin ), Quantiles( 0 ), Summary Statistics( 0 ), Fit SHASH( Fix Parameters( [-25000 . . .] ) ) )
);
rpt = obj << report;
Code Explanation:
- Open data table;
- Create distribution analysis object.
- Set frequency column to "Weight".
- Set weight column to "Weight".
- Analyze continuous distribution for "Pin".
- Disable quantiles display.
- Disable summary statistics display.
- Fit SHASH distribution.
- Fix parameters from -25000.
- Retrieve analysis report.
Example 361
Summary: Fits a lognormal distribution to a continuous measurement column, utilizing frequency and weight columns for analysis.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution(
Freq( :Standard ),
Weight( :Standard ),
Continuous Distribution( Column( :Measurement ), Fit Lognormal( Fix Parameters( [-0.167009 .] ) ) )
);
rpt = obj << report;
Code Explanation:
- Open data table.
- Create distribution object.
- Set frequency column.
- Set weight column.
- Analyze continuous distribution.
- Specify measurement column.
- Fit lognormal distribution.
- Fix parameters.
- Generate report object.
- Save report.
Example 362
Summary: Process of generating a distribution report for continuous data, including fitting a model and creating a new table with additional columns.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Continuous Distribution( Column( :durable ) ), Fit all );
rpt = obj << report;
Close( dt, no save );
dt = New Table( "yyyyQq",
Add Rows( 12 ),
New Column( ["en" => "Date", "ja" => "日付", "x-id" => "S_Australian_Tourism_Date_Col", "zh-CN" => "日期"],
Numeric,
"Continuous",
Format( "m/d/y", 12 ),
Input Format( "m/d/y" ),
Set Values(
[2966457600, 2966457600, 2971555200, 2979504000, 2987452800, 2990044800, 2997993600, 3013632000, 3016310400, 3021580800,
3025036800, 3025296000]
)
),
New Column( "yyyyQq",
Numeric,
"Continuous",
Format( "yyyyQq", 12 ),
Input Format( "yyyyQq" ),
Formula( Date DMY( 1, Floor( (Month( :Date ) - 1) / 3 ) * 3 + 1, Year( :Date ) ) )
)
);
obj = dt << Distribution( Continuous Distribution( Column( :Date ) ), Continuous Distribution( Column( :yyyyQq ) ), Histograms Only );
rpt = obj << report;
Code Explanation:
- Open data table.
- Perform distribution analysis.
- Generate report.
- Close data table.
- Create new table.
- Add rows to table.
- Add date column.
- Add yyyyQq column.
- Perform distribution analysis.
- Generate report.
Example 363
Summary: Fits a continuous distribution to a column in a data table, generating a report with the results.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Continuous Distribution( Column( :durable ) ), Fit all );
rpt = obj << report;
Code Explanation:
- Open table.
- Create distribution object.
- Fit all distributions.
- Generate report.
Example 364
Summary: Analyze log2in_CG4847 and log2in_TMS1 using a distribution object with continuous distribution and test mean against 2, generating a report with P Value animation.
Code:
dt = Open("data_table.jmp");
obj = dt << Distribution( Weight( :log2in_CG4847 ), Continuous Distribution( Column( :log2in_TMS1 ) ), Test Mean( 2, P Value Animation ) );
rpt = obj << report;
Code Explanation:
- Open data table.
- Create distribution object.
- Analyze log2in_CG4847.
- Include continuous distribution.
- Analyze log2in_TMS1.
- Test mean against 2.
- Enable P Value animation.
- Generate report object.
Example 365
Summary: Generates a distribution report for weight, including normal quantile plot settings and platform preferences, using the EMS method.
Code:
dt = Open("data_table.jmp");
distPrefs = Report( dt << Distribution( Continuous Distribution( Column( dt:weight ) ) ) );
cert = Substitute( Name Expr( defaultDist ),
Expr(
Normal Quantile Plot( 0 )
),
Expr(
Normal Quantile Plot( 1 )
),
Expr( Outlier Box Plot( 1 ) ), Expr( Outlier Box Plot( 0 ) ),
Expr( Quantile Box Plot( 0 ) ), Expr( Quantile Box Plot( 1 ) )
);
Preferences( distribution );
distDefaultPrefs = Report( dt << Distribution( Continuous Distribution( Column( dt:weight ) ) ) );
Code Explanation:
- Open data table;
- Generate distribution report for weight.
- Substitute normal quantile plot settings.
- Set platform preferences for distribution.
- Generate new distribution report for weight.
Life Distribution
Example 1
Summary: Performs cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship by opening a data table, setting life distribution analysis, specifying Y variables, and configuring various parameters.
Code:
// Life Distribution
// Open data table
dt = Open("data_table.jmp");
// Life Distribution
Life Distribution(
Y( :Start Time, :End Time ),
Freq( :Count ),
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
<<Set Scriptables( {} ),
SendToReport(
Dispatch( {}, "Event Plot",
OutlineBox,
{Close( 0 )}
),
Dispatch( {"Event Plot"},
"Life Distribution", FrameBox,
{Frame Size( 401, 285 )}
),
Dispatch( {},
"Compare Distributions",
OutlineBox,
{Close( 1 )}
)
)
);
Code Explanation:
- Open table.
- Set life distribution analysis.
- Specify Y variables.
- Set frequency variable.
- Choose confidence interval method.
- Set scale to nonparametric.
- Set interval type.
- Clear scriptables.
- Close event plot.
- Resize life distribution frame.
Example 2
Summary: Performs cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship on a specified data table.
Code:
// Life Distribution
// Open data table
dt = Open("data_table.jmp");
// Life Distribution
Life Distribution(
Y( :Time Cycles ),
Failure Cause( :Cause Code ),
Failure Distribution by Cause(
Weibull
),
Comparison Criterion( AICc ),
Allow failure mode to use ZI distributions(
0
),
Allow failure mode to use TH distributions(
0
),
Allow failure mode to use DS distributions(
0
),
Allow failure mode to use fixed parameter models(
0
),
Allow failure mode to use Bayesian models(
0
)
);
Code Explanation:
- Open data table.
- Fit life distribution.
- Specify time cycles.
- Specify cause code.
- Use Weibull distribution.
- Compare using AICc.
- Disable zero-inflated models.
- Disable threshold models.
- Disable discrete survival models.
- Disable fixed parameter models.
Example 3
Summary: Performs a life distribution comparison between groups, using the Weibull distribution and Wald confidence interval method to analyze the relationship between hours and temperature.
Code:
// Life Distribution: Compare Groups
// Open data table
dt = Open("data_table.jmp");
// Life Distribution: Compare Groups
Life Distribution(
Perspective( Compare Groups ),
Y( :Hours ),
Grouping( :Temperature ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Freq ),
Confidence Interval Method( Wald ),
Select Distribution(
Distribution, Weibull
),
Select Scale( Weibull ),
Tabbed Report( 0 ),
SendToReport(
Dispatch(
{
"Life Distribution - Compare Groups - Hours",
"Statistics",
"Model Comparisons"}, "",
TableBox,
{Sort By Column( 2, 1 )}
),
Dispatch(
{
"Life Distribution Temperature=85",
"Compare Distributions"},
"Life Distribution", FrameBox,
{Grid Line Order( 2 ),
Reference Line Order( 3 )}
),
Dispatch(
{
"Life Distribution Temperature=85",
"Statistics",
"Model Comparisons"}, "",
TableBox,
{Sort By Column( 2, 1 )}
),
Dispatch(
{
"Life Distribution Temperature=105",
"Compare Distributions"},
"Life Distribution", FrameBox,
{Grid Line Order( 2 ),
Reference Line Order( 3 )}
),
Dispatch(
{
"Life Distribution Temperature=105",
"Statistics",
"Model Comparisons"}, "",
TableBox,
{Sort By Column( 2, 1 )}
),
Dispatch(
{
"Life Distribution Temperature=125",
"Compare Distributions"},
"Life Distribution", FrameBox,
{Grid Line Order( 2 ),
Reference Line Order( 3 )}
),
Dispatch(
{
"Life Distribution Temperature=125",
"Statistics",
"Model Comparisons"}, "",
TableBox,
{Sort By Column( 2, 1 )}
)
)
);
Code Explanation:
- Open data table.
- Set perspective to Compare Groups.
- Define response variable as Hours.
- Group by Temperature.
- Specify censoring variable.
- Set censor code.
- Use frequency variable.
- Choose Wald confidence interval method.
- Select Weibull distribution.
- Generate tabbed report.
Example 4
Summary: Performs a cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship on a data table, fitting an Exponential distribution with nonparametric scale.
Code:
// Life Distribution - Exponential
// Open data table
dt = Open("data_table.jmp");
// Life Distribution - Exponential
Life Distribution(
Y( :Time ),
Censor( :Censor ),
<<Fit Exponential,
<<Set Scale( Nonparametric )
);
Code Explanation:
- Open table.
- Fit Exponential distribution.
- Set scale to Nonparametric.
Example 5
Summary: Performs a life distribution analysis using the Weibull distribution and sets the scale to Weibull, analyzing the relationship between time and censoring in a given data table.
Code:
// Life Distribution - Weibull
// Open data table
dt = Open("data_table.jmp");
// Life Distribution - Weibull
Life Distribution(
Y( :Time ),
Censor( :Censor ),
<<Fit Weibull,
<<Set Scale( Weibull )
);
Code Explanation:
- Open data table.
- Perform Life Distribution analysis.
- Specify response variable.
- Specify censoring variable.
- Fit Weibull distribution.
- Set scale to Weibull.
Example 6
Summary: Performs a life distribution analysis using the Lognormal distribution and visualizes various profilers, including probability paper, lognormal distribution, lognormal quantile, lognormal hazard, and lognormal density.
Code:
// Life Distribution
// Open data table
dt = Open("data_table.jmp");
// Life Distribution
Life Distribution(
Y( :Time ),
Censor( :censor ),
Censor Code( 1 ),
<<Fit Lognormal,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<
Set Scriptables(
{
Probability Paper(
Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
Time(
78.75,
Lock( 0 ),
Show( 1 )
)
)
)
),
Lognormal Distribution(
Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
Time(
78.75,
Lock( 0 ),
Show( 1 )
)
)
)
),
Lognormal Quantile(
Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
Probability(
0.5,
Lock( 0 ),
Show( 1 )
)
)
)
),
Lognormal Hazard(
Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
Time(
78.75,
Lock( 0 ),
Show( 1 )
)
)
)
),
Lognormal Density(
Profiler(
1,
Term Value(
Time(
78.75,
Lock( 0 ),
Show( 1 )
)
)
)
),
Custom Estimation( Lognormal, 0 )
}
)
);
Code Explanation:
- Open table.
- Define life distribution.
- Specify time variable.
- Specify censor variable.
- Set censor code.
- Fit lognormal distribution.
- Use Wald confidence interval method.
- Set scale to nonparametric.
- Set interval type to simultaneous.
- Configure scriptables for various profilers.
Example 7
Summary: Performs a cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship by opening a data table, defining variables, fitting a Weibull distribution with nonparametric scale, and visualizing the results.
Code:
// Life Distribution - Weibull
// Open data table
dt = Open("data_table.jmp");
// Life Distribution - Weibull
Life Distribution(
Y( :start time, :end time ),
Freq( :count ),
<<Fit Weibull,
<<Set Scale( Nonparametric )
);
Code Explanation:
- Open table.
- Define data table variable.
- Launch Life Distribution platform.
- Specify Y variables.
- Specify frequency variable.
- Fit Weibull distribution.
- Set scale to Nonparametric.
Example 8
Summary: Performs cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship by fitting a mixture model to data in a JMP table.
Code:
// Mixture - Y1
// Open data table
dt = Open("data_table.jmp");
// Mixture - Y1
Life Distribution(
Y( :Y1 ),
Confidence Interval Method(
Likelihood
),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables( {} ),
Fit Mixture(
Mix(
Weibull( 2 ),
Separable Clusters,
Show Profilers( 1 )
),
Mix(
Lognormal( 1 ),
Weibull( 1 ),
Separable Clusters,
Show Profilers( 1 )
)
)
);
Code Explanation:
- Open data table.
- Set scale to nonparametric.
- Set interval type to simultaneous.
- Hide event plot frequency label.
- Fit mixture model for Y1.
- Add Weibull distribution.
- Enable separable clusters.
- Show profilers for first mix.
- Add Lognormal and Weibull distributions.
- Enable separable clusters for second mix.
Example 9
Summary: Performs a competing risk mixture analysis using the Weibull distribution and single cluster, with nonparametric scale and simultaneous interval type, on a specified data table.
Code:
// Competing Risk Mixture - Y2
// Open data table
dt = Open("data_table.jmp");
// Competing Risk Mixture - Y2
Life Distribution(
Y( :Y2 ),
Confidence Interval Method(
Likelihood
),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables( {} ),
Fit Competing Risk Mixture(
Mix(
Weibull( 2 ),
Single Cluster,
Show Profilers( 0 )
)
)
);
Code Explanation:
- Open data table.
- Set Y variable.
- Choose confidence interval method.
- Set scale to nonparametric.
- Set interval type to simultaneous.
- Hide event plot frequency label.
- Clear scriptables.
- Fit competing risk mixture.
- Specify Weibull distribution.
- Use single cluster.
Example 10
Summary: Performs cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship by fitting a life distribution model to a specified data table.
Code:
// Life Distribution
// Open data table
dt = Open("data_table.jmp");
// Life Distribution
Life Distribution(
Y( :Time ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Freq ),
Confidence Interval Method(
Likelihood
),
Interval Type( Simultaneous ),
Show Statistics( 0 ),
<<
Set Scriptables(
{
Fix Parameter(
{location, 1, 0},
{scale, 1.5, 1},
Set Scriptables(
Custom Estimation(
Weibull, 0
)
)
)}
)
);
Code Explanation:
- Open data table.
- Fit life distribution model.
- Specify time variable.
- Define censor variable.
- Set censor code.
- Include frequency variable.
- Use likelihood method.
- Use simultaneous intervals.
- Hide statistics output.
- Set parameter constraints.
Example 11
Summary: Performs a cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship. It opens a data table, defines life distribution, specifies time and censor variables, fits a Weibull distribution, and sets confidence intervals.
Code:
// Life Distribution
// Open data table
dt = Open("data_table.jmp");
// Life Distribution
Life Distribution(
Y( :Time ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Freq ),
<<Fit Weibull,
Confidence Interval Method(
Likelihood
),
<<Set Scale( Nonparametric ),
<<Suppress Plot( Nonparametric ),
Interval Type( Simultaneous ),
<<
Set Scriptables(
{
Probability Paper(
Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
Time(
900,
Max( 2000 ),
Lock( 0 ),
Show( 1 )
)
)
)
),
Weibull Distribution(
Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
Time(
900,
Max( 2000 ),
Lock( 0 ),
Show( 1 )
)
)
)
),
Weibull Quantile(
Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
Probability(
0.5,
Lock( 0 ),
Show( 1 )
)
)
)
),
Weibull Hazard(
Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
Time(
900,
Lock( 0 ),
Show( 1 )
)
)
)
),
Weibull Density(
Profiler(
1,
Term Value(
Time(
900,
Lock( 0 ),
Show( 1 )
)
)
)
),
Fix Parameter(
Weibull,
Weibayes( 1 ),
{location, 2106.09901371415,
0},
{scale, 1.5, 1},
Set Scriptables(
Custom Estimation(
Weibull, 0
)
)
),
Custom Estimation( Weibull, 0 )}
)
);
Code Explanation:
- Open data table.
- Define life distribution.
- Specify time variable.
- Specify censor variable.
- Set censor code.
- Specify frequency variable.
- Fit Weibull distribution.
- Set confidence interval method.
- Set scale to nonparametric.
- Suppress nonparametric plot.
Example 12
Summary: Runs a Life Distribution analysis using the Lognormal fit, Wald confidence interval, and nonparametric scale to model cumulative damage over time.
Code:
dt = Open("data_table.jmp");
Life Distribution(
Y( :Time ),
Censor( :censor ),
Censor Code( 1 ),
<<Fit Lognormal,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Hazard Functions( 1 ),
Show Event Plot Frequency Label( 0 ),
Show Survival Curve( 1 ),
<<Set Scriptables(
{Probability Paper( Profiler( 1, Confidence Intervals( 1 ), Term Value( Time( 78.75, Lock( 0 ), Show( 1 ) ) ) ) ),
Hazard Paper( Profiler( 1, Confidence Intervals( 1 ), Term Value( Time( 78.75, Lock( 0 ), Show( 1 ) ) ) ) ),
Lognormal Distribution( Profiler( 1, Confidence Intervals( 1 ), Term Value( Time( 78.75, Lock( 0 ), Show( 1 ) ) ) ) ),
Lognormal Quantile( Profiler( 1, Confidence Intervals( 1 ), Term Value( Probability( 0.5, Lock( 0 ), Show( 1 ) ) ) ) ),
Lognormal Hazard( Profiler( 1, Confidence Intervals( 1 ), Term Value( Time( 78.75, Lock( 0 ), Show( 1 ) ) ) ) ),
Lognormal Density( Profiler( 1, Term Value( Time( 78.75, Lock( 0 ), Show( 1 ) ) ) ) ), Custom Estimation( Lognormal, 0 )}
),
Fit Mixture,
SendToReport(
Dispatch( {"Compare Distributions"}, "2", ScaleBox, {Format( "Custom", Formula( Round( TanH( value ), 2 ) ), 12 )} ),
Dispatch( {"Compare Distributions", "Distribution Profiler"}, "10000", ScaleBox,
{Min( 0.579703593945306 ), Max( 1.03820876418679 ), Inc( 0.1 ), Minor Ticks( 1 )}
),
Dispatch( {"Hazard Profiler"}, "2", ScaleBox, {Format( "Custom", Formula( Round( ArcCosH( CosH( value ) ), 4 ) ), 12 )} ),
Dispatch( {"Statistics", "Parametric Estimate - Lognormal", "Profilers", "Distribution Profiler"}, "10000", ScaleBox,
{Min( 0.579703593945306 ), Max( 1.03820876418679 ), Inc( 0.1 ), Minor Ticks( 1 )}
)
)
);
Code Explanation:
- Open data table;
- Run Life Distribution analysis.
- Set Y variable as Time.
- Define censor variable.
- Use Lognormal fit.
- Set Wald confidence interval.
- Use nonparametric scale.
- Show simultaneous intervals.
- Display hazard functions.
- Customize profilers and plots.
Example 13
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to fit life distribution models with Bayesian inference.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time Cycles ),
Failure Cause( :Cause Code ),
Failure Distribution by Cause( Weibull ),
Allow failure mode to use Bayesian models( 1 ),
Fit Model(
{{"0", Bayesian Lognormal, 0}, {"1", Weibull, 1}, {"10", Weibull, 0}, {"15", Weibull, 0}, {"2", Weibull, 0}, {"5", Weibull, 0},
{"6", Weibull, 0}, {"9", Weibull, 0}}
)
);
obj << Bootstrap Sample Size( 1000 );
obj2 = Eval( obj << Get Script );
Code Explanation:
- Open table.
- Fit life distribution model.
- Specify time cycles.
- Specify cause code.
- Set Weibull distribution.
- Enable Bayesian models.
- Fit specific models.
- Set bootstrap sample size.
- Extract script.
Example 14
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP's Life Distribution platform.
Code:
Open("data_table.jmp");
Life Distribution(
Y( :Time Cycles ),
Censor( :Censor ),
Censor Code( 1 ),
Confidence Interval Method( Wald ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables( {} ),
Automatic Recalc( 1 )
);
Code Explanation:
- Open data table.
- Launch Life Distribution platform.
- Specify Y variable.
- Define censor variable.
- Set censor code.
- Choose confidence interval method.
- Select interval type.
- Hide event plot labels.
- Configure scriptables.
- Enable automatic recalculation.
Example 15
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to fit a life distribution for each failure cause in a data table.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time Cycles ),
Failure Cause( :Causes ),
Failure Distribution by Cause( Weibull ),
Comparison Criterion( AICc ),
Allow failure mode to use ZI distributions( 0 ),
Allow failure mode to use TH distributions( 0 ),
Allow failure mode to use DS distributions( 0 ),
Allow failure mode to use fixed parameter models( 0 ),
Allow failure mode to use Bayesian models( 0 ),
<<Fit Model(
{{"", Weibull, 0}, {"bearing seal", Weibull, 0}, {"belt", Weibull, 0}, {"container throw", Weibull, 0}, {"cord short", Weibull, 0},
{"engine fan", Weibull, 0}, {"none", Weibull, 0}, {"power switch", Weibull, 0}, {"stripped gear", Weibull, 0}}
),
<<Set Scale( Linear ),
<<Set Scriptables(
{Distribution( Profiler( 1, Confidence Intervals( 1 ), Term Value( Time Cycles( 6707, Lock( 0 ), Show( 1 ) ) ) ) ),
Quantile( Profiler( 1, Confidence Intervals( 1 ), Term Value( Probability( 0.5, Lock( 0 ), Show( 1 ) ) ) ) ),
Hazard( Profiler( 1, Term Value( Time Cycles( 6707, Lock( 0 ), Show( 1 ) ) ) ) ), Density(
Profiler( 1, Term Value( Time Cycles( 6707, Lock( 0 ), Show( 1 ) ) ) )
)}
)
);
rpt = Report( obj );
res = rpt["Statistics"]["Distribution Profiler"][Number Edit Box( 1 )] << get;
Code Explanation:
- Open data table;
- Create Life Distribution object.
- Set Y variable to Time Cycles.
- Set Failure Cause to Causes.
- Use Weibull distribution for failure causes.
- Compare using AICc criterion.
- Disable zero-inflated, threshold, and other distributions.
- Fit Weibull model for each failure cause.
- Set scale to linear.
- Configure profilers for distribution, quantile, hazard, and density.
Example 16
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP.
Code:
dt = Open("data_table.jmp");
obj = Life Distribution(
Y( :height ),
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables( {} ),
);
obj << Local Data Filter(
Location( {0, 0} ),
Add Filter( columns( :sex ), Where( :sex == "F" ) ),
Mode( Select( 0 ), Show( 1 ), Include( 1 ) )
);
obj << Automatic Recalc( 0 );
dt << Select Where( :age == 12 );
dt << Exclude();
rpt = obj << Report;
Code Explanation:
- Open data table;
- Create Life Distribution object.
- Set Y variable to height.
- Use Wald confidence interval method.
- Set scale to Nonparametric.
- Use simultaneous interval type.
- Hide event plot frequency label.
- Disable scriptables.
- Add local data filter.
- Filter for female sex.
- Disable automatic recalculation.
- Select rows where age is 12.
- Exclude selected rows.
- Generate report.
Example 17
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship on a filtered dataset.
Code:
dt = Open("data_table.jmp");
obj = Life Distribution(
Y( :height ),
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables( {} ),
);
obj << Local Data Filter(
Location( {0, 0} ),
Add Filter( columns( :sex ), Where( :sex == "F" ) ),
Mode( Select( 0 ), Show( 1 ), Include( 1 ) )
);
dt << Select Where( :age == 12 );
dt << Exclude();
rpt = obj << Report;
Close( dt, NoSave );
dt = Open("data_table.jmp");
obj = Life Distribution(
Y( :height ),
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables( {} ),
);
obj << Local Data Filter(
Location( {0, 0} ),
Add Filter( columns( :sex ), Where( :sex == "F" ) ),
Mode( Select( 0 ), Show( 1 ), Include( 1 ) )
);
obj << Automatic Recalc( 0 );
dt << Select Where( :age == 12 );
dt << Exclude();
rpt = obj << Report;
Code Explanation:
- Open data table;
- Create Life Distribution object.
- Set Y to height.
- Use Wald confidence interval method.
- Set scale to nonparametric.
- Use simultaneous interval type.
- Hide event plot frequency label.
- Clear scriptables.
- Add local data filter for sex.
- Filter for female sex.
- Select rows where age is 12.
- Exclude selected rows.
- Generate report.
- Close "data_table.jmp" without saving.
- Reopen "data_table.jmp".
- Recreate Life Distribution object.
- Set same parameters as before.
- Add same local data filter.
- Disable automatic recalculation.
- Select rows where age is 12.
- Exclude selected rows.
- Generate report.
Example 18
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in a life distribution analysis.
Code:
dt = Open("data_table.jmp");
ld = dt << Life Distribution( Y( :Time ), Censor( :Censor ) );
Code Explanation:
- Open data table.
- Create life distribution analysis.
Example 19
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to fit multiple models with different parameters.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time Cycles ),
Failure Cause( :Cause Code ),
Failure Distribution by Cause( Weibull ),
Allow failure mode to use Bayesian models( 1 ),
Fit Model(
{{"0", Bayesian Lognormal, 0}, {"1", Weibull, 1}, {"10", Weibull, 0}, {"15", Weibull, 0}, {"2", Weibull, 0}, {"5", Weibull, 0},
{"6", Weibull, 0}, {"9", Weibull, 0}}
)
);
mytab = obj << Export Bootstrap Results( 15000 );
Code Explanation:
- Open data table;
- Perform life distribution analysis.
- Set Y variable to "Time Cycles".
- Set failure cause to "Cause Code".
- Use Weibull distribution by cause.
- Enable Bayesian models for failure modes.
- Fit multiple models with different parameters.
- Export bootstrap results.
- Set bootstrap sample size to 15000.
- Store results in "mytab".
Example 20
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to fit an exponential model on a data table.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution( Y( :Time Cycles ), By( :Group ), Censor( :Censor ), Fit Exponential );
mytab = obj << Save By Group Results;
Close( dt, nosave );
Code Explanation:
- Open table.
- Fit exponential model.
- Save group results.
- Close table without saving.
Example 21
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate failure rates by group.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution( Y( :Time Cycles ), By( :Group ), Censor( :Censor ), Fit Exponential );
mytab = obj << Save By Group Results;
Code Explanation:
- Open data table.
- Create life distribution object.
- Set response variable.
- Set grouping variable.
- Set censoring variable.
- Fit exponential model.
- Save results by group.
Example 22
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to fit life distribution models with varying failure causes and save estimates.
Code:
dt = Open("data_table.jmp");
ld = dt << Life Distribution(
Y( :Time Cycles ),
Censor( :Censor ),
Censor Code( 1 ),
Failure Cause( :Causes ),
Failure Distribution by Cause( Manual Pick ),
Comparison Criterion( AICc ),
Show Subdistributions,
<<Set Scale( Linear )
);
ld1 = dt << Life Distribution(
Y( :Time Cycles ),
Failure Cause( :Causes ),
Censor( :Censor ),
Failure Distribution by Cause( DS Weibull ),
);
nc0 = N Cols( dt );
rp1 = Report( ld1 )["Cause Summary"] << getscriptableobject;
rp1 << Save Probability Estimates;
rp1 << Save Quantile Estimates;
rp1 << Save Hazard Estimates;
rp1 << Save Density Estimates;
Log Capture(
ld2 = dt << Life Distribution(
Y( :Time Cycles ),
Failure Cause( :Causes ),
Censor( :Censor ),
Failure Distribution by Cause( TH Weibull ),
)
);
rp2 = Report( ld2 )["Cause Summary"] << getscriptableobject;
rp2 << Save Probability Estimates;
rp2 << Save Quantile Estimates;
rp2 << Save Hazard Estimates;
rp2 << Save Density Estimates;
Close( dt, No Save );
dt = New Table( "Test",
New Column( "Cause", Values( [1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2] ) ),
New Column( "Time", Values( [0, 0, 0, 1, 2, 3, 4, 5, 0, 0, 0, 1, 2] ) )
);
ld3 = dt << Life Distribution( Y( :Time ), Failure Cause( :Cause ), Failure Distribution by Cause( ZI Weibull ), );
nc0 = N Cols( dt );
rp3 = Report( ld3 )["Cause Summary"] << getscriptableobject;
rp3 << Save Probability Estimates;
rp3 << Save Quantile Estimates;
rp3 << Save Hazard Estimates;
rp3 << Save Density Estimates;
Code Explanation:
- Open data table.
- Fit life distribution model with linear scale.
- Fit life distribution model without specifying cause.
- Get report for first model.
- Save probability estimates from first model.
- Save quantile estimates from first model.
- Save hazard estimates from first model.
- Save density estimates from first model.
- Fit life distribution model with log capture.
- Get report for second model.
- Save probability estimates from second model.
- Save quantile estimates from second model.
- Save hazard estimates from second model.
- Save density estimates from second model.
- Close original data table without saving.
- Create new data table "Test".
- Fit life distribution model with zero-inflated Weibull.
- Get report for third model.
- Save probability estimates from third model.
- Save quantile estimates from third model.
- Save hazard estimates from third model.
- Save density estimates from third model.
Example 23
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP, generating probability, quantile, hazard, and density estimates for both models.
Code:
dt = Open("data_table.jmp");
ld = dt << Life Distribution(
Y( :Time Cycles ),
Censor( :Censor ),
Censor Code( 1 ),
Failure Cause( :Causes ),
Failure Distribution by Cause( Manual Pick ),
Comparison Criterion( AICc ),
Show Subdistributions,
<<Set Scale( Linear )
);
ld1 = dt << Life Distribution(
Y( :Time Cycles ),
Failure Cause( :Causes ),
Censor( :Censor ),
Failure Distribution by Cause( DS Weibull ),
);
nc0 = N Cols( dt );
rp1 = Report( ld1 )["Cause Summary"] << getscriptableobject;
rp1 << Save Probability Estimates;
rp1 << Save Quantile Estimates;
rp1 << Save Hazard Estimates;
rp1 << Save Density Estimates;
Log Capture(
ld2 = dt << Life Distribution(
Y( :Time Cycles ),
Failure Cause( :Causes ),
Censor( :Censor ),
Failure Distribution by Cause( TH Weibull ),
)
);
rp2 = Report( ld2 )["Cause Summary"] << getscriptableobject;
rp2 << Save Probability Estimates;
rp2 << Save Quantile Estimates;
rp2 << Save Hazard Estimates;
rp2 << Save Density Estimates;
Code Explanation:
- Open data table;
- Fit life distribution model.
- Set censor code to 1.
- Analyze failure causes manually.
- Use AICc for comparison.
- Display subdistributions.
- Set scale to linear.
- Fit another life distribution model.
- Analyze failure causes with DS Weibull.
- Save probability, quantile, hazard, and density estimates for both models.
Example 24
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP.
Code:
dt = Open("data_table.jmp");
obj = Life Distribution( Y( :Time Cycles ), Failure Cause( :Cause Code ), Failure Distribution by Cause( Weibull ) );
obj << Show Subdistributions( 1 );
obj << subdistribution( Cause( 2 ), Compute( [5000, 10000] ) );
cause = Report( obj )["Individual Subdistribution Profiler for Cause"][Combo Box( 1 )] << get;
rpt = Report( obj << redo analysis );
cause2 = rpt["Individual Subdistribution Profiler for Cause"][Combo Box( 1 )] << get;
Code Explanation:
- Open data_table data
- Create Life Distribution object.
- Set Y to Time Cycles.
- Set Failure Cause to Cause Code.
- Use Weibull distribution by cause.
- Display subdistributions.
- Compute for Cause 2 at 5000, 10000.
- Get selected cause from report.
- Redo analysis on object.
- Get updated cause from report.
Example 25
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution( Y( :Time Cycles ), Failure Cause( :Cause Code ), Failure Distribution by Cause( Weibull ) );
obj << Show Remaining Life Distribution( 1 );
Preferences( Profiler Graph( Prediction Profiler( 0 ) ) );
Code Explanation:
- Open data table.
- Create life distribution object.
- Set Y variable to Time Cycles.
- Set failure cause to Cause Code.
- Use Weibull distribution for failure.
- Show remaining life distribution.
- Set profiler graph preferences.
- Disable prediction profiler.
Example 26
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate Bayesian estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
<<Fit Weibull,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Weibull,
Model(
Location Prior( Normal, Location( 8.61952460378488 ), Scale( 0.0696276102241418 ) ),
Scale Prior( Gamma, Shape( 108.809361986191 ), Scale( 0.00508450797560608 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 1315098824 )
)
)}
)
);
Code Explanation:
- Open table.
- Fit Weibull distribution.
- Set confidence interval method.
- Set scale to nonparametric.
- Set interval type.
- Hide event plot frequency label.
- Define Bayesian estimates.
- Specify Weibull model.
- Set location prior.
- Set scale prior.
Example 27
Summary: Runs the cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate life distribution parameters.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
<<Fit Loglogistic,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Loglogistic,
Model(
Location Prior( Point Mass, Location( 8.34851576423758 ) ),
Scale Prior( Uniform, Low( 0.0001 ), High( 100 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 350721745 )
)
)}
)
);
Code Explanation:
- Open data table.
- Create life distribution object.
- Set response variable.
- Fit loglogistic model.
- Use Wald confidence interval.
- Set nonparametric scale.
- Use simultaneous interval type.
- Hide event plot frequency labels.
- Configure Bayesian estimates.
- Define loglogistic model parameters.
Example 28
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
<<Fit Frechet,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Frechet,
Model(
Location Prior( Gamma, Shape( 0.6264 ), Scale( 12.6357 ) ),
Scale Prior( Normal, Location( 0.832234541851797 ), Scale( 100 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 466342841 )
)
)}
)
);
Code Explanation:
- Open data table;
- Fit Frechet distribution.
- Use Wald confidence intervals.
- Set scale to nonparametric.
- Use simultaneous interval type.
- Hide event plot frequency labels.
- Configure Bayesian Estimates.
- Set Frechet model.
- Define location prior as Gamma.
- Define scale prior as Normal.
Example 29
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship, fitting a life distribution model to the data table.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
<<Fit Normal,
Confidence Interval Method( Wald ),
<<Set Scale( Normal ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Normal,
Model(
Location Prior( Uniform, Low( 3910.45977639902 ), High( 5930.68308074277 ) ),
Scale Prior( Point Mass, Location( 2817.066805695 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 799009072 )
)
)}
)
);
Code Explanation:
- Open data table.
- Fit life distribution model.
- Specify normal fit.
- Set confidence interval method.
- Define scale type.
- Choose interval type.
- Hide event plot labels.
- Configure scriptables.
- Set Bayesian estimates.
- Define model parameters.
Example 30
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate SEV parameters.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
<<Fit SEV,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
SEV,
Model(
Location Prior( Gamma, Shape( 312.074039750321 ), Scale( 20.4386365178967 ) ),
Scale Prior( Gamma, Shape( 129.075038741215 ), Scale( 22.0284399728996 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 1373147411 )
)
)}
)
);
Code Explanation:
- Open data table.
- Initiate Life Distribution analysis.
- Set response variable to "Time".
- Fit SEV distribution.
- Use Wald confidence interval method.
- Set scale to nonparametric.
- Choose simultaneous interval type.
- Hide event plot frequency labels.
- Configure Bayesian estimates.
- Define SEV model parameters.
Example 31
Summary: Perform cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship on a specified data table.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
<<Fit Logistic,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Logistic,
Model(
Location Prior( Gamma, Shape( 177.192341534294 ), Scale( 26.7796255852486 ) ),
Scale Prior( Gamma, Shape( 105.072265151897 ), Scale( 15.974092056378 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 1295480532 )
)
)}
)
);
Code Explanation:
- Open data table.
- Perform life distribution analysis.
- Fit logistic model.
- Set confidence interval method.
- Use nonparametric scale.
- Set simultaneous interval type.
- Hide event plot frequency label.
- Configure Bayesian estimates.
- Specify logistic model.
- Define prior distributions and parameters.
Example 32
Summary: Performs a cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to fit LEV models with Bayesian estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
<<Fit LEV,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
LEV,
Model(
Location Prior( Gamma, Shape( 150.634937278412 ), Scale( 23.7579811993795 ) ),
Scale Prior( Gamma, Shape( 109.731505313665 ), Scale( 21.0787801214613 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 2069777519 )
)
)}
)
);
Code Explanation:
- Open data table.
- Perform life distribution analysis.
- Fit LEV model.
- Set confidence interval method.
- Use nonparametric scale.
- Show simultaneous intervals.
- Hide event plot labels.
- Configure Bayesian estimates.
- Set location prior to Gamma.
- Set scale prior to Gamma.
Example 33
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
Censor( :Censor ),
Censor Code( 1 ),
<<Fit Lognormal,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Lognormal,
Model(
Location Prior( Uniform, Low( -90 ), High( 110 ) ),
Scale Prior( Uniform, Low( 0 ), High( 100 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 1392889692 )
)
)}
)
);
Code Explanation:
- Open data table.
- Create life distribution object.
- Set response variable to Time.
- Set censor variable to Censor.
- Define censor code as 1.
- Fit lognormal distribution.
- Use Wald confidence intervals.
- Set scale to nonparametric.
- Use simultaneous interval type.
- Configure Bayesian estimates with specified priors and iterations.
Example 34
Summary: Fits a lognormal life distribution to cumulative damage data using the Ramp Stress model, Weibull distribution, and Inverse Power relationship.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
Censor( :Censor ),
Censor Code( 1 ),
<<Fit Lognormal,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Lognormal,
Model(
Location Prior( Gamma, Shape( 1.028196 ), Scale( 9.8619 ) ),
Scale Prior( Gamma, Shape( 0.0282 ), Scale( 59.5238 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 175656978 )
)
)}
)
);
Code Explanation:
- Open data table;
- Fit life distribution.
- Set response variable to "Time".
- Set censor variable to "Censor".
- Define censor code as 1.
- Fit lognormal distribution.
- Use Wald confidence interval method.
- Set scale to nonparametric.
- Set interval type to simultaneous.
- Disable event plot frequency label.
Example 35
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
Censor( :Censor ),
Censor Code( 1 ),
<<Fit Weibull,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Weibull,
Model(
Location Prior( Lognormal, Location( 2.31910363681617 ), Scale( 0.0457538088042406 ) ),
Scale Prior( Uniform, Low( 0.226449368930923 ), High( 1.66311352187148 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 868563135 )
)
)}
)
);
Code Explanation:
- Open data table.
- Create Life Distribution object.
- Set Y variable to "Time".
- Set Censor variable to "Censor".
- Set Censor Code to 1.
- Fit Weibull distribution.
- Use Wald confidence interval method.
- Set scale to Nonparametric.
- Set interval type to Simultaneous.
- Disable event plot frequency labels.
Example 36
Summary: Performs a cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate Bayesian estimates with specified priors and settings.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
Censor( :Censor ),
Censor Code( 1 ),
<<Fit Weibull,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Weibull,
Model(
Location Prior( Gamma, Shape( 0.01385 ), Scale( 9.82606 ) ),
Scale Prior( Point Mass, Location( 0.944781445401201 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 1598574090 )
)
)}
)
);
Code Explanation:
- Open data table;
- Create Life Distribution object.
- Set response variable to "Time".
- Set censor variable to "Censor".
- Define censor code as 1.
- Fit Weibull distribution.
- Use Wald confidence interval method.
- Set scale to nonparametric.
- Use simultaneous interval type.
- Configure Bayesian estimates with specified priors and settings.
Example 37
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP's Life Distribution platform.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
Censor( :Censor ),
Censor Code( 1 ),
<<Fit Loglogistic,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Loglogistic,
Model(
Location Prior( Lognormal, Location( 2.29757918287402 ), Scale( 0.045027591479958 ) ),
Scale Prior( Normal, Location( 0.880340547119074 ), Scale( 0.220270347959497 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 1970433858 )
)
)}
)
);
Code Explanation:
- Open data table.
- Launch Life Distribution platform.
- Specify time variable.
- Define censor variable.
- Set censor code.
- Fit Loglogistic model.
- Use Wald confidence intervals.
- Set nonparametric scale.
- Use simultaneous interval type.
- Configure Bayesian estimates.
Example 38
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
Censor( :Censor ),
Censor Code( 1 ),
<<Fit Frechet,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Frechet,
Model(
Location Prior( Uniform, Low( 8.22241542333296 ), High( 11.3236479530111 ) ),
Scale Prior( Lognormal, Location( 0.768180538349741 ), Scale( 0.218684538388089 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 2042186007 )
)
)}
)
);
Code Explanation:
- Open data table;
- Create Life Distribution object.
- Set Y variable to "Time".
- Set Censor variable to "Censor".
- Specify Censor Code as 1.
- Fit Frechet distribution.
- Use Wald method for confidence intervals.
- Set scale to nonparametric.
- Set interval type to simultaneous.
- Configure Bayesian Estimates script.
Example 39
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
Censor( :Censor ),
Censor Code( 1 ),
<<Fit Frechet,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Frechet,
Model(
Location Prior( Point Mass, Location( 9.77303168817202 ) ),
Scale Prior( Gamma, Shape( 20.4144574497774 ), Scale( 0.108159169371355 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 564965212 )
)
)}
)
);
Code Explanation:
- Open table.
- Fit life distribution.
- Specify time variable.
- Specify censor variable.
- Set censor code.
- Fit Frechet distribution.
- Use Wald confidence interval.
- Set nonparametric scale.
- Use simultaneous intervals.
- Configure Bayesian estimates.
Example 40
Summary: Performs a cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate life distribution parameters.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
Censor( :Censor ),
Censor Code( 1 ),
<<Fit Normal,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Normal,
Model(
Location Prior( Normal, Location( 11935.9051533565 ), Scale( 100000 ) ),
Scale Prior( Lognormal, Location( 8.71604679320204 ), Scale( 2 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 564965212 )
)
)}
)
);
Code Explanation:
- Open data table;
- Perform life distribution analysis.
- Set response variable as "Time".
- Define censor variable as "Censor".
- Use censor code 1 for censored data.
- Fit normal distribution model.
- Use Wald method for confidence intervals.
- Set scale to nonparametric.
- Display simultaneous interval type.
- Configure Bayesian estimates with specified priors and settings.
Example 41
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate Bayesian estimates with specified priors and settings.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
Censor( :Censor ),
Censor Code( 1 ),
<<Fit SEV,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
SEV,
Model(
Location Prior( Lognormal, Location( 9.46152876810079 ), Scale( 0.13894859230723 ) ),
Scale Prior( Lognormal, Location( 8.26064697499557 ), Scale( 0.232287381213002 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 746207119 )
)
)}
)
);
Code Explanation:
- Open data table;
- Initiate Life Distribution analysis.
- Set response variable as "Time".
- Define censor variable as "Censor".
- Specify censor code as 1.
- Fit SEV distribution.
- Use Wald confidence interval method.
- Set scale to nonparametric.
- Choose simultaneous interval type.
- Configure Bayesian estimates with specified priors and settings.
Example 42
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
Censor( :Censor ),
Censor Code( 1 ),
<<Fit SEV,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
SEV,
Model(
Location Prior( Point Mass, Location( 12980.2223946676 ) ),
Scale Prior( Point Mass, Location( 3974.38655236956 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 630181612 )
)
)}
)
);
Code Explanation:
- Open data table;
- Create Life Distribution object.
- Set Y variable to :Time.
- Set Censor variable to :Censor.
- Define Censor Code as 1.
- Fit SEV model.
- Use Wald confidence interval method.
- Set scale to Nonparametric.
- Set interval type to Simultaneous.
- Configure Bayesian Estimates with specified parameters.
Example 43
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate Bayesian estimates with specified priors and iterations.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
Censor( :Censor ),
Censor Code( 1 ),
<<Fit Logistic,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Logistic,
Model(
Location Prior( Lognormal, Location( 9.35723267951547 ), Scale( 0.148521767437593 ) ),
Scale Prior( Lognormal, Location( 8.15046241578822 ), Scale( 0.232456581985336 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 37927819 )
)
)}
)
);
Code Explanation:
- Open data table;
- Create Life Distribution object.
- Set response variable as "Time".
- Set censor variable as "Censor".
- Define censor code as 1.
- Fit logistic model.
- Use Wald confidence interval method.
- Set scale to nonparametric.
- Set interval type to simultaneous.
- Configure Bayesian estimates with specified priors and iterations.
Example 44
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to fit a logistic distribution with Bayesian estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
Censor( :Censor ),
Censor Code( 1 ),
<<Fit Logistic,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Logistic,
Model(
Location Prior( Point Mass, Location( 11710.7445527893 ) ),
Scale Prior( Point Mass, Location( 3559.87406080651 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 2086006978 )
)
)}
)
);
Code Explanation:
- Open data table.
- Fit logistic distribution.
- Use Wald confidence interval.
- Set nonparametric scale.
- Show simultaneous intervals.
- Hide event plot labels.
- Set Bayesian estimates.
- Specify logistic model.
- Define location prior.
- Define scale prior.
Example 45
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate Bayesian estimates with specified priors and iterations.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
Censor( :Censor ),
Censor Code( 1 ),
<<Fit LEV,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
LEV,
Model(
Location Prior( Lognormal, Location( 9.17818393985941 ), Scale( 0.175532087474186 ) ),
Scale Prior( Lognormal, Location( 8.86699338481034 ), Scale( 0.226739177168503 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 741560532 )
)
)}
)
);
Code Explanation:
- Open data table.
- Create life distribution object.
- Set response variable to Time.
- Set censor variable to Censor.
- Specify censor code as 1.
- Fit LEV model.
- Use Wald confidence interval method.
- Set scale to nonparametric.
- Use simultaneous interval type.
- Configure Bayesian estimates with specified priors and iterations.
Example 46
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate Bayesian estimates with specified priors and settings.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
Censor( :Censor ),
Censor Code( 1 ),
<<Fit LEV,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
LEV,
Model(
Location Prior( Point Mass, Location( 9833.88837248087 ) ),
Scale Prior( Point Mass, Location( 7278.63564366029 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 570047951 )
)
)}
)
);
Code Explanation:
- Open data table.
- Access Life Distribution platform.
- Set response variable as Time.
- Define censor variable as Censor.
- Specify censor code as 1.
- Fit LEV model.
- Use Wald confidence intervals.
- Set scale to nonparametric.
- Use simultaneous interval type.
- Configure Bayesian estimates with specified priors and settings.
Example 47
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :start time, :end time ),
<<Fit Lognormal,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Lognormal,
Model(
Location Prior( Normal, Location( 6.08983621705527 ), Scale( 0.978412860621282 ) ),
Scale Prior( Normal, Location( 2.93586516972748 ), Scale( 0.913429725156605 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 880255310 )
)
)}
)
);
Code Explanation:
- Open table.
- Fit lognormal distribution.
- Set confidence interval method.
- Set scale nonparametric.
- Set interval type simultaneous.
- Hide event plot frequency label.
- Set Bayesian estimates.
- Define location prior normal.
- Define scale prior normal.
- Set Monte Carlo iterations.
Example 48
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP's Life Distribution platform.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :start time, :end time ),
<<Fit Weibull,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Weibull,
Model(
Location Prior( Point Mass, Location( 6.9754813148761 ) ),
Scale Prior( Lognormal, Location( 0.690723680014679 ), Scale( 0.328208984892005 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 1418064912 )
)
)}
)
);
Code Explanation:
- Open data table.
- Launch Life Distribution platform.
- Specify Y variables.
- Fit Weibull distribution.
- Set confidence interval method.
- Set scale to nonparametric.
- Set interval type.
- Hide event plot frequency labels.
- Configure Bayesian estimates.
- Define Weibull model parameters.
Example 49
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate life distribution and Bayesian estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :start time, :end time ),
<<Fit Loglogistic,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Loglogistic,
Model(
Location Prior( Uniform, Low( -11.34 ), High( 23.66 ) ),
Scale Prior( Gamma, Shape( 0.0300625870936356 ), Scale( 57.6748965283519 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 272379491 )
)
)}
)
);
Code Explanation:
- Open data table.
- Create life distribution object.
- Set Y variables: start time, end time.
- Fit loglogistic model.
- Use Wald confidence interval method.
- Set scale to nonparametric.
- Use simultaneous interval type.
- Hide event plot frequency label.
- Configure Bayesian estimates.
- Define loglogistic model with priors and parameters.
Example 50
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :start time, :end time ),
<<Fit Frechet,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Frechet,
Model(
Location Prior( Lognormal, Location( 1.5732362853705 ), Scale( 0.205271223663008 ) ),
Scale Prior( Point Mass, Location( 3.15207648323412 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 1038080421 )
)
)}
)
);
Code Explanation:
- Open data table.
- Create Life Distribution object.
- Specify Y variables.
- Fit Frechet distribution.
- Set confidence interval method.
- Use nonparametric scale.
- Set simultaneous interval type.
- Hide event plot frequency labels.
- Configure Bayesian estimates.
- Define Frechet model parameters.
Example 51
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate Bayesian estimates in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :start time, :end time ),
<<Fit Normal,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Normal,
Model(
Location Prior( Point Mass, Location( 858.160389651515 ) ),
Scale Prior( Normal, Location( 897.552480068627 ), Scale( 273.070170621095 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 1845337915 )
)
)}
)
);
Code Explanation:
- Open table.
- Perform life distribution analysis.
- Set response variables.
- Fit normal distribution.
- Use Wald confidence interval.
- Set nonparametric scale.
- Use simultaneous interval type.
- Hide event plot frequency labels.
- Configure Bayesian estimates.
- Define model parameters.
Example 52
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate Bayesian estimates with a Gamma location prior.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :start time, :end time ),
<<Fit Normal,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Normal,
Model(
Location Prior( Gamma, Shape( 73.6439254964952 ), Scale( 11.6528333357358 ) ),
Scale Prior( Uniform, Low( 0.342 ), High( 1794.763 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 1510535288 )
)
)}
)
);
Code Explanation:
- Open data table.
- Create life distribution object.
- Specify start and end times.
- Fit normal distribution.
- Use Wald confidence interval method.
- Set scale to nonparametric.
- Set interval type to simultaneous.
- Hide event plot frequency label.
- Configure Bayesian estimates.
- Define model with Gamma location prior.
Example 53
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to fit life distribution models with Bayesian estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :start time, :end time ),
<<Fit SEV,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
SEV,
Model(
Location Prior( Normal, Location( 1309.04699693152 ), Scale( 337.69517239146 ) ),
Scale Prior( Normal, Location( 869.924894186346 ), Scale( 257.19713020605 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 402595865 )
)
)}
)
);
Code Explanation:
- Open data table.
- Fit life distribution model.
- Use SEV method.
- Set confidence interval method.
- Use nonparametric scale.
- Set simultaneous interval type.
- Hide event plot frequency labels.
- Define Bayesian estimates.
- Specify SEV model.
- Set location and scale priors.
Example 54
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate life distribution parameters.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :start time, :end time ),
<<Fit Logistic,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Logistic,
Model(
Location Prior( Normal, Location( 784.009287400666 ), Scale( 310.495364451494 ) ),
Scale Prior( Normal, Location( 533.069859958053 ), Scale( 179.871274041848 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 767872214 )
)
)}
)
);
Code Explanation:
- Open table.
- Perform life distribution analysis.
- Set response variables.
- Fit logistic model.
- Use Wald confidence interval.
- Set nonparametric scale.
- Use simultaneous intervals.
- Hide event plot labels.
- Configure Bayesian estimates.
- Set logistic model parameters.
Example 55
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate Bayesian estimates with nonparametric scale and Wald confidence interval method.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :start time, :end time ),
<<Fit LEV,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
LEV,
Model(
Location Prior( Normal, Location( 459.87793925294 ), Scale( 231.551305213933 ) ),
Scale Prior( Normal, Location( 701.177681627697 ), Scale( 247.007730107613 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 494457717 )
)
)}
)
);
Code Explanation:
- Open data table.
- Create life distribution object.
- Set response variables.
- Fit LEV model.
- Use Wald confidence interval method.
- Set nonparametric scale.
- Choose simultaneous interval type.
- Hide event plot frequency label.
- Configure Bayesian estimates.
- Define location and scale priors.
- Set Monte Carlo iterations.
- Initialize random seed.
Example 56
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP, generating a Life Distribution report with Bayesian estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
Censor( :Censor ),
Censor Code( 1 ),
<<Fit Weibull,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Weibull,
Model(
Quantile and Parameter Priors,
Quantile( Lognormal, Probability( 0.1 ), Low( 1387.34648871309 ), High( 7094.31982471649 ) ),
Shape or Scale( Lognormal, Low( 0.601281864917263 ), High( 4.41599817531416 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 1080582622 )
)
)}
)
);
Code Explanation:
- Open data table;
- Run Life Distribution analysis.
- Set response variable as "Time".
- Define censor variable as "Censor".
- Use Censor Code 1 for censored data.
- Fit Weibull distribution.
- Use Wald method for confidence intervals.
- Set scale to Nonparametric.
- Use Simultaneous interval type.
- Configure Bayesian Estimates with specified priors and settings.
Example 57
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate life distribution and confidence intervals.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
Censor( :Censor ),
Censor Code( 1 ),
<<Fit Lognormal,
Change Confidence Level( 0.99 ),
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Lognormal,
Model(
Quantile and Parameter Priors,
Quantile( Uniform, Probability( 0.2 ), Low( 2782.04 ), High( 13744.3 ) ),
Shape or Scale( Normal, Low( 0.511821385585715 ), High( 2.84736384098958 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 464458922 )
)
)}
)
);
Code Explanation:
- Open data table;
- Run Life Distribution analysis.
- Set response variable to "Time".
- Set censor variable to "Censor".
- Define censor code as 1.
- Fit Lognormal distribution.
- Set confidence level to 0.99.
- Use Wald method for confidence interval.
- Set scale to Nonparametric.
- Set interval type to Simultaneous.
Example 58
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate reliability metrics.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
Censor( :Censor ),
Censor Code( 1 ),
<<Fit Normal,
Change Confidence Level( 0.99 ),
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Normal,
Model(
Quantile and Parameter Priors,
Quantile( Lognormal, Probability( 0.5 ), Low( 7049.11 ), High( 16822.7 ) ),
Shape or Scale( Loguniform, Low( 2014.7826 ), High( 10492.7828669779 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 810699262 )
)
)}
)
);
Code Explanation:
- Open data table;
- Create Life Distribution object.
- Set response variable to "Time".
- Define censor variable as "Censor".
- Set censor code to 1.
- Fit Normal distribution.
- Change confidence level to 0.99.
- Use Wald method for confidence intervals.
- Set scale to Nonparametric.
- Display simultaneous interval type.
Example 59
Summary: Performs a cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate failure rates and confidence intervals.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
Censor( :Censor ),
Censor Code( 1 ),
<<Fit SEV,
Change Confidence Level( 0.99 ),
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
SEV,
Model(
Quantile and Parameter Priors,
Quantile( Normal, Probability( 0.8 ), Low( 9268.11 ), High( 20475 ) ),
Shape or Scale( Uniform, Low( 1167.00351411563 ), High( 6781.7695906235 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 169365228 )
)
)}
)
);
Code Explanation:
- Open data table;
- Run Life Distribution analysis.
- Set response variable to "Time".
- Set censor variable to "Censor".
- Use Censor Code 1.
- Fit SEV distribution.
- Set confidence level to 99%.
- Use Wald method for confidence intervals.
- Set scale to nonparametric.
- Set interval type to simultaneous.
Example 60
Summary: Runs the Life Distribution analysis to model cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
Censor( :Censor ),
Censor Code( 1 ),
<<Fit Loglogistic,
Change Confidence Level( 0.99 ),
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Loglogistic,
Model(
Quantile and Parameter Priors,
Quantile( Loguniform, Probability( 0.9 ), Low( 15226.9 ), High( 1408601 ) ),
Shape or Scale( Lognormal, Low( 0.219529503240584 ), High( 1.54115159099756 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 1225667000 )
)
)}
)
);
Code Explanation:
- Open data table;
- Launch Life Distribution analysis.
- Set Y variable to "Time".
- Set Censor variable to "Censor".
- Define Censor Code as 1.
- Fit Loglogistic model.
- Change confidence level to 99%.
- Use Wald method for confidence intervals.
- Set scale to Nonparametric.
- Display simultaneous interval type.
Example 61
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to fit a Frechet distribution with Bayesian estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
Censor( :Censor ),
Censor Code( 1 ),
<<Fit Frechet,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Frechet,
Model(
Quantile and Parameter Priors,
Quantile( Point Mass, Probability( 0.1 ), Location( 2783.54082442475 ) ),
Shape or Scale( Normal, Low( 0.741944770335638 ), High( 3.67407675153396 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 790831016 )
)
)}
)
);
Code Explanation:
- Open data table;
- Fit Frechet distribution.
- Set confidence interval method to Wald.
- Use nonparametric scale.
- Set simultaneous interval type.
- Hide event plot frequency label.
- Configure Bayesian Estimates.
- Specify Frechet model.
- Define quantile and parameter priors.
- Set Monte Carlo iterations and seed.
Example 62
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate Bayesian estimates with specified priors.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
Censor( :Censor ),
Censor Code( 1 ),
<<Fit Weibull,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Weibull,
Model(
Quantile and Parameter Priors,
Quantile( Normal, Probability( 0.1 ), Low( 1387.34648871309 ), High( 7094.31982471649 ) ),
Shape or Scale( Point Mass, Location( 1.058 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 1139841968 )
)
)}
)
);
Code Explanation:
- Open data table;
- Create Life Distribution object.
- Set Y variable to "Time".
- Set Censor variable to "Censor".
- Define Censor Code as 1.
- Fit Weibull distribution.
- Use Wald confidence interval method.
- Set scale to nonparametric.
- Use simultaneous interval type.
- Configure Bayesian Estimates with specified priors and settings.
Example 63
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
<<Fit Logistic,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Logistic,
Model(
Quantile and Parameter Priors,
Quantile( Uniform, Probability( 0.1 ), Low( -205.910877992398 ), High( 2320.40697256547 ) ),
Shape or Scale( Uniform, Low( 1187.2078781831 ), High( 2169.66019403401 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 1251642240 )
)
)}
)
);
Code Explanation:
- Open table.
- Fit logistic distribution.
- Set confidence interval method.
- Set nonparametric scale.
- Set simultaneous interval type.
- Hide event plot frequency label.
- Configure Bayesian estimates.
- Specify logistic model.
- Set quantile and parameter priors.
- Define uniform quantile range.
Example 64
Summary: Performs a cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP, configuring Bayesian Estimates with specified parameters.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
<<Fit Lognormal,
Change Confidence Level( 0.99 ),
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Lognormal,
Model(
Quantile and Parameter Priors,
Quantile( Lognormal, Probability( 0.2 ), Low( 1709.75 ), High( 2839.76 ) ),
Shape or Scale( Point Mass, Location( 0.708099733417599 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 610524090 )
)
)}
)
);
Code Explanation:
- Open data table.
- Launch Life Distribution analysis.
- Specify Time as response.
- Fit Lognormal distribution.
- Set confidence level to 0.99.
- Use Wald method for intervals.
- Set scale to Nonparametric.
- Choose Simultaneous interval type.
- Hide event plot frequency labels.
- Configure Bayesian Estimates with specified parameters.
Example 65
Summary: Performs a cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate Bayesian parameters with specified priors.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
<<Fit Loglogistic,
Change Confidence Level( 0.99 ),
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Loglogistic,
Model(
Quantile and Parameter Priors,
Quantile( Loguniform, Probability( 0.5 ), Low( 3397.11 ), High( 5251.93 ) ),
Shape or Scale( Normal, Low( 0.283770023244641 ), High( 0.521131573835895 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 1139224783 )
)
)}
)
);
Code Explanation:
- Open data table.
- Launch Life Distribution analysis.
- Set response variable to "Time".
- Fit Loglogistic distribution.
- Change confidence level to 0.99.
- Use Wald method for confidence intervals.
- Set scale to Nonparametric.
- Choose Simultaneous interval type.
- Hide event plot frequency labels.
- Configure Bayesian Estimates with specified priors and settings.
Example 66
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate Bayesian estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
<<Fit LEV,
Change Confidence Level( 0.99 ),
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
LEV,
Model(
Quantile and Parameter Priors,
Quantile( Uniform, Probability( 0.8 ), Low( 5744.55 ), High( 8351.76 ) ),
Shape or Scale( Loguniform, Low( 1650.58785844432 ), High( 2975.42468736308 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 984258357 )
)
)}
)
);
Code Explanation:
- Open data table;
- Create Life Distribution object.
- Set response variable to "Time".
- Fit LEV model.
- Change confidence level to 0.99.
- Use Wald method for confidence intervals.
- Set scale to Nonparametric.
- Use simultaneous interval type.
- Hide event plot frequency labels.
- Configure Bayesian Estimates script.
Example 67
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
<<Fit Normal,
Change Confidence Level( 0.99 ),
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Normal,
Model(
Quantile and Parameter Priors,
Quantile( Point Mass, Probability( 0.8 ), Location( 7291.475 ) ),
Shape or Scale( Lognormal, Low( 2102.81000668916 ), High( 3531.32360470084 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 984258357 )
)
)}
)
);
Code Explanation:
- Open data table.
- Launch Life Distribution analysis.
- Set response variable to "Time".
- Fit Normal distribution.
- Change confidence level to 99%.
- Use Wald method for confidence intervals.
- Set scale to Nonparametric.
- Select Simultaneous interval type.
- Hide event plot frequency labels.
- Configure Bayesian Estimates with specified priors and settings.
Example 68
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
<<Fit Frechet,
Change Confidence Level( 0.99 ),
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Frechet,
Model(
Quantile and Parameter Priors,
Quantile( Normal, Probability( 0.9 ), Low( 10344.7 ), High( 30685 ) ),
Shape or Scale( Loguniform, Low( 0.632458921579892 ), High( 1.0320101621237 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 1362464104 )
)
)}
)
);
Code Explanation:
- Open data table;
- Create Life Distribution object.
- Set response variable to "Time".
- Fit Frechet distribution.
- Change confidence level to 0.99.
- Use Wald method for confidence intervals.
- Set scale to Nonparametric.
- Set interval type to Simultaneous.
- Hide event plot frequency labels.
- Configure Bayesian Estimates script.
Example 69
Summary: Analyze cumulative damage using a Weibull distribution and Inverse Power relationship, with Bayesian estimates configured for Monte Carlo iterations.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :start time, :end time ),
<<Fit Weibull,
Change Confidence Level( 0.99 ),
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Weibull,
Model(
Quantile and Parameter Priors,
Quantile( Loguniform, Probability( 0.1 ), Low( 0.156177642053789 ), High( 561.791383417737 ) ),
Shape or Scale( Loguniform, Low( 0.25415 ), High( 3.617 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 86875207 )
)
)}
)
);
Code Explanation:
- Open data table.
- Create life distribution object.
- Set response variables.
- Fit Weibull distribution.
- Change confidence level.
- Set confidence interval method.
- Set nonparametric scale.
- Set simultaneous interval type.
- Hide event plot frequency labels.
- Configure Bayesian estimates.
Example 70
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate Bayesian estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :start time, :end time ),
<<Fit SEV,
Change Confidence Level( 0.99 ),
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
SEV,
Model(
Quantile and Parameter Priors,
Quantile( Loguniform, Probability( 0.2 ), Low( 0.0001 ), High( 1213.82 ) ),
Shape or Scale( Uniform, Low( 98.3335035681951 ), High( 1641.5162848045 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 2268744 )
)
)}
)
);
Code Explanation:
- Open data table.
- Create life distribution object.
- Set Y variables.
- Fit SEV model.
- Change confidence level.
- Set confidence interval method.
- Set nonparametric scale.
- Set simultaneous interval type.
- Hide event plot frequency label.
- Configure Bayesian estimates.
Example 71
Summary: Performs a cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate Bayesian estimates of lognormal parameters.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :start time, :end time ),
<<Fit Lognormal,
Change Confidence Level( 0.99 ),
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Lognormal,
Model(
Quantile and Parameter Priors,
Quantile( Normal, Probability( 0.2 ), Low( 2.7521 ), High( 505.494 ) ),
Shape or Scale( Lognormal, Low( 0.195575994257671 ), High( 5.6761543451973 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 1972226932 )
)
)}
)
);
Code Explanation:
- Open data table.
- Launch Life Distribution analysis.
- Specify Y variables.
- Fit Lognormal model.
- Set confidence level to 0.99.
- Use Wald method for intervals.
- Set scale to Nonparametric.
- Select simultaneous interval type.
- Hide event plot frequency labels.
- Configure Bayesian Estimates script.
Example 72
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :start time, :end time ),
<<Fit Loglogistic,
Change Confidence Level( 0.99 ),
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Loglogistic,
Model(
Quantile and Parameter Priors,
Quantile( Point Mass, Probability( 0.5 ), Location( 471.6955 ) ),
Shape or Scale( Uniform, Low( 0 ), High( 3.4725875606386 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 1083590353 )
)
)}
)
);
Code Explanation:
- Open data table.
- Create life distribution object.
- Set response variables.
- Fit loglogistic model.
- Change confidence level.
- Set confidence interval method.
- Set nonparametric scale.
- Set simultaneous interval type.
- Hide event plot frequency label.
- Configure Bayesian estimates.
Example 73
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate Bayesian estimates in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :start time, :end time ),
<<Fit Frechet,
Change Confidence Level( 0.99 ),
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Frechet,
Model(
Quantile and Parameter Priors,
Quantile( Lognormal, Probability( 0.8 ), Low( 62.3881 ), High( 3883632 ) ),
Shape or Scale( Normal, Low( 0.128961587031268 ), High( 6.17519137943698 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 1631194559 )
)
)}
)
);
Code Explanation:
- Open data table.
- Create life distribution object.
- Set response variables.
- Fit Frechet distribution.
- Change confidence level.
- Select Wald method.
- Set nonparametric scale.
- Choose simultaneous intervals.
- Hide event plot frequency labels.
- Configure Bayesian estimates script.
Example 74
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :start time, :end time ),
<<Fit Logistic,
Change Confidence Level( 0.99 ),
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Bayesian Estimates(
Logistic,
Model(
Quantile and Parameter Priors,
Quantile( Uniform, Probability( 0.9 ), Low( 450.92 ), High( 3459.65 ) ),
Shape or Scale( Point Mass, Location( 533.069859958053 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 701830302 )
)
)}
)
);
Code Explanation:
- Open data table.
- Create Life Distribution object.
- Set response variables.
- Fit logistic model.
- Change confidence level.
- Set confidence interval method.
- Set scale to nonparametric.
- Set interval type.
- Hide event plot frequency label.
- Configure Bayesian estimates script.
Example 75
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate survival curves and failure rates.
Code:
dt = Open("data_table.jmp");
ld = dt << Life Distribution( Y( :Time ), Censor( :Censor ), <<Fit All Distributions );
get values = Expr(
rp = Report( ld )["Model Comparisons"];
Sval = rp[Table Box( 1 )][String Col Box( 1 )] << get;
Tval = rp[Table Box( 1 )] << get as matrix;
);
get values;
Tdef = Tval;
ld << Comparison Criterion( Negative Loglikelihood );
get values;
ld << Comparison Criterion( BIC );
get values;
ld << Comparison Criterion( AICc );
get values;
failure kme = Report( ld )["Nonparametric Estimate"][Table Box( 1 )] << get as matrix;
ld << Show Survival Curve;
survival kme = Report( ld )["Nonparametric Estimate"][Table Box( 1 )] << get as matrix;
Code Explanation:
- Open data table;
- Perform Life Distribution analysis.
- Define expression for getting values.
- Execute expression to get initial values.
- Store initial Tval in Tdef.
- Change comparison criterion to Negative Loglikelihood.
- Execute expression again.
- Change comparison criterion to BIC.
- Execute expression again.
- Change comparison criterion to AICc.
- Execute expression again.
- Get failure KME data.
- Show survival curve.
- Get survival KME data.
Example 76
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship, generating reports with quantile profiler plots.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
Censor( :Censor ),
Censor Code( 1 ),
<<Fit Weibull,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Quantile Functions( 1 ),
Show Event Plot Frequency Label( 0 ),
Show Survival Curve( 1 ),
<<Set Scriptables(
{Bayesian Estimates(
Weibull,
Model(
Location Prior( Normal, Location( 10.1772042556246 ), Scale( 0.465889661032354 ) ),
Scale Prior( Normal, Location( 0.9447814454012 ), Scale( 0.239444025490092 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 1543709423 )
)
)}
)
);
obj << Fit Normal;
rpt = Report( obj );
lst = rpt[Outline Box( "Quantile Profiler" )][AxisBox( 1 )] << get script;
lst = rpt[Outline Box( "Quantile Profiler" )][AxisBox( 3 )] << get script;
lst = rpt[Outline Box( "Quantile Profiler" )][AxisBox( 4 )] << get script;
lst = rpt["Parametric Estimate - Weibull"]["Quantile Profiler"][AxisBox( 1 )] << get script;
lst = rpt["Bayesian Estimates - Result 1"]["Quantile Profiler"][AxisBox( 1 )] << get script;
lst = rpt["Parametric Estimate - Normal"]["Quantile Profiler"][AxisBox( 1 )] << get script;
Code Explanation:
- Open table.
- Fit Weibull distribution.
- Set confidence interval method.
- Set scale to nonparametric.
- Set interval type.
- Show quantile functions.
- Hide event plot frequency label.
- Show survival curve.
- Fit Normal distribution.
- Retrieve scripts from reports.
Example 77
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP.
Code:
dt = Open("data_table.jmp");
obj = Life Distribution(
Y( :start time, :end time ),
Freq( :count ),
<<Fit Weibull,
<<Suppress Plot( Weibull ),
<<Set Scriptables(
{Probability Paper( Profiler( 1, Confidence Intervals( 1 ), Term Value( start time( 1003, Lock( 0 ), Show( 1 ) ) ) ) )}
)
);
Code Explanation:
- Open data table.
- Define life distribution object.
- Set Y variables.
- Set frequency variable.
- Fit Weibull distribution.
- Suppress Weibull plot.
- Set scriptables.
- Create probability paper.
- Enable profiler.
- Display confidence intervals.
Example 78
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP, generating a report with Bayesian estimation results and prior/posterior scatter plots.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :start time, :end time ),
<<Fit Normal,
<<Set Scriptables(
{Probability Paper( Profiler( 1 ) ), Normal Distribution( Profiler( 1 ) ), Normal Quantile( Profiler( 1 ) ),
Normal Hazard( Profiler( 1 ) ), Normal Density( Profiler( 1 ) ), Bayesian Estimates(
Normal,
Model(
Quantile and Parameter Priors,
Quantile( Normal, Probability( 0.1 ), Low( -2434 ), High( 340 ) ),
Shape or Scale( Normal, Low( 86 ), High( 1632 ) ),
Monte Carlo Iterations( 5000 ),
Seed( 2000 ),
Show Prior Scatter Plot( 1 ),
Overlay Likelihood Contour( 1 )
)
), Custom Estimation( Normal, 0 )}
)
);
rpt = obj << report;
spsp = rpt[Outline Box( "Bayesian Estimation - Normal" )][CheckBoxBox( 1 )] << get;
olc = rpt[Outline Box( "Bayesian Estimation - Normal" )][CheckBoxBox( 2 )] << get;
priorSPf1 = rpt[Outline Box( "Prior Scatter Plot" )][Frame Box( 2 )] << get journal;
priorSPlbl1 = N Rows( rpt[Outline Box( "Prior Scatter Plot" )][Table Box( 1 )] << get as matrix );
priorSPf2 = rpt[Outline Box( "Prior Scatter Plot" )][Frame Box( 5 )] << get journal;
priorSPlbl2 = N Rows( rpt[Outline Box( "Prior Scatter Plot" )][Table Box( 1 )] << get as matrix );
postSPf1 = rpt[Outline Box( "Posterior Scatter Plot" )][Frame Box( 2 )] << get journal;
postSPlbl1 = N Rows( rpt[Outline Box( "Prior Scatter Plot" )][Table Box( 1 )] << get as matrix );
postSPf2 = rpt[Outline Box( "Posterior Scatter Plot" )][Frame Box( 5 )] << get journal;
postSPlbl2 = N Rows( rpt[Outline Box( "Prior Scatter Plot" )][Table Box( 1 )] << get as matrix );
Code Explanation:
- Open data table.
- Perform life distribution analysis.
- Fit normal distribution.
- Set scriptables for various profilers.
- Generate report from analysis.
- Retrieve Bayesian estimation checkbox states.
- Retrieve overlay likelihood contour checkbox state.
- Get prior scatter plot frame.
- Get prior scatter plot labels.
- Get posterior scatter plot frames and labels.
Example 79
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship, generating a report with mixture model results.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution( Y( :Y1 ), Fit Mixture );
rpt = obj << report;
pbTitle = rpt[Outline Box( "Mixture" )][Panel Box( 1 )] << get title;
Code Explanation:
- Open data table.
- Create Life Distribution object.
- Fit mixture model.
- Generate report object.
- Access Mixture outline box.
- Access first panel box.
- Retrieve panel title.
Example 80
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate hazard rates.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :start time, :end time ),
Freq( :count ),
Fit Competing Risk Mixture( Mix( Weibull( 2 ), Single Cluster, Show Profilers( 1 ) ) )
);
rpt = obj << report;
est = rpt[Outline Box( "Weibull(2)" )][Number Col Box( "Estimate" )] << get as matrix;
hazProf = rpt[Outline Box( "Hazard Profiler" )] << get scriptable object;
tmp = Transpose( 500 :: 2000 :: 500 );
For( i = 1, i <= N Rows( tmp ), i++,
hazProf << Term Value( start time( tmp[i] ) );
haz = Num( rpt[Outline Box( "Hazard Profiler" )][Text Box( 2 )] << get text );
calHaz = Weibull Density( tmp[i], est[2], est[1] ) / (1 - Weibull Distribution( tmp[i], est[2], est[1] ))
+Weibull Density( tmp[i], est[4], est[3] ) / (1 - Weibull Distribution( tmp[i], est[4], est[3] ));
);
Close( dt, No Save );
Preferences( Life Distribution( Show Markers for Right Censored Observations( 0 ) ) );
Code Explanation:
- Open data table.
- Fit life distribution model.
- Extract report object.
- Retrieve Weibull estimates.
- Get hazard profiler object.
- Create time range.
- Loop through time values.
- Set term value in profiler.
- Get hazard text.
- Calculate calibrated hazard.
Example 81
Summary: Fits a competing risk mixture model using Lognormal distribution and Overlapping Clusters to analyze cumulative damage data, with start and end times specified.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :start time, :end time ),
Freq( :count ),
Fit Competing Risk Mixture( Mix( Lognormal( 2 ), Overlapping Clusters, Show Profilers( 1 ) ) )
);
Code Explanation:
- Open data table.
- Create life distribution object.
- Specify start and end times.
- Set frequency column.
- Fit competing risk mixture model.
- Use lognormal distribution.
- Enable overlapping clusters.
- Show profilers for mixtures.
Example 82
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to generate hazard profiles.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution( Y( :Time ), Censor( :censor ), Censor Code( 1 ), <<Fit Exponential, Show Hazard Functions( 1 ) );
rpt = obj << report;
hazProfScptObj = rpt[Outline Box( 6 )] << get scriptable object;
hazProfScptObj << Term Value( Time( , Min( -20 ) ) );
hazProfScptObj << Term Value( Time( -10, Min( -20 ) ) );
hazProfVal = Num( rpt[Outline Box( 6 )][Text Box( 2 )] << get text );
hazProfScptObj2 = rpt[Outline Box( 16 )] << get scriptable object;
hazProfScptObj2 << Term Value( Time( -5, Min( -20 ) ) );
hazProfVal2 = Num( rpt[Outline Box( 16 )][Text Box( 2 )] << get text );
Code Explanation:
- Open table.
- Fit exponential distribution.
- Show hazard functions.
- Get report object.
- Access first hazard profile.
- Set term value for time.
- Set another term value for time.
- Extract hazard profile value.
- Access second hazard profile.
- Set term value for time.
- Extract hazard profile value.
Example 83
Summary: Performs a cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to fit life distribution models for single observations.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
Censor( :Censor ),
Censor Code( 1 ),
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables()
);
Close( dt, No Save );
dt = New Table( "Single Observation", New Column( "Time", Set Values( [0.0258475043778809] ) ), );
obj = dt << Life Distribution( Y( :Time ), Fit Mixture );
Code Explanation:
- Open data table.
- Fit life distribution model.
- Specify time variable.
- Define censor variable.
- Set censor code.
- Choose confidence interval method.
- Set scale to nonparametric.
- Select simultaneous interval type.
- Hide event plot frequency label.
- Create new table with single observation.
- Fit mixture model for new data.
Example 84
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate life distribution of Time Cycles.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time Cycles ),
<<Fit GenGamma,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Probability Paper( Profiler( 1, Confidence Intervals( 1 ), Term Value( Time Cycles( 6707, Lock( 0 ), Show( 1 ) ) ) ) ),
Generalized Gamma Distribution( Profiler( 1, Confidence Intervals( 1 ), Term Value( Time Cycles( 6707, Lock( 0 ), Show( 1 ) ) ) ) ),
Generalized Gamma Quantile( Profiler( 1, Confidence Intervals( 1 ), Term Value( Probability( 0.5, Lock( 0 ), Show( 1 ) ) ) ) ),
Generalized Gamma Hazard( Profiler( 1, Confidence Intervals( 1 ), Term Value( Time Cycles( 6707, Lock( 0 ), Show( 1 ) ) ) ) ),
Generalized Gamma Density( Profiler( 1, Term Value( Time Cycles( 6707, Lock( 0 ), Show( 1 ) ) ) ) ),
Fix Parameter(
Generalized Gamma,
{mu, 7.00959394188659, 0},
{sigma, 1.16487698805869, 1},
{lambda, 0.585470825292279, 0},
Set Scriptables( Custom Estimation( Generalized Gamma, 0 ) )
), Custom Estimation( Generalized Gamma, 0 )}
)
);
Code Explanation:
- Open data table.
- Perform Life Distribution analysis.
- Set response variable to Time Cycles.
- Fit Generalized Gamma distribution.
- Use Wald confidence interval method.
- Set scale to Nonparametric.
- Choose Simultaneous interval type.
- Hide event plot frequency labels.
- Configure Probability Paper scriptable.
- Configure Generalized Gamma Distribution scriptable.
Example 85
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship, generating quantile profiler limits.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
Censor( :Censor ),
Censor Code( 1 ),
Fit Competing Risk Mixture( Mix( Weibull( 2 ), Single Cluster, Show Profilers( 1 ) ) )
);
rpt = obj << report;
low = Num( Words( rpt[Outline Box( "Quantile Profiler" )][Text Box( 3 )] << get text, "[," )[1] );
upp = Num( Words( rpt[Outline Box( "Quantile Profiler" )][Text Box( 4 )] << get text, "]" )[1] );
Code Explanation:
- Open data table.
- Fit life distribution model.
- Specify response variable.
- Define censor variable.
- Set censor code.
- Fit competing risk mixture.
- Include Weibull distribution.
- Use single cluster.
- Show profilers.
- Extract quantile profiler limits.
Example 86
Summary: Performs a cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate reliability metrics.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
Censor( :censor ),
Censor Code( 1 ),
<<Fit DS Weibull,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Probability Paper( Profiler( 1, Confidence Intervals( 1 ), Term Value( Time( 78.75, Lock( 0 ), Show( 1 ) ) ) ) ),
DS Weibull Distribution( Profiler( 1, Confidence Intervals( 1 ), Term Value( Time( 78.75, Lock( 0 ), Show( 1 ) ) ) ) ),
DS Weibull Quantile( Profiler( 1, Confidence Intervals( 1 ), Term Value( Probability( 0.32548, Lock( 0 ), Show( 1 ) ) ) ) ),
DS Weibull Hazard( Profiler( 1, Confidence Intervals( 1 ), Term Value( Time( 78.75, Lock( 0 ), Show( 1 ) ) ) ) ),
DS Weibull Density( Profiler( 1, Term Value( Time( 78.75, Lock( 0 ), Show( 1 ) ) ) ) ), Custom Estimation( DS Weibull, 0 )}
)
);
rpt = obj << report;
est95 = rpt[Outline Box( "Parametric Estimate - DS Weibull" )][Table Box( 1 )] << get as matrix;
obj << Change Confidence Level( 0.90 );
est90 = rpt[Outline Box( "Parametric Estimate - DS Weibull" )][Table Box( 1 )] << get as matrix;
Code Explanation:
- Open table.
- Fit life distribution.
- Specify Y variable.
- Specify censor variable.
- Set censor code.
- Fit DS Weibull model.
- Use Wald confidence intervals.
- Set nonparametric scale.
- Use simultaneous interval type.
- Hide event plot frequency labels.
Example 87
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate hazard rates and calculate calibrated hazards.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :start time, :end time ),
Freq( :count ),
Fit Competing Risk Mixture( Mix( Weibull( 2 ), Single Cluster, Show Profilers( 1 ) ) )
);
rpt = obj << report;
est = rpt[Outline Box( "Weibull(2)" )][Number Col Box( "Estimate" )] << get as matrix;
hazProf = rpt[Outline Box( "Hazard Profiler" )] << get scriptable object;
tmp = Transpose( 500 :: 2000 :: 500 );
For( i = 1, i <= N Rows( tmp ), i++,
hazProf << Term Value( start time( tmp[i] ) );
haz = Num( rpt[Outline Box( "Hazard Profiler" )][Text Box( 2 )] << get text );
calHaz = Weibull Density( tmp[i], est[2], est[1] ) / (1 - Weibull Distribution( tmp[i], est[2], est[1] ))
+Weibull Density( tmp[i], est[4], est[3] ) / (1 - Weibull Distribution( tmp[i], est[4], est[3] ));
);
Code Explanation:
- Open data table.
- Fit life distribution model.
- Extract report object.
- Retrieve Weibull estimates.
- Get hazard profiler object.
- Create time range matrix.
- Loop through time values.
- Set profiler term value.
- Extract hazard text.
- Calculate calibrated hazard.
Example 88
Summary: Runs a Life Distribution analysis to model cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
Censor( :Censor ),
Censor Code( 1 ),
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables()
);
Code Explanation:
- Open data table.
- Launch Life Distribution analysis.
- Set response variable to Time.
- Define censoring variable as Censor.
- Specify censor code as 1.
- Choose Wald confidence interval method.
- Set scale to Nonparametric.
- Select simultaneous interval type.
- Hide event plot frequency labels.
- Enable scriptable options.
Example 89
Summary: Estimates Weibull distribution parameters with varying confidence levels for cumulative damage analysis using the Ramp Stress model.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution( Y( :Time Cycles ), <<Fit Weibull, );
rpt = obj << report;
est95 = rpt[Outline Box( "Parametric Estimate - Weibull" )][Table Box( 1 )] << get as matrix;
obj << Change Confidence Level( 0.8 );
est80 = rpt[Outline Box( "Parametric Estimate - Weibull" )][Table Box( 1 )] << get as matrix;
obj << Change Confidence Level( 0.6 );
est60 = rpt[Outline Box( "Parametric Estimate - Weibull" )][Table Box( 1 )] << get as matrix;
obj << Change Confidence Level( 0.95 );
est95dot1 = rpt[Outline Box( "Parametric Estimate - Weibull" )][Table Box( 1 )] << get as matrix;
Code Explanation:
- Open data table.
- Fit Weibull distribution to Time Cycles.
- Retrieve report object.
- Extract 95% confidence estimates.
- Change confidence level to 80%.
- Extract 80% confidence estimates.
- Change confidence level to 60%.
- Extract 60% confidence estimates.
- Change confidence level to 95%.
- Extract 95% confidence estimates again.
Example 90
Summary: Process of performing cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution( Censor( :censor ) );
For( ii = 1, ii <= N Items( Window() ), ii++,
If( Window()[ii] << get window title == "Life Distribution",
Wait( 0.5 );
txt1 = Window()[ii][Text Edit Box( 1 )] << get text;
Window()[ii][Panel Box( 3 )][ListBoxBox( 2 )] << Set Selected( 1 );
Window()[ii][Panel Box( 4 )][Button Box( 3 )] << Click();
txt2 = Window()[ii][Text Edit Box( 1 )] << get text;
Break();
)
);
Close( dt, No Save );
dt = New Table( "Fit Mixture",
New Column( "Freq", Values( J( 3, 1, 50 ) ) ),
New Column( "Cycles", Values( [5000, 7000, 10000] ) ),
New Column( "Censor", Values( J( 3, 1, 1 ) ) )
);
obj = dt << Life Distribution( Y( :Cycles ), Censor( :Censor ), Censor Code( 1 ), Freq( :Freq ) );
obj << Fit Mixture;
Code Explanation:
- Open data table.
- Create life distribution object.
- Loop through open windows.
- Check for "Life Distribution" window.
- Wait half a second.
- Get first text box content.
- Select first item in list box.
- Click third button in panel.
- Get updated text box content.
- Close original data table.
- Create new data table.
- Add frequency column.
- Add cycles column.
- Add censor column.
- Create life distribution object for new data.
- Fit mixture model.
Example 91
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship by fitting two separate Weibull distributions to censored data.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution( Y( :Time ), Censor( :Censor ), Censor Code( 1 ), <<Fit Weibull, <<Set Scale( Weibull ) );
rpt = obj << report;
est = rpt[Outline Box( "Parametric Estimate - Weibull" )][Table Box( 1 )] << get as matrix;
crit = rpt[Outline Box( "Parametric Estimate - Weibull" )][Table Box( 2 )] << get as matrix;
dt << New Column( "Censor1", Character, Formula( If( :Censor == 1, "Survive", "Fail" ) ) );
dt << New Column( "Censor2", Character, Formula( If( :Censor == 1, "Survived", "Failure" ) ) );
:Censor1 << Delete Formula;
:Censor2 << Delete Formula;
obj1 = dt << Life Distribution( Y( :Time ), Censor( :Censor1 ), Censor Code( "Survive" ), <<Fit Weibull, <<Set Scale( Weibull ) );
rpt1 = obj1 << report;
est1 = rpt1[Outline Box( "Parametric Estimate - Weibull" )][Table Box( 1 )] << get as matrix;
crit1 = rpt1[Outline Box( "Parametric Estimate - Weibull" )][Table Box( 2 )] << get as matrix;
obj2 = dt << Life Distribution( Y( :Time ), Censor( :Censor2 ), Censor Code( "Survived" ), <<Fit Weibull, <<Set Scale( Weibull ) );
rpt2 = obj2 << report;
est2 = rpt2[Outline Box( "Parametric Estimate - Weibull" )][Table Box( 1 )] << get as matrix;
crit2 = rpt2[Outline Box( "Parametric Estimate - Weibull" )][Table Box( 2 )] << get as matrix;
Code Explanation:
- Open table.
- Fit Weibull distribution.
- Extract parametric estimates.
- Create new column "Censor1".
- Create new column "Censor2".
- Delete formula from "Censor1".
- Delete formula from "Censor2".
- Fit Weibull distribution with "Censor1".
- Extract parametric estimates.
- Fit Weibull distribution with "Censor2".
Example 92
Summary: Process of performing cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution( Censor( :censor ) );
For( ii = 1, ii <= N Items( Window() ), ii++,
If( Window()[ii] << get window title == "Life Distribution",
txt1 = Window()[ii][Text Edit Box( 1 )] << get text;
Window()[ii][Panel Box( 3 )][ListBoxBox( 2 )] << Set Selected( 1 );
Window()[ii][Panel Box( 4 )][Button Box( 3 )] << Click();
txt2 = Window()[ii][Text Edit Box( 1 )] << get text;
Break();
)
);
Code Explanation:
- Open table.
- Fit life distribution model.
- Iterate through windows.
- Check for Life Distribution window.
- Get first text box content.
- Select first item in list box.
- Click third button in panel.
- Get updated text box content.
- Exit loop.
Example 93
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
Censor( :censor ),
Censor Code( 1 ),
<<Fit Lognormal,
<<Set Scriptables( {Custom Estimation( Lognormal, 1 )} )
);
rpt = obj << report;
rpt[Button Box( 2 )] << Click();
rpt[Button Box( 4 )] << Click();
Code Explanation:
- Open data table;
- Create Life Distribution object.
- Set Y variable to Time.
- Set censor variable.
- Define censor code.
- Fit Lognormal distribution.
- Set custom estimation script.
- Generate report.
- Click second button box.
- Click fourth button box.
Example 94
Summary: Perform cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship, extracting report object and retrieving y-axis and x-axis label text.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution( Y( :Time ), Censor( :censor ), Censor Code( 1 ), Fit Competing Risk Mixture, );
rpt = obj << report;
yAxisLbl = rpt[Outline Box( "Overlay" )][Text Edit Box( 1 )] << get text;
xAxisLbl = rpt[Outline Box( "Overlay" )][Text Edit Box( 2 )] << get text;
Code Explanation:
- Open data table.
- Perform life distribution analysis.
- Extract report object.
- Retrieve y-axis label text.
- Retrieve x-axis label text.
Example 95
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP, generating a report with customized y-axis and x-axis labels.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution( Y( :Time ), Censor( :censor ), Censor Code( 1 ), Fit Mixture, );
rpt = obj << report;
yAxisLbl = rpt[Outline Box( "Overlay" )][Text Edit Box( 1 )] << get text;
xAxisLbl = rpt[Outline Box( "Overlay" )][Text Edit Box( 2 )] << get text;
Code Explanation:
- Open data table;
- Create Life Distribution object.
- Set Y variable to Time.
- Set Censor variable to censor.
- Define Censor Code as 1.
- Fit Mixture model.
- Retrieve report object.
- Extract Overlay outline box.
- Get text from first Text Edit Box (y-axis label).
- Get text from second Text Edit Box (x-axis label).
Example 96
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate failure rates and visualize hazard profiles.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Y2 ),
Confidence Interval Method( Likelihood ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
Fit Competing Risk Mixture( Mix( Weibull( 2 ), Single Cluster, Show Profilers( 1 ) ) )
);
rpt = obj << report;
est = rpt[Outline Box( "Weibull(2)" )][Number Col Box( "Estimate" )] << get as matrix;
hazProf = rpt[Outline Box( "Hazard Profiler" )] << get scriptable object;
hazProf << Term Value( Y2( 10000 ) );
haz = Num( rpt[Outline Box( "Hazard Profiler" )][Text Box( 2 )] << get text );
calHaz = Weibull Density( 10000, est[2], est[1] ) / (1 - Weibull Distribution( 10000, est[2], est[1] ))
+Weibull Density( 10000, est[4], est[3] ) / (1 - Weibull Distribution( 10000, est[4], est[3] ));
Code Explanation:
- Open data table;
- Fit life distribution model.
- Set nonparametric scale.
- Enable simultaneous interval type.
- Disable event plot frequency labels.
- Fit competing risk mixture.
- Extract report object.
- Retrieve Weibull estimates.
- Get hazard profiler scriptable object.
- Set term value for hazard profiler.
Example 97
Summary: Creates a Life Distribution object for cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship.
Code:
dt = Open("data_table.jmp");
dt << Select All Rows;
r = dt << Delete Rows;
obj = dt << Life Distribution( Perspective( Compare Groups ), Y( :Time Cycles ), Grouping( :Group ), Censor( :Censor ), <<Fit Lognormal );
Code Explanation:
- Open data table;
- Select all rows.
- Delete selected rows.
- Create Life Distribution object.
- Set perspective to Compare Groups.
- Define Y variable as Time Cycles.
- Set grouping variable as Group.
- Define censor variable as Censor.
- Fit Lognormal distribution.
Example 98
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate life distribution parameters.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution( Y( :Time Cycles ), Censor( :Censor ), <<Fit Lognormal, );
rpt = obj << report;
scptObj = rpt["Parametric Estimate - Lognormal"] << get scriptable object;
scptObj << Bayesian Estimates;
txt = rpt["Bayesian Estimation - Lognormal"][Text Box( 1 )] << get text;
name = rpt["Bayesian Estimation - Lognormal"][String Col Box( "Name" )] << get;
Close( dt, No Save );
Random Reset( 1111111111 );
Code Explanation:
- Open data_table data
- Perform life distribution analysis.
- Fit lognormal distribution.
- Generate report object.
- Access parametric estimate section.
- Enable Bayesian estimates.
- Extract Bayesian estimation text.
- Retrieve names from report.
- Close data table without saving.
- Reset random seed.
Example 99
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship by fitting a Lognormal distribution to the data and generating Bayesian estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution( Y( :Time Cycles ), Censor( :Censor ), <<Fit Lognormal, );
rpt = obj << report;
scptObj = rpt["Parametric Estimate - Lognormal"] << get scriptable object;
scptObj << Bayesian Estimates;
txt = rpt["Bayesian Estimation - Lognormal"][Text Box( 1 )] << get text;
name = rpt["Bayesian Estimation - Lognormal"][String Col Box( "Name" )] << get;
Code Explanation:
- Open data table.
- Fit Lognormal distribution.
- Retrieve report object.
- Access Parametric Estimate.
- Enable Bayesian Estimates.
- Extract Bayesian Estimation text.
- Get Name column data.
Example 100
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to generate life distribution plots with confidence level set to 99%.
Code:
dt = Open("data_table.jmp");
plat = dt << Life Distribution( Y( :Time ), Censor( :Censor ), Censor Code( 1 ), );
plat << Change Confidence Level( 0.99 );
plat << Fit Weibull;
r = Report( plat );
text1 = (r["Distribution Profiler"][Text Box( 3 )] << GetText) || (r["Distribution Profiler"][Text Box( 4 )] << GetText);
text2 = (r["Quantile Profiler"][Text Box( 3 )] << GetText) || (r["Quantile Profiler"][Text Box( 4 )] << GetText);
text3 = (r["Hazard Profiler"][Text Box( 3 )] << GetText) || (r["Hazard Profiler"][Text Box( 4 )] << GetText);
Code Explanation:
- Open data table.
- Create life distribution plot.
- Set confidence level to 99%.
- Fit Weibull distribution.
- Retrieve report object.
- Extract text from Distribution Profiler.
- Extract text from Quantile Profiler.
- Extract text from Hazard Profiler.
Example 101
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate failure rates and compare cause summaries.
Code:
dt = Open("data_table.jmp");
plat1 = dt << Life Distribution(
Y( :Time Cycles ),
Censor( :Censor ),
Censor Code( 1 ),
Failure Cause( :Causes ),
Failure Distribution by Cause( Weibull ),
Comparison Criterion( AICc ),
);
plat2 = plat1 << Redo Analysis;
r1 = Report( plat1 );
r2 = Report( plat2 );
j1 = r1["Cause Summary"] << GetJournal;
j2 = r2["Cause Summary"] << GetJournal;
check = (j1 == j2);
Code Explanation:
- Open data table;
- Perform life distribution analysis.
- Set Y variable to Time Cycles.
- Define censoring variable.
- Specify censor code.
- Include failure causes.
- Use Weibull distribution for failure.
- Select AICc as comparison criterion.
- Redo the analysis.
- Compare cause summary journals.
Example 102
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to analyze failure modes in a reliability study.
Code:
dt = Open("data_table.jmp");
plat1 = dt << Life Distribution(
Y( :Time Cycles ),
Censor( :Censor ),
Censor Code( 1 ),
Failure Cause( :Causes ),
Failure Distribution by Cause( Lognormal ),
Comparison Criterion( AICc ),
);
plat2 = plat1 << Redo Analysis;
r1 = Report( plat1 );
r2 = Report( plat2 );
j1 = r1["Cause Summary"] << GetJournal;
j2 = r2["Cause Summary"] << GetJournal;
check = (j1 == j2);
Close( dt, No Save );
dt = New Table( "Test",
New Column( "X", Values( [1, 1, 1, 1, 2, 2, 2, 2] ) ),
New Column( "Cause", Values( [1, 1, 1, 1, 2, 2, 2, 2] ) ),
New Column( "Y", Values( [1, 2, 3, 4, 5, 6, 7, 8] ) )
);
check = 0;
obj = dt << Life Distribution(
Y( :Y ),
Failure Cause( :Cause ),
Failure Distribution by Cause( Lognormal ),
<<Set Scale( Lognormal ),
SendToReport( Dispatch( {"Cause Combination"}, "2", ScaleBox, {Min( 0.1 ), Max( 0.9 ), Show Major Grid( 1 )} ) )
);
check = 1;
Close( dt, No Save );
expectedp = [., 0.0833333333333333, 0.25, 0.416666666666667, 0.583333333333333, 0.75];
expectedq = [., 1, 2, 3, 4, 5];
dt = New Table( "Test", New Column( "Low", Values( [., 1, 2, 3, 4, 5] ) ), New Column( "High", Values( [1, 2, 3, 4, 5, .] ) ) );
plat = dt << Life Distribution( Y( :Low, :High ), Show Quantile Functions( 1 ) );
r = Report( plat );
frame = r["Compare Distributions"][FrameBox( 1 )];
seg = (frame << Find Seg( Marker Seg( 1 ) ));
cord2 = seg << Get X Values;
cord1 = seg << Get Y Values;
j2 = r["Quantile Profiler"][FrameBox( 1 )] << Get Journal;
frame = r["Quantile Profiler"][FrameBox( 1 )];
seg = (frame << Find Seg( Marker Seg( 1 ) ));
cord4 = seg << Get X Values;
cord3 = seg << Get Y Values;
Code Explanation:
- Open data table.
- Perform Life Distribution analysis.
- Redo the analysis.
- Retrieve first report.
- Retrieve second report.
- Extract "Cause Summary" journal from first report.
- Extract "Cause Summary" journal from second report.
- Compare journals for equality.
- Close data table without saving.
- Create new test table.
- Perform Life Distribution analysis on test table.
- Set scale to Lognormal.
- Adjust report scale properties.
- Close test table without saving.
- Define expected probability values.
- Define expected quantile values.
- Create new test table with low and high columns.
- Perform Life Distribution analysis with quantiles.
- Retrieve report.
- Extract first frame from "Compare Distributions".
- Find segment in first frame.
- Get X values from segment.
- Get Y values from segment.
- Extract journal from "Quantile Profiler".
- Extract second frame from "Quantile Profiler".
- Find segment in second frame.
- Get X values from segment.
- Get Y values from segment.
Example 103
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP.
Code:
dt = Open("data_table.jmp");
plat = dt << Life Distribution( Y( :Time ), Censor( :Censor ), Change Confidence Level( 0.99 ) );
r = Report( plat );
tb = r["Nonparametric Estimate"];
colname1 = tb[Col Span Box( 1 )] << GetHeading;
colname2 = tb[Col Span Box( 2 )] << GetHeading;
check1 = Contains( colname1, "99%" ) > 0;
check2 = Contains( colname2, "99%" ) > 0;
Code Explanation:
- Open table.
- Fit life distribution.
- Set confidence level.
- Create report object.
- Access nonparametric estimate.
- Retrieve first column heading.
- Retrieve second column heading.
- Check for "99%" in first column.
- Check for "99%" in second column.
Example 104
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship, generating a report with survival curve and expected values.
Code:
dt = Open("data_table.jmp");
plat = dt << Life Distribution( Y( :Time ), Censor( :Censor ), <<Fit Weibull, <<Show Survival Curve( 1 ) );
r = Report( plat );
text = (r["Distribution Profiler"][Text Box( 3 )] << GetText) || (r["Distribution Profiler"][Text Box( 4 )] << GetText);
expected = "[0.692878, 0.888403]";
Close( dt, No Save );
dt = New Table( "Test",
New Column( "Life",
Set Values(
[17, 220, 52, 11, 349, 454, 410, 4, 0, 19, 82, 0, 0, 5, 0, 76, 216, 1050, 10, 789, 61, 453, 13, 180, 225, 0, 78, 24, 9, 1, 568,
1162, 801, 131, 73, 1005, 25, 2, 256, 25, 0, 6, 0, 6, 25, 6, 0, 167, 20, 633, 7, 2, 1, 0, 0, 25, 1110, 0, 83, 1, 4, 13, 784, 34,
542, 25, 7, 271, 217, 821, 463, 103, 213, 8, 43, 676, 403, 156, 1, 166, 865, 867, 24, 804, 1, 97, 4, 0, 0, 149, 1034, 285, 1024,
627, 98, 118, 1003, 31, 1, 6]
)
),
New Column( "Status",
Set Values(
[0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0,
0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0]
)
),
New Column( "Mode",
Set Values(
[4, 4, 4, 4, 5, 3, 3, 4, 4, 4, 5, 4, 3, 2, 4, 3, 5, 5, 2, 5, 4, 2, 4, 3, 2, 4, 3, 4, 2, 4, 3, 5, 2, 3, 2, 5, 3, 4, 5, 4, 4, 4,
4, 4, 4, 2, 4, 3, 4, 4, 4, 4, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 5, 2, 4, 4, 2, 4, 5, 3, 2, 5, 2, 5, 3, 5, 2, 4, 3, 5, 5, 4, 5, 4,
4, 5, 4, 4, 5, 2, 5, 2, 5, 4, 4, 3, 4, 2, 4]
),
)
);
plat = dt << Life Distribution(
Y( :Life ),
Censor( :Status ),
Failure Cause( :Mode ),
Failure Distribution by Cause( Individual Best ),
Comparison Criterion( AICc )
);
r = Report( plat );
check = Is Scriptable( r );
Code Explanation:
- Open data table.
- Fit Weibull distribution.
- Show survival curve.
- Extract report text.
- Define expected values.
- Close data table.
- Create new table.
- Add "Life" column.
- Add "Status" column.
- Add "Mode" column.
Example 105
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP.
Code:
dt = Open("data_table.jmp");
check = 0;
obj = dt << Life Distribution(
Y( :Time ),
Censor( :Censor ),
Censor Code( 1 ),
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables( {} )
);
obj << Show Quantile Functions;
obj << Fit All Distributions;
check = 1;
Code Explanation:
- Open data table;
- Initialize variable
checkto 0. - Create Life Distribution object.
- Set response variable to :Time.
- Set censor variable to :Censor.
- Define censor code as 1.
- Use Wald method for confidence intervals.
- Set scale to Nonparametric.
- Set interval type to Simultaneous.
- Disable event plot frequency labels.
- Fit all distributions.
- Set
checkto 1.
Example 106
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate nonparametric failure rates.
Code:
dt = Open("data_table.jmp");
plat = dt << Life Distribution( Y( :start time, :end time ), Freq( :count ), );
rep = Report( plat );
result = rep["Nonparametric Estimate"][Table Box( 1 )] << GetAsMatrix;
expected = [6 6 0.00210822206605762 0.00189548743099973 0.00935269928766611,
12 24 0.00491918482080112 0.00281394123913743 0.0112004769460989,
48 48 0.00632516318593008 0.00378571429284073 0.0130123590309347,
168 168 0.00789486822636759 0.00466790912632917 0.0163853145001895,
500 500 0.00993578898421232 0.00582017205669622 0.0211064836182172,
1000 1000 0.0147458664869806 0.00938076808425147 0.0357069985349881,
2000 2000 0.0223723247690702 0.0123696749526263 0.0553006991020271];
Code Explanation:
- Open data table.
- Perform life distribution analysis.
- Retrieve report object.
- Extract nonparametric estimate table.
- Convert table to matrix.
- Define expected results matrix.
Example 107
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution( Y( :Time ), Censor( :Censor ), Censor Code( "1" ) );
rprt = obj << Report;
jtext = rprt << get journal;
check = (Length( jtext ) > 0);
Code Explanation:
- Open data table.
- Create life distribution object.
- Set Y variable to Time.
- Set Censor variable to Censor.
- Define censor code as "1".
- Generate report from object.
- Retrieve journal from report.
- Check if journal length is greater than 0.
Example 108
Summary: Runs the Life Distribution analysis for a given data table, fitting multiple distributions including Lognormal, Weibull, DS Weibull, and more, with plot suppression enabled.
Code:
dt = Open("data_table.jmp");
plat = dt << Life Distribution(
Y( :Time ),
Censor( :Censor ),
<<Fit Lognormal,
<<Fit Weibull,
<<Fit DS Weibull,
<<Fit Loglogistic,
<<Fit Frechet,
<<Fit Normal,
<<Fit SEV,
<<Fit Logistic,
<<Fit LEV,
<<Fit Exponential,
<<Fit LogGenGamma,
<<Fit GenGamma,
<<Fit TH Lognormal,
<<Fit TH Weibull,
<<Fit TH Loglogistic,
<<Fit TH Frechet,
<<Fit DS Lognormal,
<<Fit DS Loglogistic,
<<Fit DS Frechet,
<<Suppress Plot( Lognormal ),
<<Suppress Plot( Weibull ),
<<Suppress Plot( Loglogistic ),
<<Suppress Plot( Frechet ),
<<Suppress Plot( Normal ),
<<Suppress Plot( SEV ),
<<Suppress Plot( Logistic ),
<<Suppress Plot( LEV ),
<<Suppress Plot( Exponential ),
<<Suppress Plot( LogGenGamma ),
<<Suppress Plot( GenGamma ),
<<Suppress Plot( TH Lognormal ),
<<Suppress Plot( TH Weibull ),
<<Suppress Plot( TH Loglogistic ),
<<Suppress Plot( TH Frechet ),
<<Suppress Plot( DS Lognormal ),
<<Suppress Plot( DS Weibull ),
<<Suppress Plot( DS Loglogistic ),
<<Suppress Plot( DS Frechet ),
);
r = Report( plat );
selecteditems = r[CheckBoxBox( 1 )] << GetSelected;
nitem = N Items( selecteditems );
Code Explanation:
- Open data table;
- Perform Life Distribution analysis.
- Fit Lognormal model.
- Fit Weibull model.
- Fit DS Weibull model.
- Fit Loglogistic model.
- Fit Frechet model.
- Fit Normal model.
- Fit SEV model.
- Suppress all plot outputs.
Example 109
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to evaluate failure causes in a data table.
Code:
dt = Open("data_table.jmp");
plat1 = dt << Life Distribution(
Y( :Time Cycles ),
Censor( :Censor ),
Censor Code( 1 ),
Failure Cause( :Causes ),
Failure Distribution by Cause( Lognormal ),
Comparison Criterion( AICc ),
);
plat2 = plat1 << Redo Analysis;
r1 = Report( plat1 );
r2 = Report( plat2 );
j1 = r1["Cause Summary"] << GetJournal;
j2 = r2["Cause Summary"] << GetJournal;
check = (j1 == j2);
Code Explanation:
- Open data table.
- Perform life distribution analysis.
- Set Y variable to Time Cycles.
- Specify censor variable.
- Define censor code.
- Identify failure causes.
- Assign lognormal distribution by cause.
- Use AICc for comparison criterion.
- Redo the analysis.
- Compare reports for consistency.
Example 110
Summary: Runs the Life Distribution analysis for cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship.
Code:
dt = Open("data_table.jmp");
check = 0;
obj = dt << Life Distribution(
Y( :Time Cycles ),
Censor( :Censor ),
Censor Code( 1 ),
Failure Cause( :Causes ),
Failure Distribution by Cause( Frechet )
);
rprt = obj << report;
check = 1;
Code Explanation:
- Open data table;
- Initialize check variable to 0.
- Run Life Distribution analysis.
- Specify Time Cycles as Y.
- Use Censor column for censored data.
- Set censor code to 1.
- Analyze failure causes from Causes column.
- Assume Frechet distribution for each cause.
- Retrieve analysis report.
- Set check variable to 1.
Example 111
Summary: Cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to estimate failure rates.
Code:
dt = Open("data_table.jmp");
plat = dt << Life Distribution(
Y( :Time Cycles ),
Censor( :Censor ),
Censor Code( 1 ),
Failure Cause( :Causes ),
Failure Distribution by Cause( LogNormal ),
);
r = Report( plat );
axislist = r[AxisBox( 1 )] << GetScript;
scale = Arg( axislist[1] );
Code Explanation:
- Open data table;
- Launch Life Distribution platform.
- Set Y variable to Time Cycles.
- Specify Censor variable.
- Define Censor Code as 1.
- Use Causes for failure analysis.
- Assign LogNormal distribution to each cause.
- Retrieve report from Life Distribution.
- Access first AxisBox script.
- Extract scale from axis script.
Example 112
Summary: Analyze cumulative damage using a Weibull distribution and Inverse Power relationship, generating a report with survival curves and extracting text from specified boxes.
Code:
dt = Open("data_table.jmp");
plat = dt << Life Distribution( Y( :Time ), Censor( :Censor ), <<Fit Weibull, <<Show Survival Curve( 1 ) );
r = Report( plat );
text = (r["Distribution Profiler"][Text Box( 3 )] << GetText) || (r["Distribution Profiler"][Text Box( 4 )] << GetText);
expected = "[0.692878, 0.888403]";
Code Explanation:
- Open data table.
- Fit Weibull distribution.
- Show survival curve.
- Generate report object.
- Extract text from Text Box 3.
- Extract text from Text Box 4.
- Concatenate extracted texts.
- Define expected result.
- Compare actual with expected.
- End script.
Example 113
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
Censor( :Censor ),
Censor Code( 1 ),
<<Fit Weibull,
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables( {Weibull( Show Likelihood Contour )} )
);
rpt = obj << report;
Code Explanation:
- Open data table;
- Create Life Distribution object.
- Set response variable to "Time".
- Set censor variable to "Censor".
- Define censor code as 1.
- Fit Weibull distribution.
- Hide event plot frequency labels.
- Enable likelihood contour for Weibull.
- Generate report from object.
- Assign report to variable "rpt".
Example 114
Summary: Perform cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to extract actual summary statistics from a data table.
Code:
dt = Open("data_table.jmp");
ld = dt << Life Distribution( Y( :HoursL, :HoursU ), Freq( :Count ), Perspective( Compare Groups ), Grouping( :DegreesC ) );
act.mt = Report( ld )["Statistics"]["Summary"][Table Box( 1 )] << get as matrix;
exp.mt = [0 0 0 50, 0 0 0 50, 0 0 0 50, 0 0 9 41, 0 0 47 3, 0 0 56 194];
Code Explanation:
- Open data table.
- Perform life distribution analysis.
- Extract actual summary statistics.
- Define expected summary statistics.
Example 115
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP, generating summary matrices for comparison groups.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Perspective( Compare Groups ),
Y( :days ),
Grouping( :Group ),
Censor( :Censor ),
Censor Code( 1 ),
Confidence Interval Method( Wald ),
Select Distribution( Distribution, Nonparametric ),
Select Scale( Nonparametric ),
Tabbed Report( 0 )
);
rpt = obj << report;
wil = (rpt[Outline Box( "Summary" )][Table Box( 1 )] << get as matrix);
summ1 = (rpt[Outline Box( "Individual Group" )][Tab Page Box( 1 )][Outline Box( "Summary of Data" )][Table Box( 1 )] << get as matrix);
summ2 = (rpt[Outline Box( "Individual Group" )][Tab Page Box( 2 )][Outline Box( "Summary of Data" )][Table Box( 1 )] << get as matrix);
Code Explanation:
- Open data table;
- Create Life Distribution object.
- Set perspective to Compare Groups.
- Specify Y variable as days.
- Group data by Group variable.
- Define Censor variable.
- Set Censor Code to 1.
- Use Wald confidence interval method.
- Select Nonparametric distribution.
- Extract Summary, Individual Group Summary, and Individual Group Summary matrices.
Example 116
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship, filtering by group 'Automatic' and generating predictions.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
SendToByGroup( {:Group == "Automatic"} ),
Y( :Time Cycles ),
Censor( :Censor ),
Censor Code( 1 ),
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables( {} ),
SendToByGroup( {:Group == "Automatic"}, Fit Competing Risk Mixture( Mix( Weibull( 2 ), Separable Clusters, Show Profilers( 0 ) ) ) ),
By( :Group )
);
rpt = obj << report;
autoScptObj = rpt[1][Outline Box( "Life Distribution - Time Cycles Group=Automatic" )][Outline Box( "Weibull(2)" )] <<
get scriptable object;
autoScptObj << Save Predictions;
Code Explanation:
- Open data table.
- Fit life distribution model.
- Filter by group "Automatic".
- Set response variable.
- Specify censoring variable.
- Define censor code.
- Choose confidence interval method.
- Set nonparametric scale.
- Select simultaneous intervals.
- Hide event plot labels.
Example 117
Summary: Runs life distribution analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to analyze cumulative damage.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
Censor( :Censor ),
Censor Code( 1 ),
<<Fit Lognormal,
<<Fit Weibull,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Show Hazard Functions( 1 )
);
rpt = obj << report;
Code Explanation:
- Open data table;
- Perform life distribution analysis.
- Set Y variable to "Time".
- Set Censor variable to "Censor".
- Specify censor code as 1.
- Fit Lognormal distribution.
- Fit Weibull distribution.
- Use Wald confidence intervals.
- Set scale to Nonparametric.
- Display hazard functions.
Example 118
Summary: Performs a cumulative damage analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to generate a cause summary report.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time Cycles ),
Censor( :Censor ),
Censor Code( 1 ),
Failure Cause( :Causes ),
Failure Distribution by Cause( Weibull ),
Comparison Criterion( AIC ),
Allow failure mode to use ZI distributions( 0 ),
Allow failure mode to use TH distributions( 0 ),
Allow failure mode to use DS distributions( 0 ),
Allow failure mode to use fixed parameter models( 0 ),
Allow failure mode to use Bayesian models( 0 ),
<<Fit Model(
{{"bearing seal", Weibull, 0}, {"belt", Weibull, 0}, {"container throw", Weibull, 0}, {"cord short", Weibull, 0}, {"engine fan",
Weibull, 0}, {"none", Weibull, 0}, {"power switch", Weibull, 0}, {"stripped gear", Weibull, 0}}
),
<<Set Scale( Linear ),
SendToReport( Dispatch( {"Cause Combination"}, "Competing Cause", FrameBox, {Reference Line Order( 2 ), Grid Line Order( 1 )} ) )
);
rpt = obj << report;
causeSummary = rpt["Cause Summary"][Table Box( 1 )] << get as matrix;
Code Explanation:
- Open data table.
- Run Life Distribution analysis.
- Set Y variable to Time Cycles.
- Set Censor variable to Censor.
- Define Censor Code as 1.
- Use Failure Cause variable.
- Apply Weibull distribution by cause.
- Use AIC for comparison criterion.
- Disable zero-inflated distributions.
- Retrieve cause summary report.
Example 119
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship, generating a report with model comparison results.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
Censor( :Censor ),
Censor Code( 1 ),
<<Fit Lognormal,
<<Fit Weibull,
<<Fit Loglogistic,
<<Fit Frechet,
<<Fit Normal,
<<Fit SEV,
<<Fit Logistic,
<<Fit LEV,
<<Fit Exponential,
<<Fit GenGamma,
<<Fit LogGenGamma,
<<Fit TH Lognormal,
<<Fit TH Weibull,
<<Fit TH Loglogistic,
<<Fit TH Frechet
);
rprt = obj << Report;
Result = (rprt["Model Comparisons", Table Box( 1 )] << GetAsMatrix)[0, {4, 3, 6}];
Code Explanation:
- Open data table.
- Fit life distribution model.
- Specify time variable.
- Specify censor variable.
- Set censor code.
- Fit Lognormal distribution.
- Fit Weibull distribution.
- Fit Loglogistic distribution.
- Fit Frechet distribution.
- Extract model comparison results.
Example 120
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship, extracting parametric estimates and covariance matrices from a data table.
Code:
dt = Open("data_table.jmp");
ld = Life Distribution(
Y( :start time, :end time ),
Freq( :count ),
<<Fit Lognormal,
<<Fit Loglogistic,
<<Fit Weibull,
<<Fit Exponential,
<<Fit Normal,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
SendToReport(
Dispatch( {}, "Compare Distributions", OutlineBox, {Close( 1 )} ),
Dispatch( {"Compare Distributions"}, "Life Distribution", FrameBox, {Grid Line Order( 7 ), Reference Line Order( 8 )} ),
Dispatch( {"Statistics", "Parametric Estimate - Lognormal"}, "Profilers", OutlineBox, {Close( 1 )} ),
Dispatch( {"Statistics", "Parametric Estimate - Loglogistic"}, "Profilers", OutlineBox, {Close( 1 )} ),
Dispatch( {"Statistics", "Parametric Estimate - Weibull"}, "Profilers", OutlineBox, {Close( 1 )} ),
Dispatch( {"Statistics", "Parametric Estimate - Exponential"}, "Profilers", OutlineBox, {Close( 1 )} ),
Dispatch( {"Statistics", "Parametric Estimate - Normal"}, "Profilers", OutlineBox, {Close( 1 )} )
)
);
rp = Report( ld );
pe = rp["Parametric Estimate - Lognormal"][Table Box( 1 )] << get as matrix;
cv = rp["Parametric Estimate - Lognormal"]["Covariance Matrix"][Table Box( 1 )] << get as matrix;
pe = rp["Parametric Estimate - Loglogistic"][Table Box( 1 )] << get as matrix;
cv = rp["Parametric Estimate - Loglogistic"]["Covariance Matrix"][Table Box( 1 )] << get as matrix;
pe = rp["Parametric Estimate - Weibull"][Table Box( 1 )] << get as matrix;
cv = rp["Parametric Estimate - Weibull"]["Covariance Matrix"][Table Box( 1 )] << get as matrix;
pe = rp["Parametric Estimate - Exponential"][Table Box( 1 )] << get as matrix;
cv = rp["Parametric Estimate - Exponential"]["Covariance Matrix"][Table Box( 1 )] << get as matrix;
pe = rp["Parametric Estimate - Normal"][Table Box( 1 )] << get as matrix;
cv = rp["Parametric Estimate - Normal"]["Covariance Matrix"][Table Box( 1 )] << get as matrix;
Code Explanation:
- Open data table.
- Create life distribution object.
- Set Y variables.
- Set frequency variable.
- Fit Lognormal distribution.
- Fit Loglogistic distribution.
- Fit Weibull distribution.
- Fit Exponential distribution.
- Fit Normal distribution.
- Extract parametric estimates and covariance matrices.
Example 121
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship, generating a report with lower confidence bounds.
Code:
::Expected = [6 6 0.00421644413211525 0.00189548743099973 0.00935269928766611,
12 24 0.005621925509487 0.00281394123913743 0.0112004769460989,
48 48 0.00702840086237316 0.00378571429284073 0.0130123590309347,
168 168 0.00876133559036203 0.00466790912632917 0.0163853145001895,
500 500 0.0111102423780626 0.00582017205669622 0.0211064836182172,
1000 1000 0.0183814905958986 0.00938076808425147 0.0357069985349881,
2000 2000 0.0263631589422419 0.0123696749526263 0.0553006991020271];
dt = Open("data_table.jmp");
obj = dt << Life Distribution( Y( :start time, :end time ), Freq( :count ), Interval Type( Pointwise ) );
rpt = obj << Report;
jtext = rpt << get journal;
Pat Match(
jtext,
Pat Arb() + "Nonparametric Pointwise Lower Confidence Bound" + Pat Arb() + "script" + Pat Arb() + "(" + Pat Arb() >? strnumber + "),)"
+ Pat Arb()
);
lower = Parse( strnumber );
Pat Match(
jtext,
Pat Arb() + "Nonparametric Pointwise Upper Confidence Bound" + Pat Arb() + "script" + Pat Arb() + "(" + Pat Arb() >? strnumber + "),)"
+ Pat Arb()
);
lower = Parse( strnumber );
Pat Match( jtext, "Data Marker" + Pat Arb() + "MarkerItem" + Pat Arb() + "x(" + Pat Arb() >? strnumber + ")" + Pat Arb() );
xdatapoint = Parse( "[" || strnumber || "]" );
Pat Match( jtext, "Data Marker" + Pat Arb() + "MarkerItem" + Pat Arb() + "y(" + Pat Arb() >? strnumber + ")" + Pat Arb() );
ydatapoint = Parse( "[" || strnumber || "]" );
datapoint = xdatapoint || ydatapoint;
datapoint = datapoint[Loc( Is Missing( xdatapoint ) == 0 & Is Missing( ydatapoint ) == 0 ), 0];
Code Explanation:
- Define expected values.
- Open data table.
- Create life distribution object.
- Generate report.
- Extract journal text.
- Find lower confidence bound script.
- Parse lower confidence bound value.
- Find upper confidence bound script.
- Parse upper confidence bound value.
- Extract and parse data points.
Example 122
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP, generating a report with confidence bounds and data markers.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution( Y( :start time, :end time ), Freq( :count ), Interval Type( Pointwise ) );
rpt = obj << Report;
jtext = rpt << get journal;
Pat Match(
jtext,
Pat Arb() + "Nonparametric Pointwise Lower Confidence Bound" + Pat Arb() + "script" + Pat Arb() + "(" + Pat Arb() >? strnumber + "),)"
+ Pat Arb()
);
lower = Parse( strnumber );
Pat Match(
jtext,
Pat Arb() + "Nonparametric Pointwise Upper Confidence Bound" + Pat Arb() + "script" + Pat Arb() + "(" + Pat Arb() >? strnumber + "),)"
+ Pat Arb()
);
lower = Parse( strnumber );
Pat Match( jtext, "Data Marker" + Pat Arb() + "MarkerItem" + Pat Arb() + "x(" + Pat Arb() >? strnumber + ")" + Pat Arb() );
xdatapoint = Parse( "[" || strnumber || "]" );
Pat Match( jtext, "Data Marker" + Pat Arb() + "MarkerItem" + Pat Arb() + "y(" + Pat Arb() >? strnumber + ")" + Pat Arb() );
ydatapoint = Parse( "[" || strnumber || "]" );
datapoint = xdatapoint || ydatapoint;
datapoint = datapoint[Loc( Is Missing( xdatapoint ) == 0 & Is Missing( ydatapoint ) == 0 ), 0];
Code Explanation:
- Open data table.
- Fit life distribution model.
- Generate report.
- Extract journal text.
- Match lower confidence bound pattern.
- Parse lower confidence bound value.
- Match upper confidence bound pattern.
- Parse upper confidence bound value.
- Match x data point pattern.
- Parse x data point value.
Example 123
Summary: Runs life distribution analysis using the Ramp Stress model, Weibull distribution, and Inverse Power relationship to perform cumulative damage analysis on a data table.
Code:
dt = Open("data_table.jmp");
obj = dt << Life Distribution(
Y( :Time ),
Censor( :Censor ),
Censor Code( 1 ),
<<Fit Weibull,
<<Fit Lognormal,
Confidence Interval Method( Wald ),
Show Quantile Functions( 1 ),
Interval Type( Pointwise )
);
rpt = obj << report;
Code Explanation:
- Open data table.
- Perform life distribution analysis.
- Specify time variable.
- Define censor variable.
- Set censor code.
- Fit Weibull distribution.
- Fit Lognormal distribution.
- Use Wald method for confidence intervals.
- Display quantile functions.
- Show pointwise intervals.
Example 124
Summary: Analyze cumulative damage using the Ramp Stress model, Weibull distribution, and Inverse Power relationship in JMP.
Code:
dt = Open("data_table.jmp");
lf = Life Distribution( Y( :Time Cycles ), Censor( :Censor ), Failure Cause( :Causes ), Failure Distribution by Cause( Weibull ) );
rp = Report( lf );
Code Explanation:
- Open data table;
- Create Life Distribution object.
- Set response variable.
- Specify censoring variable.
- Define failure cause variable.
- Choose Weibull distribution.
- Generate report object.
Distribution using Fit Model
Example 1
Summary: Opens a data table, fits a generalized linear model with Poisson distribution and log link function to predict satellite ratings based on color, spine, width, and weight effects.
Code:
// Model
// Open data table
dt = Open("data_table.jmp");
// Model
Fit Model(
Y( :satell ),
Effects(
:color, :spine, :width, :weight
),
Center Polynomials( 0 ),
Personality(
"Generalized Linear Model"
),
GLM Distribution( "Poisson" ),
Link Function( "Log" )
);
Code Explanation:
- Open table.
- Fit model.
- Specify response variable.
- Add effects.
- Disable centering.
- Choose personality.
- Set distribution.
- Select link function.
Example 2
Summary: Fits a Generalized Linear Model (GLM) for Y Simulated data, utilizing Binomial distribution and Logit link function.
Code:
// GLM for Y Simulated
// Open data table
dt = Open("data_table.jmp");
// GLM for Y Simulated
Fit Model(
Y( :Y Simulated ),
Effects(
:X1, :X2, :X3, :X4, :X5, :X6
),
Personality(
"Generalized Linear Model"
),
GLM Distribution( "Binomial" ),
Link Function( "Logit" ),
Run Model
);
Code Explanation:
- Open table.
- Fit Generalized Linear Model.
- Specify response variable.
- Add effects variables.
- Set personality to GLM.
- Choose Binomial distribution.
- Select Logit link function.
- Run the model.
Example 3
Summary: Fits a generalized linear model to analyze the relationship between response and predictor variables, utilizing a Normal distribution with Log link function.
Code:
// Model
// Open data table
dt = Open("data_table.jmp");
// Model
Fit Model(
Y( :Y ),
Effects( :X ),
Personality(
"Generalized Linear Model"
),
GLM Distribution( "Normal" ),
Link Function( "Log" ),
Overdispersion Tests and Intervals(
1
)
);
Code Explanation:
- Open data table.
- Fit generalized linear model.
- Set response variable.
- Add predictor variable.
- Choose personality.
- Specify distribution.
- Select link function.
- Enable overdispersion tests.
Example 4
Summary: Fits a parametric survival model to analyze execution time data, utilizing Weibull distribution and load as an effect variable.
Code:
// Parametric Survival Model
// Open data table
dt = Open("data_table.jmp");
// Parametric Survival Model
Fit Model(
Y( :ExecTime ),
Effects( :Load ),
Personality( "Parametric Survival" ),
Distribution( Weibull )
);
Code Explanation:
- Open data table.
- Fit parametric survival model.
- Set response variable.
- Add effect variable.
- Choose personality type.
- Select distribution.
Example 5
Summary: Fits a parametric survival model to analyze execution time data, estimating time quantiles and performing likelihood ratio tests.
Code:
// Fit Parametric Survival
// Open data table
dt = Open("data_table.jmp");
// Fit Parametric Survival
obj =
Fit Model(
Y( :ExecTime ),
Effects( :Load ),
Personality( "Parametric Survival" ),
Distribution( LogNormal ),
Run
);
obj << Likelihood Ratio Tests( 1 );
obj <<
Estimate Time Quantile(
:Load = 5,
[0.1],
Alpha( 0.05 )
);
Code Explanation:
- Open table.
- Fit parametric survival model.
- Set response variable.
- Add effect variable.
- Choose personality type.
- Select distribution.
- Run the model.
- Perform likelihood ratio tests.
- Estimate time quantiles.
- Set load value.
- Specify quantile level.
- Set confidence level.
Example 6
Summary: Fits a parametric survival model to analyze the relationship between the 'x' effect variable and the response variable 'Hours', while accounting for censoring and frequency, using JMP's Fit Model platform.
Code:
// Parametric Survival Model
// Open data table
dt = Open("data_table.jmp");
// Parametric Survival Model
Fit Model(
Weight( :Censor ),
Freq( :Weight ),
Y( :Hours ),
Censor( :Censor ),
Censor Code( 1 ),
Effects( :x ),
Personality( "Parametric Survival" ),
Distribution( LogNormal )
);
Code Explanation:
- Open data table.
- Define data table variable.
- Fit parametric survival model.
- Specify censoring weight.
- Specify frequency variable.
- Set response variable.
- Define censoring variable.
- Set censor code.
- Include effect variable.
- Choose personality type.
Example 7
Summary: Fits a Parametric Survival model to analyze the relationship between the effect variable and the response variable, utilizing LogNormal distribution and censoring.
Code:
// Fit Parametric Survival
// Open data table
dt = Open("data_table.jmp");
// Fit Parametric Survival
Fit Model(
Freq( :Weight ),
Y( :Hours ),
Effects( :x ),
Personality( "Parametric Survival" ),
Distribution( LogNormal ),
Censor( :Censor ),
Censor Code( 1 ),
Run(
Likelihood Ratio Tests( 1 ),
{
Estimate Survival Probability(
x = 40.9853,
[30000, 10000],
Alpha( 0.05 )
)}
)
);
Code Explanation:
- Open data table.
- Fit Parametric Survival model.
- Set frequency variable.
- Specify response variable.
- Add effect variable.
- Choose Parametric Survival personality.
- Select LogNormal distribution.
- Define censor variable.
- Set censor code.
- Run model with options.
Example 8
Summary: Fits a Parametric Survival model to analyze the relationship between the 'x' effect variable and the response variables 'HoursL' and 'HoursU', utilizing the LogNormal distribution.
Code:
// Fit Parametric Survival
// Open data table
dt = Open("data_table.jmp");
// Fit Parametric Survival
Fit Model(
Freq( :Count ),
Y( :HoursL, :HoursU ),
Effects( :x ),
Personality( "Parametric Survival" ),
Distribution( LogNormal ),
Run
);
Code Explanation:
- Open data table.
- Fit Parametric Survival model.
- Specify frequency column.
- Define response limits.
- Add effect variable.
- Set personality to Parametric Survival.
- Choose LogNormal distribution.
- Execute the model.
Example 9
Summary: Opens a data table and fits a parametric survival model with LogNormal distribution, specifying age and liquidity as effects variables.
Code:
// Model
// Open data table
dt = Open("data_table.jmp");
// Model
Fit Model(
Y( :YLow, :YHigh ),
Effects( :age, :liquidity ),
Personality( "Parametric Survival" ),
Distribution( LogNormal )
);
Code Explanation:
- Open data table.
- Fit parametric survival model.
- Set response variables.
- Specify effects variables.
- Choose personality type.
- Select distribution.
Example 10
Summary: Fits a parametric survival model to analyze the relationship between age and liquidity in a dataset, utilizing LogNormal distribution.
Code:
// Fit Parametric Survival
// Open data table
dt = Open("data_table.jmp");
// Fit Parametric Survival
Fit Model(
Y( :YLow, :YHigh ),
Effects( :age, :liquidity ),
Personality( "Parametric Survival" ),
Distribution( LogNormal ),
Run( Likelihood Ratio Tests( 1 ) )
);
Code Explanation:
- Open table.
- Fit Parametric Survival.
Example 11
Summary: Opens a data table, fits a generalized linear model with offset and Poisson distribution, and runs the model using Firth bias-adjusted estimates.
Code:
// Fit Model
// Open data table
dt = Open("data_table.jmp");
// Fit Model
Fit Model(
Offset( :Service ),
Y( :N ),
Effects(
:Type B, :Type C, :Type D,
:Type E, :Yr 65, :Yr 70, :Yr 75,
:Op 75
),
Personality(
"Generalized Linear Model"
),
GLM Distribution( "Poisson" ),
Link Function( "Log" ),
Overdispersion Tests and Intervals(
0
),
"Firth Bias-adjusted Estimates"n( 0 ),
Run
);
Code Explanation:
- Open data table.
- Fit model with offset.
- Set response variable.
- Define effects.
- Choose personality.
- Set distribution.
- Set link function.
- Disable overdispersion tests.
- Disable Firth bias adjustment.
- Run model.
Example 12
Summary: Fits a parametric survival model to analyze time-to-event data, utilizing Weibull distribution and likelihood ratio tests.
Code:
// Fit Parametric Survival
// Open data table
dt = Open("data_table.jmp");
// Fit Parametric Survival
Fit Model(
Y( :Time ),
Effects(
:Cell Type, :Treatment, :Prior,
:Age, :Diag Time, :KPS
),
Censor( :censor ),
Personality( "Parametric Survival" ),
Distribution( Weibull ),
Run( Likelihood Ratio Tests( 1 ) )
);
Code Explanation:
- Open data table.
- Define data table variable.
- Initiate Fit Model.
- Specify response variable.
- List effect variables.
- Define censoring variable.
- Set personality to Parametric Survival.
- Choose Weibull distribution.
- Run model.
- Perform likelihood ratio tests.
Example 13
Summary: Fits a model with specified effects, performing 5-fold cross-validation, and plotting criterion and R-square histories.
Code:
dt = Open("data_table.jmp");
Fit Model(
Y( :Y ),
Effects( :p1 & RS & Mixture, :p2 & RS & Mixture, :p3 & RS & Mixture, :p1 * :p2, :p1 * :p3, :p2 * :p3 ),
No Intercept,
Center Polynomials( 0 ),
Personality( "Stepwise" ),
Run( Name( "K-Fold Crossvalidation" )(5), Plot Criterion History( 1 ), Plot RSquare History( 1 ) ),
SendToReport(
Dispatch( {"Criterion History"}, "2", ScaleBox, {Format( "Custom", Formula( Char( Round( value / Pi(), 2 ) ) || " pi" ), 12 )} ),
Dispatch( {"RSquare History"}, "2", ScaleBox, {Format( "Custom", Formula( Round( Normal Distribution( value ), 2 ) ), 12 )} )
)
);
Code Explanation:
- Open data table;
- Fit model with Y as response.
- Include specified effects in model.
- Exclude intercept from model.
- Disable center polynomials.
- Use stepwise personality.
- Perform 5-fold cross-validation.
- Plot criterion history.
- Plot R-square history.
- Customize criterion history scale.
- Customize R-square history scale.
Example 14
Summary: Fits a Parametric Survival model to analyze ExecTime data, incorporating Load as an effect and Lognormal distribution.
Code:
dt = Open("data_table.jmp");
Fit Model(
Y( :ExecTime ),
Effects( :Load ),
Personality( "Parametric Survival" ),
Distribution( "Lognormal" ),
Run(
Likelihood Ratio Tests( 1 ),
Quantile Profiler(
1,
Confidence Intervals( 1 ),
Term Value( Load( 1.7724, Lock( 0 ), Show( 1 ) ), Failure Probability( 0.1, Lock( 0 ), Show( 1 ) ) )
),
Distribution Profiler(
1,
Confidence Intervals( 1 ),
Term Value( Load( 1.7724, Lock( 0 ), Show( 1 ) ), Time( 251, Lock( 0 ), Show( 1 ) ) )
)
),
SendToReport(
Dispatch( {"Plot Survival Quantiles"}, "1", ScaleBox, {Format( "Custom", Formula( "log(" || Char( 10 ^ value ) || ")" ), 12 )} ),
Dispatch( {"Plot Survival Quantiles"}, "2", ScaleBox,
{Format( "Custom", Formula( "10^" || Char( Round( Log10( value ), 2 ) ) ), 9 )}
)
)
);
Code Explanation:
- Open data table;
- Fit Parametric Survival model.
- Set response variable "ExecTime".
- Include effect "Load".
- Use Lognormal distribution.
- Perform Likelihood Ratio Tests.
- Generate Quantile Profiler.
- Enable Confidence Intervals.
- Set Load term value.
- Set Failure Probability.
Example 15
Summary: Fits a parametric survival model to a data table, generating distribution plots by level combinations and running likelihood ratio tests.
Code:
dt under test = Open("data_table.jmp");
obj = Fit Model(
Freq( :Weight ),
Y( :Hours ),
Effects( :x ),
Personality( Parametric Survival ),
Distribution( LogNormal ),
Run( Likelihood Ratio Tests( 1 ), Distribution Plot by Level Combinations( 1 ) ),
SendToReport(
Dispatch( {}, "Parametric Survival Fit", OutlineBox,
{Set Title( "Parametric Survival Fit - Testing, see Distrib Plots near bottom" )}
),
Dispatch( {}, "Distribution Plot by Level Combinations", OutlineBox,
{Set Title(
"Distribution Plot by Level Combinations - Testing, these 3 plots are related, interactive (tooltips), Lognormal scale"
)}
)
)
);
Code Explanation:
- Open data table.
- Define data table variable.
- Fit parametric survival model.
- Specify frequency column.
- Set response variable.
- Include effect variable.
- Choose personality type.
- Select distribution.
- Run likelihood ratio tests.
- Generate distribution plot.
Example 16
Summary: Fits a generalized linear model with binomial distribution and logit link function to analyze the relationship between Number Popped, Total Kernels, Brand, Time, and Power.
Code:
dt under test = Open("data_table.jmp");
obj = Fit Model(
Y( :Number Popped, :Total Kernels ),
Effects( :Brand, :Time, :Power, :Brand * :Time, :Brand * :Power, :Time * :Power, :Time * :Time, :Power * :Power ),
Personality( Generalized Linear Model ),
GLM Distribution( Binomial ),
Link Function( Logit ),
Overdispersion Tests and Intervals( 0 ),
Name( "Firth Bias-adjusted Estimates" )(0),
Run(
Correlation of Estimates( 1 ),
Covariance of Estimates( 1 ),
Studentized Pearson Residuals by Predicted( 1 ),
Deviance Residuals by Predicted( 1 ),
Pearson Residuals by Predicted( 1 ),
1,
Profiler(
1,
Confidence Intervals( 1 ),
Profile at Boundary( "Stop at Boundaries" ),
Term Value( Brand( "Top Secret", Lock( 0 ), Show( 1 ) ), Time( 4, Lock( 0 ), Show( 1 ) ), Power( 7.5, Lock( 0 ), Show( 1 ) ) )
)
)
);
Code Explanation:
- Open data table.
- Define response variables.
- Specify model effects.
- Choose generalized linear model personality.
- Set binomial distribution.
- Use logit link function.
- Disable overdispersion tests.
- Disable Firth bias adjustment.
- Request correlation matrix.
- Request covariance matrix.
- Plot studentized Pearson residuals.
- Plot deviance residuals.
- Plot Pearson residuals.
- Enable profiler.
- Display confidence intervals.
- Set boundary profile.
- Set term values for profiling.
Example 17
Summary: Performs a parametric survival analysis to model the relationship between Load and ExecTime, generating a LogNormal distribution and performing various diagnostic checks.
Code:
dt under test = Open("data_table.jmp");
obj = Fit Model(
Y( :ExecTime ),
Effects( :Load ),
Personality( Parametric Survival ),
Distribution( LogNormal ),
Run(
Likelihood Ratio Tests( 1 ),
Confidence Intervals( 1 ),
Correlation of Estimates( 1 ),
Covariance of Estimates( 1 ),
Residual Quantile Plot( 1 ),
Quantile Profiler(
1,
Confidence Intervals( 1 ),
Term Value( Load( 1.7724, Min( 0.05 ), Max( 6 ), Lock( 0 ), Show( 1 ) ), Failure Probability( 0.1, Lock( 0 ), Show( 1 ) ) )
),
Distribution Profiler(
1,
Confidence Intervals( 1 ),
Term Value( Load( 1.7724, Min( 0.05 ), Max( 6 ), Lock( 0 ), Show( 1 ) ), Time( 251, Lock( 0 ), Show( 1 ) ) )
),
{Estimate Time Quantile( Load = [5], [0.1], Alpha( 0.05 ) )}
),
);
Code Explanation:
- Open data table.
- Define model with
ExecTimeas response. - Include
Loadas effect. - Use Parametric Survival personality.
- Set distribution to LogNormal.
- Run model with specified options.
- Perform likelihood ratio tests.
- Calculate confidence intervals.
- Display correlation of estimates.
- Show covariance of estimates.
- Generate residual quantile plot.
- Create quantile profiler with options.
- Produce distribution profiler with settings.
- Estimate time quantile for specific parameters.
Example 18
Summary: Fits a parametric survival model to analyze the relationship between weight and hours, with interactive distribution plots and likelihood ratio tests.
Code:
dt under test = Open("data_table.jmp");
obj = Fit Model(
Freq( :Weight ),
Y( :Hours ),
Effects( :x ),
Personality( Parametric Survival ),
Distribution( LogNormal ),
Run( Likelihood Ratio Tests( 1 ), Distribution Plot by Level Combinations( 1 ) ),
SendToReport(
Dispatch( {}, "Whole Model Test", OutlineBox, {Close( 1 )} ),
Dispatch( {}, "Parameter Estimates", OutlineBox, {Close( 1 )} ),
Dispatch( {}, "Effect Likelihood Ratio Tests", OutlineBox, {Close( 1 )} ),
Dispatch( {}, "Plot Survival Quantiles", OutlineBox, {Close( 1 )} ),
Dispatch( {"Distribution Plot by Level Combinations"}, "Separate Location and Scale", OutlineBox, {Close( 1 )} ),
Dispatch( {"Distribution Plot by Level Combinations"}, "Regression", OutlineBox, {Close( 1 )} )
)
);
Code Explanation:
- Open data table.
- Define data table variable.
- Fit parametric survival model.
- Set frequency column.
- Specify response variable.
- Add effect variable.
- Choose LogNormal distribution.
- Run likelihood ratio tests.
- Generate distribution plot.
- Close unnecessary reports.
Example 19
Summary: Runs a logistic regression analysis to predict marital status based on age, country, and size, with confidence intervals and term values.
Code:
Open("data_table.jmp");
Fit Model(
Y( :marital status ),
Effects( :age, :country, :size ),
Target Level( "Single" ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Binomial" ),
Run(
Fit(
Estimation Method( Logistic Regression ),
Validation Method( None ),
Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
age( 40, Lock( 0 ), Show( 1 ) ),
country( "American", Lock( 0 ), Show( 1 ) ),
size( "Large", Lock( 0 ), Show( 1 ) )
)
)
)
),
SendToReport(
Dispatch( {}, "Model Launch", OutlineBox, {Close( 0 )} ),
Dispatch( {"Logistic Regression"}, "Model Summary", OutlineBox, {Close( 1 )} ),
Dispatch( {"Logistic Regression"}, "Parameter Estimates for Original Predictors", OutlineBox, {Close( 1 )} )
)
);
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set response variable: "marital status".
- Include effects: age, country, size.
- Define target level as "Single".
- Choose Generalized Regression personality.
- Specify Binomial distribution.
- Run model with Logistic Regression.
- Disable validation method.
- Create profiler with confidence intervals.
Example 20
Summary: Fits a generalized regression model with multinomial distribution to analyze the relationship between drug response and patient characteristics, utilizing maximum likelihood estimation.
Code:
Open("data_table.jmp");
Fit Model(
Y( :drug ),
Effects( :gender, :pain ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Multinomial" ),
Run(
Fit(
Estimation Method( Maximum Likelihood ),
Validation Method( None ),
Profiler( 1, Term Value( gender( "female", Lock( 0 ), Show( 1 ) ), pain( 6.87, Lock( 0 ), Show( 1 ) ) ) )
)
),
SendToReport(
Dispatch( {}, "Model Launch", OutlineBox, {Close( 0 )} ),
Dispatch( {"Multinomial Maximum Likelihood"}, "Model Summary", OutlineBox, {Close( 1 )} ),
Dispatch( {"Multinomial Maximum Likelihood"}, "Parameter Estimates for Original Predictors", OutlineBox, {Close( 1 )} )
)
);
Code Explanation:
- Open table.
- Fit model with specified parameters.
- Set response variable.
- Define effects.
- Choose personality.
- Select distribution.
- Run fit with options.
- Use maximum likelihood estimation.
- Disable validation method.
- Generate profiler with settings.
Example 21
Summary: Fits a generalized regression model using Multinomial distribution to analyze the relationship between Manufacturer and Calories fr Fat, Potassium, Enriched.
Code:
Open("data_table.jmp");
Fit Model(
Y( :Manufacturer ),
Effects( :Calories fr Fat, :Potassium, :Enriched ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Multinomial" ),
Run(
Fit(
Estimation Method( Maximum Likelihood ),
Validation Method( None ),
Profiler(
1,
Term Value(
Calories fr Fat( 28.69, Lock( 0 ), Show( 1 ) ),
Potassium( 337.7, Lock( 0 ), Show( 1 ) ),
Enriched( 20, Lock( 0 ), Show( 1 ) )
)
)
)
),
SendToReport(
Dispatch( {}, "Model Comparison", OutlineBox, {Close( 1 )} ),
Dispatch( {"Multinomial Maximum Likelihood"}, "Model Summary", OutlineBox, {Close( 1 )} ),
Dispatch( {"Multinomial Maximum Likelihood"}, "Parameter Estimates for Original Predictors", OutlineBox, {Close( 1 )} )
)
);
Code Explanation:
- Open data table;
- Fit model using Generalized Regression.
- Set response variable as Manufacturer.
- Include Calories fr Fat, Potassium, Enriched as effects.
- Use Multinomial distribution.
- Run model with Maximum Likelihood estimation.
- No validation method specified.
- Generate profiler with term values.
- Lock and show term values in profiler.
- Close Model Comparison, Model Summary, and Parameter Estimates reports.
Example 22
Summary: Fits a generalized regression model with multinomial distribution and Lasso estimation, utilizing AICc validation method to optimize model performance.
Code:
Open("data_table.jmp");
Fit Model(
Y( :Time ),
Effects( :Month, :"AM/PM"n, :Days ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Multinomial" ),
Run(
Fit(
Estimation Method( Lasso ),
Validation Method( AICc ),
Profiler(
1,
Term Value(
Month( "April", Lock( 0 ), Show( 1 ) ),
"AM/PM"n( "AM", Lock( 0 ), Show( 1 ) ),
Days( 26.92, Lock( 0 ), Show( 1 ) )
)
)
)
),
SendToReport(
Dispatch( {"Multinomial Lasso with AICc Validation"}, "Model Summary", OutlineBox, {Close( 1 )} ),
Dispatch( {"Multinomial Lasso with AICc Validation"}, "Solution Path", OutlineBox, {Close( 1 )} ),
Dispatch( {"Multinomial Lasso with AICc Validation"}, "Parameter Estimates for Original Predictors", OutlineBox, {Close( 1 )} )
)
);
Code Explanation:
- Open data_table data
- Fit generalized regression model.
- Set response variable.
- Specify model effects.
- Choose multinomial distribution.
- Run fit with Lasso estimation.
- Use AICc validation method.
- Generate profiler report.
- Set term values in profiler.
- Close unnecessary report sections.
Example 23
Summary: Fits a generalized regression model with multinomial distribution to analyze the relationship between Size Co, Type, # Employees, Assets, and %profit/sales.
Code:
Open("data_table.jmp");
Fit Model(
Y( :Size Co ),
Effects( :Type, :"# Employees"n, :"profit/emp"n, :Assets, :"%profit/sales"n ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Multinomial" ),
Run(
Fit(
Estimation Method( Maximum Likelihood ),
Validation Method( None ),
Profiler(
1,
Term Value(
Type( "Computer", Lock( 0 ), Show( 1 ) ),
"# Employees"n( 38230, Lock( 0 ), Show( 1 ) ),
"profit/emp"n( 24900, Lock( 0 ), Show( 1 ) ),
Assets( 5942, Lock( 0 ), Show( 1 ) ),
"%profit/sales"n( 5.223, Lock( 0 ), Show( 1 ) )
)
)
)
),
SendToReport(
Dispatch( {}, "Model Comparison", OutlineBox, {Close( 1 )} ),
Dispatch( {"Multinomial Maximum Likelihood"}, "Model Summary", OutlineBox, {Close( 1 )} ),
Dispatch( {"Multinomial Maximum Likelihood"}, "Parameter Estimates for Original Predictors", OutlineBox, {Close( 1 )} )
)
);
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set response variable.
- Define effect variables.
- Choose multinomial distribution.
- Run model fit.
- Use maximum likelihood estimation.
- Disable validation method.
- Enable profiler.
- Set term values and show them.
Example 24
Summary: Fits a generalized regression model to analyze the relationship between Analysis, Discoveries, OS, and Age, utilizing Maximum Likelihood estimation and Multinomial distribution.
Code:
Open("data_table.jmp");
Fit Model(
Y( :Analysis ),
Effects( :Discoveries, :OS, :Age ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Multinomial" ),
Run(
Fit(
Estimation Method( Maximum Likelihood ),
Validation Method( None ),
Profiler(
1,
Term Value(
Discoveries( "2-4", Lock( 0 ), Show( 1 ) ),
OS( "Both", Lock( 0 ), Show( 1 ) ),
Age( "20s", Lock( 0 ), Show( 1 ) )
)
)
)
),
SendToReport(
Dispatch( {}, "Model Comparison", OutlineBox, {Close( 1 )} ),
Dispatch( {"Multinomial Maximum Likelihood"}, "Model Summary", OutlineBox, {Close( 1 )} ),
Dispatch( {"Multinomial Maximum Likelihood"}, "Parameter Estimates for Original Predictors", OutlineBox, {Close( 1 )} )
)
);
Code Explanation:
- Open data table;
- Fit model using Generalized Regression.
- Set response variable to Analysis.
- Include Discoveries, OS, Age as effects.
- Specify Multinomial distribution.
- Use Maximum Likelihood estimation method.
- Disable validation method.
- Enable profiler with specific term values.
- Lock and show Discovery level "2-4".
- Lock and show OS level "Both".
- Lock and show Age level "20s".
- Close Model Comparison report.
- Close Model Summary report.
- Close Parameter Estimates report.
Example 25
Summary: Fits a generalized regression model to predict Age using Subject, Gender, and Growth as effects, with Elastic Net estimation and AICc validation.
Code:
Open("data_table.jmp") << Fit Model(
Y( :Age ),
Effects( :Subject, :Gender, :Growth ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Multinomial" ),
Run(
Fit(
Estimation Method( Elastic Net( Adaptive ) ),
Validation Method( AICc ),
Profiler(
1,
Term Value(
Subject( "21", Lock( 0 ), Show( 1 ) ),
Gender( "F", Lock( 0 ), Show( 0 ) ),
Growth( 24.023, Lock( 0 ), Show( 1 ) )
)
)
)
)
);
Code Explanation:
- Open data_table data
- Fit model to data.
- Set response variable.
- Define model effects.
- Choose Generalized Regression personality.
- Specify Multinomial distribution.
- Run model fitting.
- Use Elastic Net estimation.
- Validate using AICc.
- Generate profiler.
Example 26
Summary: Fits a generalized regression model to predict Genre based on specified effects, utilizing Maximum Likelihood estimation and generating a profiler report.
Code:
Open("data_table.jmp") << Fit Model(
Y( :Genre ),
Effects( :Rotten Tomatoes Score, :Audience Score, :Theaters Opening Wknd, :Production Budget, :Profitability ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Multinomial" ),
Run(
Fit(
Estimation Method( Maximum Likelihood ),
Validation Method( None ),
Profiler(
1,
Term Value(
Rotten Tomatoes Score( 52.134, Lock( 0 ), Show( 1 ) ),
Audience Score( 61.402, Lock( 0 ), Show( 1 ) ),
Theaters Opening Wknd( 2878.6, Lock( 0 ), Show( 1 ) ),
Production Budget( 61.24, Lock( 0 ), Show( 1 ) ),
Profitability( 3.658, Lock( 0 ), Show( 1 ) )
)
)
)
),
SendToReport( Dispatch( {}, "Model Launch", OutlineBox, {Close( 0 )} ) )
);
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set response variable to Genre.
- Include specified effects in model.
- Choose Generalized Regression personality.
- Select Multinomial distribution.
- Run the model.
- Fit using Maximum Likelihood method.
- No validation method applied.
- Generate Profiler report.
Example 27
Summary: Generalized regression analysis with Lasso estimation and AICc validation on the specified data table, utilizing Multinomial distribution and interactive profiling.
Code:
Open("data_table.jmp") << Fit Model(
Y( :Causality ),
Effects( :Body System or Organ Class, :"Severity/Intensity"n, :Serious Event, :Age, :Sex, :Race ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Multinomial" ),
Run(
Fit(
Estimation Method( Lasso ),
Validation Method( AICc ),
Profiler(
1,
Term Value(
Body System or Organ Class( "BLOOD AND LYMPHATIC SYSTEM DISORDERS", Lock( 0 ), Show( 1 ) ),
"Severity/Intensity"n( "MILD", Lock( 0 ), Show( 1 ) ),
Serious Event( "N", Lock( 0 ), Show( 1 ) ),
Age( 51.972, Lock( 0 ), Show( 1 ) ),
Sex( "F", Lock( 0 ), Show( 1 ) ),
Race( "WHITE", Lock( 0 ), Show( 1 ) )
)
)
)
)
);
Code Explanation:
- Open data table;
- Launch Fit Model platform.
- Set response variable.
- Specify model effects.
- Choose Generalized Regression personality.
- Select Multinomial distribution.
- Run the model fit.
- Use Lasso estimation method.
- Validate using AICc.
- Generate Profiler.
Example 28
Summary: Fits a generalized regression model with multinomial distribution to a data table, utilizing Maximum Likelihood and Lasso estimation methods, and generates reports for model summaries and parameter estimates.
Code:
Open("data_table.jmp");
Fit Model(
Y( :Date ),
Effects( :Vat, :Time, :Acid ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Multinomial" ),
Run(
Fit(
Estimation Method( Maximum Likelihood ),
Validation Method( None ),
Profiler(
1,
Term Value(
Vat( 12.5, Lock( 0 ), Show( 1 ) ),
Time( "1:00:00", Lock( 0 ), Show( 1 ) ),
Acid( 10.5667, Lock( 0 ), Show( 1 ) )
)
)
),
Fit(
Estimation Method( Lasso ),
Validation Method( AICc ),
Profiler(
1,
Term Value(
Vat( 15.96, Lock( 0 ), Show( 1 ) ),
Time( "2:00:00", Lock( 0 ), Show( 1 ) ),
Acid( 10.5667, Lock( 0 ), Show( 1 ) )
)
)
)
),
SendToReport(
Dispatch( {"Multinomial Maximum Likelihood"}, "Model Summary", OutlineBox, {Close( 1 )} ),
Dispatch( {"Multinomial Maximum Likelihood"}, "Parameter Estimates for Original Predictors", OutlineBox, {Close( 1 )} ),
Dispatch( {"Multinomial Lasso with AICc Validation"}, "Model Summary", OutlineBox, {Close( 1 )} ),
Dispatch( {"Multinomial Lasso with AICc Validation"}, "Solution Path", OutlineBox, {Close( 1 )} ),
Dispatch( {"Multinomial Lasso with AICc Validation"}, "Parameter Estimates for Original Predictors", OutlineBox, {Close( 1 )} )
)
);
Code Explanation:
- Open data table;
- Fit model with specified parameters.
- Set response variable.
- Define effects variables.
- Choose Generalized Regression personality.
- Specify Multinomial distribution.
- Run first fit using Maximum Likelihood.
- Configure profiler settings.
- Set term values for first fit.
- Run second fit using Lasso method.
- Configure profiler settings for second fit.
- Set term values for second fit.
- Close unnecessary report sections.
Example 29
Summary: Fits a generalized regression model with specified effects, using Lasso estimation and AICc validation, and generates a profiler for term values.
Code:
Open("data_table.jmp") << Fit Model(
Y( :Carcass ),
Effects( :Pattern, :Tenderizer, :Roasting Time, :Y ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Multinomial" ),
Run(
Fit(
Estimation Method( Lasso ),
Validation Method( AICc ),
Profiler(
1,
Term Value(
Pattern( "111", Lock( 0 ), Show( 0 ) ),
Tenderizer( "Control", Lock( 0 ), Show( 0 ) ),
Roasting Time( "30", Lock( 0 ), Show( 0 ) ),
Y( 4.7778, Lock( 0 ), Show( 0 ) )
)
)
)
)
);
Code Explanation:
- Open data table;
- Fit model with specified effects.
- Use Generalized Regression personality.
- Set distribution to Multinomial.
- Run the fit with specified options.
- Use Lasso estimation method.
- Validate using AICc.
- Create profiler for the model.
- Configure term values for variables.
- Lock and hide specified terms in profiler.
Example 30
Summary: Fits a generalized regression model with Multinomial distribution to analyze Cell Type data, incorporating Treatment, Prior, Age, and Diag Time effects.
Code:
Open("data_table.jmp") << Fit Model(
Y( :Cell Type ),
Effects( :Treatment, :Prior, :Age, :Diag Time ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Multinomial" ),
Run(
Fit(
Estimation Method( Maximum Likelihood ),
Validation Method( None ),
Profiler(
1,
Term Value(
Treatment( "Standard", Lock( 0 ), Show( 1 ) ),
Prior( "No", Lock( 0 ), Show( 1 ) ),
Age( 59.017, Lock( 0 ), Show( 1 ) ),
Diag Time( 8.317, Lock( 0 ), Show( 1 ) )
)
)
)
),
SendToReport( Dispatch( {}, "Model Launch", OutlineBox, {Close( 0 )} ) )
);
Code Explanation:
- Open data table;
- Fit model with specified variables.
- Set response variable: Cell Type.
- Include effects: Treatment, Prior, Age, Diag Time.
- Use Generalized Regression personality.
- Specify Multinomial distribution.
- Run fit with Maximum Likelihood estimation.
- Disable validation method.
- Create profiler for model.
- Close model launch outline box in report.
Example 31
Summary: Fits a generalized regression model with ordinal logistic distribution to analyze the relationship between Age Group, Salary, Job Satisfaction, and Career focus.
Code:
Open("data_table.jmp") << Fit Model(
Y( :Age Group ),
Effects( :Salary, :Job Satisfaction, :I am working on my career ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Ordinal Logistic" ),
Run(
Fit(
Estimation Method( Maximum Likelihood ),
Validation Method( None ),
Profiler(
1,
Term Value(
Salary( 57980, Lock( 0 ), Show( 1 ) ),
Job Satisfaction( 1, Lock( 0 ), Show( 1 ) ),
I am working on my career( 1, Lock( 0 ), Show( 1 ) )
)
)
)
),
SendToReport( Dispatch( {}, "Model Launch", OutlineBox, {Close( 0 )} ) )
);
Code Explanation:
- Open data table.
- Fit model with specified parameters.
- Set response variable: Age Group.
- Define effects: Salary, Job Satisfaction, Career focus.
- Choose Generalized Regression personality.
- Select Ordinal Logistic distribution.
- Run the model fit.
- Use Maximum Likelihood estimation method.
- Configure profiler settings.
- Close Model Launch outline box.
Example 32
Summary: Fits a generalized regression model with an ordinal logistic distribution to predict the Number of Fillings, using the Brush and Floss variables as effects.
Code:
Open("data_table.jmp") << Fit Model(
Y( :Number of Fillings ),
Effects(
:Brush, :Floss, :Brush After Waking Up, :Brush After Meal, :Brush Before Sleep, :Brush Another Time, :Floss After Waking Up,
:Floss After Meal, :Floss Before Sleep, :Floss Another Time, :Frequency of Teeth Cleaning
),
Personality( "Generalized Regression" ),
Generalized Distribution( "Ordinal Logistic" ),
Run(
Fit(
Estimation Method( Maximum Likelihood ),
Validation Method( None ),
Profiler(
1,
Arrange in Rows( 4 ),
Term Value(
Brush( 1, Lock( 0 ), Show( 1 ) ),
Floss( 1, Lock( 0 ), Show( 1 ) ),
Brush After Waking Up( 0, Lock( 0 ), Show( 1 ) ),
Brush After Meal( 0, Lock( 0 ), Show( 1 ) ),
Brush Before Sleep( 0, Lock( 0 ), Show( 1 ) ),
Brush Another Time( 0.0179, Lock( 0 ), Show( 1 ) ),
Floss After Waking Up( 0.3147, Lock( 0 ), Show( 1 ) ),
Floss After Meal( 0.3705, Lock( 0 ), Show( 1 ) ),
Floss Before Sleep( 0.529, Lock( 0 ), Show( 1 ) ),
Floss Another Time( 0.0603, Lock( 0 ), Show( 1 ) ),
Frequency of Teeth Cleaning( 1, Lock( 0 ), Show( 1 ) )
)
)
)
),
SendToReport( Dispatch( {}, "Model Launch", OutlineBox, {Close( 0 )} ) )
);
Code Explanation:
- Open data table;
- Fit Model dialog initiated.
- Set response variable: Number of Fillings.
- Add effects variables.
- Choose Generalized Regression personality.
- Select Ordinal Logistic distribution.
- Run model with Maximum Likelihood estimation.
- Disable validation method.
- Open Profiler with 4 rows arrangement.
- Configure term values for each effect.
- Close Model Launch outline box in report.
Example 33
Summary: Fits an ordinal logistic model to a data table, incorporating age, gender, BMI, BP, and total cholesterol as effects, with maximum likelihood estimation and profiling.
Code:
dt = Open("data_table.jmp");
Fit Model(
Y( :Y Ordinal ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Ordinal Logistic" ),
Run(
Fit(
Estimation Method( Maximum Likelihood ),
Validation Method( None ),
Profiler(
1,
Term Value(
Age( 48.518, Lock( 0 ), Show( 1 ) ),
Gender( 1, Lock( 0 ), Show( 1 ) ),
BMI( 26.376, Lock( 0 ), Show( 1 ) ),
BP( 94.647, Lock( 0 ), Show( 1 ) ),
Total Cholesterol( 189.14, Lock( 0 ), Show( 1 ) )
)
)
)
),
SendToReport( Dispatch( {}, "Model Launch", OutlineBox, {Close( 0 )} ) )
);
Code Explanation:
- Open data table;
- Fit model with ordinal logistic distribution.
- Use age, gender, BMI, BP, and cholesterol as effects.
- Set estimation method to maximum likelihood.
- Disable validation method.
- Enable profiler.
- Set initial term values for each predictor.
- Display all terms in profiler.
- Close model launch outline box in report.
Example 34
Summary: Fits an ordinal logistic regression model with Lasso regularization and AICc validation, utilizing Generalized Regression personality.
Code:
Open("data_table.jmp");
Fit Model(
Y( :Internet Use ),
Effects( :Female, :Privacy_2, :Reput_4, :Security_2, :Trust_1, :Privacy_3, :Trust_3, :Reput_1 ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Ordinal Logistic" ),
Run(
Fit(
Estimation Method( Maximum Likelihood ),
Validation Method( None ),
Profiler(
1,
Term Value(
Female( 0, Lock( 0 ), Show( 1 ) ),
Privacy_2( 3.0961, Lock( 0 ), Show( 1 ) ),
Reput_4( 3.0652, Lock( 0 ), Show( 1 ) ),
Security_2( 3.5065, Lock( 0 ), Show( 1 ) ),
Trust_1( 2.6418, Lock( 0 ), Show( 1 ) ),
Privacy_3( 3.1447, Lock( 0 ), Show( 1 ) ),
Trust_3( 2.5433, Lock( 0 ), Show( 1 ) ),
Reput_1( 3.4033, Lock( 0 ), Show( 1 ) )
)
)
),
Fit(
Estimation Method( Lasso ),
Validation Method( AICc ),
Profiler(
1,
Term Value(
Female( 0, Lock( 0 ), Show( 1 ) ),
Privacy_2( 4.06, Lock( 0 ), Show( 1 ) ),
Reput_4( 3.0652, Lock( 0 ), Show( 1 ) ),
Security_2( 3.28, Lock( 0 ), Show( 1 ) ),
Trust_1( 2.6418, Lock( 0 ), Show( 1 ) ),
Privacy_3( 3.1447, Lock( 0 ), Show( 0 ) ),
Trust_3( 2.5433, Lock( 0 ), Show( 1 ) ),
Reput_1( 3.4033, Lock( 0 ), Show( 1 ) )
)
)
)
),
SendToReport(
Dispatch( {"Ordinal Logistic Lasso with AICc Validation"}, "Model Summary", OutlineBox, {Close( 1 )} ),
Dispatch( {"Ordinal Logistic Lasso with AICc Validation"}, "Estimation Details", OutlineBox, {Close( 1 )} ),
Dispatch( {"Ordinal Logistic Lasso with AICc Validation"}, "Solution Path", OutlineBox, {Close( 1 )} ),
Dispatch( {"Ordinal Logistic Lasso with AICc Validation"}, "Parameter Estimates for Original Predictors", OutlineBox,
{Close( 1 )}
)
)
);
Code Explanation:
- Open data table.
- Define model with response.
- Specify effects for predictors.
- Choose Generalized Regression personality.
- Set Ordinal Logistic distribution.
- Run first fit with Maximum Likelihood.
- Configure Profiler settings.
- Run second fit with Lasso method.
- Use AICc for validation.
- Adjust Profiler settings.
Example 35
Summary: Fits an Ordinal Logistic model with Lasso estimation and AICc validation to a data table, utilizing Generalized Regression personality.
Code:
Open("data_table.jmp");
Fit Model(
Y( :YearWeek ),
Effects( :Date, :Open, :High, :Low, :Close, :Volume, :"Adj. Close*"n ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Ordinal Logistic" ),
Run(
Fit(
Estimation Method( Lasso ),
Validation Method( AICc ),
Profiler(
1,
Term Value(
Date( 3058577000, Lock( 0 ), Show( 1 ) ),
Open( 34.45, Lock( 0 ), Show( 1 ) ),
High( 41.236, Lock( 0 ), Show( 0 ) ),
Low( 38.177, Lock( 0 ), Show( 0 ) ),
Close( 39.513, Lock( 0 ), Show( 0 ) ),
Volume( 69940000, Lock( 0 ), Show( 0 ) ),
"Adj. Close*"n( 39.513, Lock( 0 ), Show( 0 ) )
)
)
)
),
SendToReport(
Dispatch( {"Ordinal Logistic Lasso with AICc Validation"}, "Model Summary", OutlineBox, {Close( 1 )} ),
Dispatch( {"Ordinal Logistic Lasso with AICc Validation"}, "Estimation Details", OutlineBox, {Close( 1 )} ),
Dispatch( {"Ordinal Logistic Lasso with AICc Validation"}, "Solution Path", OutlineBox, {Close( 1 )} ),
Dispatch( {"Ordinal Logistic Lasso with AICc Validation"}, "Parameter Estimates for Original Predictors", OutlineBox,
{Close( 1 )}
)
)
);
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set YearWeek as response variable.
- Include multiple predictors.
- Choose Generalized Regression personality.
- Select Ordinal Logistic distribution.
- Run model with specified settings.
- Use Lasso estimation method.
- Validate using AICc method.
- Generate profiler with initial settings.
Example 36
Summary: Fits a Generalized Regression model to predict Passenger Class using Ordinal Logistic distribution, incorporating effects from Name, Sex, Age, and Fare, with Lasso estimation method and AICc validation.
Code:
Open("data_table.jmp") << Fit Model(
Y( :Passenger Class ),
Effects( :Name, :Sex, :Age, :Fare ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Ordinal Logistic" ),
Run(
Fit(
Estimation Method( Lasso ),
Validation Method( AICc ),
Profiler(
1,
Term Value( "Name"n( "Abbing, Mr. Anthony" ), Lock( 0 ), Show( 0 ) ),
Sex( "female", Lock( 0 ), Show( 0 ) ),
Age( 29.852, Lock( 0 ), Show( 1 ) ),
Fare( 36.69, Lock( 0 ), Show( 1 ) )
)
)
)
);
Code Explanation:
- Open data table;
- Fit Generalized Regression model.
- Set response variable: Passenger Class.
- Include effects: Name, Sex, Age, Fare.
- Use Ordinal Logistic distribution.
- Run the fit model.
- Estimate using Lasso method.
- Validate using AICc method.
- Create a profiler.
- Configure profiler settings.
Example 37
Summary: Fits a generalized linear model to predict body fat percentage using multiple predictor variables, with profiler settings for confidence intervals and term values.
Code:
Open("data_table.jmp");
obj = Fit Model(
Y( :Percent body fat ),
Effects(
:Name( "Weight (lbs)" ), :Name( "Abdomen circumference (cm)" ), :Name( "Forearm circumference (cm)" ),
:Name( "Wrist circumference (cm)" )
),
Personality( "Generalized Linear Model" ),
GLM Distribution( "Normal" ),
Link Function( "Identity" ),
Overdispersion Tests and Intervals( 0 ),
Name( "Firth Bias-adjusted Estimates" )(0),
Run(
1,
Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
Name( "Weight (lbs)" )(178.92, Lock( 0 ), Show( 1 )),
Name( "Abdomen circumference (cm)" )(92.556, Lock( 0 ), Show( 1 )),
Name( "Forearm circumference (cm)" )(28.664, Lock( 0 ), Show( 1 )),
Name( "Wrist circumference (cm)" )(18.2298, Lock( 0 ), Show( 1 ))
)
)
),
SendToReport(
Dispatch( {}, "Whole Model Test", OutlineBox, {Close( 1 )} ),
Dispatch( {}, "Effect Summary", OutlineBox, {Close( 1 )} ),
Dispatch( {}, "Effect Tests", OutlineBox, {Close( 1 )} ),
Dispatch( {}, "Parameter Estimates", OutlineBox, {Close( 1 )} ),
Dispatch( {}, "Studentized Deviance Residual by Predicted", OutlineBox, {Close( 1 )} )
)
);
Code Explanation:
- Open data table.
- Fit generalized linear model.
- Set response variable.
- Define predictor effects.
- Specify normal distribution.
- Use identity link function.
- Disable overdispersion tests.
- Disable Firth bias adjustment.
- Run model with profiler.
- Configure profiler settings.
Example 38
Summary: Fits a generalized regression model with validation to predict 'Fish Caught' using various effects and interactions, while generating reports for model summary, solution path, and parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = Fit Model(
Validation( :Validation ),
Y( :Fish Caught ),
Effects(
:Live Bait, :Fishing Poles, :Camper, :People, :Children, :Live Bait * :Fishing Poles, :Live Bait * :Camper, :Live Bait * :People,
:Live Bait * :Children, :Fishing Poles * :Camper, :Fishing Poles * :People, :Fishing Poles * :Children, :Camper * :People,
:Camper * :Children, :People * :Children
),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Poisson" ),
Run(
Fit(
Estimation Method( Elastic Net( Adaptive ) ),
Validation Method( Validation Column ),
Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
Live Bait( 0, Lock( 0 ), Show( 1 ) ),
Fishing Poles( 0.856, Lock( 0 ), Show( 1 ) ),
Camper( 0, Lock( 0 ), Show( 1 ) ),
People( 2.516, Lock( 0 ), Show( 1 ) ),
Children( 0.936, Lock( 0 ), Show( 1 ) )
)
)
)
),
SendToReport(
Dispatch( {"ZI Poisson Adaptive Elastic Net with Validation Column"}, "Model Summary", OutlineBox, {Close( 1 )} ),
Dispatch( {"ZI Poisson Adaptive Elastic Net with Validation Column"}, "Solution Path", OutlineBox, {Close( 1 )} ),
Dispatch( {"ZI Poisson Adaptive Elastic Net with Validation Column"}, "Parameter Estimates for Original Predictors", OutlineBox,
{Close( 1 )}
)
)
);
Code Explanation:
- Open data table;
- Fit model with validation.
- Set response variable "Fish Caught".
- Define effects including interactions.
- Choose "Generalized Regression" personality.
- Select "ZI Poisson" distribution.
- Run fit with Elastic Net method.
- Use validation column for validation.
- Create profiler with confidence intervals.
- Set term values and lock/unlock options.
Example 39
Summary: Fits generalized regression models using SVEM Forward Selection and Lasso methods, with profiling enabled for both fits.
Code:
dt = Open("data_table.jmp");
obj = Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run(
Set Random Seed( 92743 ),
Fit( Estimation Method( "SVEM Forward Selection"n( Samples( 200 ) ) ), Profiler( 1 ) ),
Fit( Estimation Method( "SVEM Lasso"n( Samples( 200 ) ) ), Profiler( 1 ) )
)
);
Code Explanation:
- Open data table;
- Initialize Fit Model object.
- Set validation column.
- Define response variable.
- Specify effect variables.
- Choose Generalized Regression personality.
- Set Normal distribution.
- Start fitting models.
- Set random seed.
- Fit using SVEM Forward Selection.
- Enable profiler for first fit.
- Fit using SVEM Lasso.
- Enable profiler for second fit.
Example 40
Summary: Fits a generalized regression model with Lasso estimation and AICc validation, utilizing response limits and desirability functions to optimize yield.
Code:
dt under test = Open("data_table.jmp");
obj = Fit Model(
Y( :Yield ),
Effects( :Lot, :Methanol, :Ethanol, :Propanol, :Butanol, :pH, :Time ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run(
Fit(
Estimation Method( Lasso( Adaptive ) ),
Validation Method( AICc ),
Profiler(
1,
Confidence Intervals( 1 ),
Desirability Functions( 1 ),
Yield << Response Limits(
{Lower( 10, 0.066 ), Middle( 40, 0.5 ), Upper( 70, 0.9819 ), Goal( "Maximize" ), Importance( 1 )}
),
Term Value(
Lot( "1", Lock( 0 ), Show( 1 ) ),
Methanol( 5, Lock( 0 ), Show( 1 ) ),
Ethanol( 5, Lock( 0 ), Show( 0 ) ),
Propanol( 5, Lock( 0 ), Show( 0 ) ),
Butanol( 5, Lock( 0 ), Show( 0 ) ),
pH( 7.5, Lock( 0 ), Show( 0 ) ),
Time( 1.5, Lock( 0 ), Show( 0 ) )
)
)
)
),
SendToReport(
Dispatch( {"Normal Adaptive Lasso with AICc Validation"}, "Model Summary", OutlineBox, {Close( 1 )} ),
Dispatch( {"Normal Adaptive Lasso with AICc Validation"}, "Estimation Details", OutlineBox, {Close( 1 )} ),
Dispatch( {"Normal Adaptive Lasso with AICc Validation"}, "Solution Path", OutlineBox, {Close( 1 )} ),
Dispatch( {"Normal Adaptive Lasso with AICc Validation"}, "Parameter Estimates for Original Predictors", OutlineBox, {Close( 1 )} )
)
);
Code Explanation:
- Open data table.
- Fit generalized regression model.
- Set response variable.
- Define effects.
- Choose Lasso estimation method.
- Use AICc validation.
- Enable profiler.
- Show confidence intervals.
- Include desirability functions.
- Configure response limits.
Example 41
Summary: Fits a generalized regression model to predict Rating, incorporating multiple effects and desirability functions, with Lasso estimation and AICc validation.
Code:
dt under test = Open("data_table.jmp");
obj = Fit Model(
Y( :Rating ),
Effects( :Rater, :Variety, :Field, :Name( "De-Stem" ), :Yeast, :Temperature, :Press, :Barrel Age, :Barrel Seasoning, :Filtering ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run(
Fit(
Estimation Method( Lasso( Adaptive ) ),
Validation Method( AICc ),
Profiler(
1,
Confidence Intervals( 1 ),
Desirability Functions( 1 ),
Rating << Response Limits(
{Lower( 0, 0.066 ), Middle( 10, 0.5 ), Upper( 20, 0.9819 ), Goal( "Maximize" ), Importance( 1 )}
),
Term Value(
Rater( "1", Lock( 0 ), Show( 1 ) ),
Variety( "Bernard", Lock( 0 ), Show( 1 ) ),
Field( "1", Lock( 0 ), Show( 0 ) ),
Name( "De-Stem" )("No", Lock( 0 ), Show( 1 )),
Yeast( "Cultured", Lock( 0 ), Show( 1 ) ),
Temperature( "High", Lock( 0 ), Show( 0 ) ),
Press( "Hard", Lock( 0 ), Show( 1 ) ),
Barrel Age( "New", Lock( 0 ), Show( 0 ) ),
Barrel Seasoning( "Air", Lock( 0 ), Show( 1 ) ),
Filtering( "No", Lock( 0 ), Show( 1 ) )
)
)
)
),
SendToReport(
Dispatch( {"Normal Adaptive Lasso with AICc Validation"}, "Model Summary", OutlineBox, {Close( 1 )} ),
Dispatch( {"Normal Adaptive Lasso with AICc Validation"}, "Estimation Details", OutlineBox, {Close( 1 )} ),
Dispatch( {"Normal Adaptive Lasso with AICc Validation"}, "Solution Path", OutlineBox, {Close( 1 )} ),
Dispatch( {"Normal Adaptive Lasso with AICc Validation"}, "Parameter Estimates for Original Predictors", OutlineBox, {Close( 1 )} )
)
);
Code Explanation:
- Open data table.
- Fit generalized regression model.
- Set response variable as Rating.
- Include multiple effects in model.
- Use Normal distribution.
- Run fit with Lasso estimation.
- Validate using AICc method.
- Generate profiler with confidence intervals.
- Define desirability functions for Rating.
- Configure term values for various factors.
Example 42
Summary: Fits a generalized regression model to a data table, specifying validation column and response variable, and extracting the model summary report.
Code:
dt = Open("data_table.jmp");
fm = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( Generalized Regression ),
Generalized Distribution( Normal ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ) ) )
);
rp = Report( fm )["Model Summary"];
nobs = (rp[Table Box( 2 )] << get as matrix)[1, 0];
Code Explanation:
- Open data table.
- Fit generalized regression model.
- Specify validation column.
- Set response variable.
- Define predictor effects.
- Choose personality: Generalized Regression.
- Select normal distribution.
- Run fit with Lasso adaptive estimation.
- Use validation column method.
- Extract model summary report.
Example 43
Summary: Fits a generalized regression model to predict Oxy values, incorporating multiple effects and adaptive estimation methods.
Code:
dt under test = Open("data_table.jmp");
obj = Fit Model(
Y( :Oxy ),
Effects( :Weight, :Runtime, :RunPulse, :RstPulse, :MaxPulse ),
Personality( Generalized Regression ),
Generalized Distribution( Normal ),
Run(
Fit(
Estimation Method( Elastic Net( Adaptive ) ),
Validation Method( Holdback, 0.3 ),
Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
Weight( 77.445, Lock( 0 ), Show( 1 ) ),
Runtime( 10.5861, Lock( 0 ), Show( 1 ) ),
RunPulse( 169.645, Lock( 0 ), Show( 1 ) ),
RstPulse( 53.452, Lock( 0 ), Show( 1 ) ),
MaxPulse( 173.774, Lock( 0 ), Show( 1 ) )
)
),
Plot Actual by Predicted( 1 ),
Covariance of Estimates( 1 ),
Correlation of Estimates( 1 )
)
),
SendToReport( Dispatch( "Effect Tests", OutlineBox, {Close( 0 )} ) )
);
Code Explanation:
- Open table.
- Fit model with Oxy as response.
- Include multiple effects.
- Use Generalized Regression personality.
- Set Normal distribution.
- Run fit with specified methods.
- Use Elastic Net adaptive estimation.
- Apply Holdback validation method.
- Create profiler with confidence intervals.
- Show term values in profiler.
Example 44
Summary: Fits a generalized linear model to predict body fat percentage based on various anthropometric measurements, generating profiler results with confidence intervals.
Code:
dt under test = Open("data_table.jmp");
obj = Fit Model(
Y( :Percent body fat ),
Effects(
:Name( "Weight (lbs)" ), :Name( "Abdomen circumference (cm)" ), :Name( "Forearm circumference (cm)" ),
:Name( "Wrist circumference (cm)" )
),
Personality( "Generalized Linear Model" ),
GLM Distribution( "Normal" ),
Link Function( "Identity" ),
Overdispersion Tests and Intervals( 0 ),
Name( "Firth Bias-adjusted Estimates" )(0),
Run(
1,
Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
Name( "Weight (lbs)" )(178.92, Lock( 0 ), Show( 1 )),
Name( "Abdomen circumference (cm)" )(92.556, Lock( 0 ), Show( 1 )),
Name( "Forearm circumference (cm)" )(28.664, Lock( 0 ), Show( 1 )),
Name( "Wrist circumference (cm)" )(18.2298, Lock( 0 ), Show( 1 ))
)
)
),
SendToReport(
Dispatch( {}, "Whole Model Test", OutlineBox, {Close( 1 )} ),
Dispatch( {}, "Effect Summary", OutlineBox, {Close( 1 )} ),
Dispatch( {}, "Effect Tests", OutlineBox, {Close( 1 )} ),
Dispatch( {}, "Parameter Estimates", OutlineBox, {Close( 1 )} ),
Dispatch( {}, "Studentized Deviance Residual by Predicted", OutlineBox, {Close( 1 )} )
)
);
Code Explanation:
- Open data table;
- Define response variable.
- Specify predictor variables.
- Choose model personality.
- Set distribution type.
- Select link function.
- Disable overdispersion tests.
- Disable Firth bias adjustment.
- Run model.
- Generate profiler with confidence intervals.
Example 45
Summary: Fits a generalized regression model with Lasso estimation and AICc validation to predict body fat percentage from hip, neck, and wrist circumference measurements.
Code:
dt = Open("data_table.jmp");
obj = Fit Model(
Y( :Percent body fat ),
Effects( :Name( "Hip circumference (cm)" ), :Name( "Neck circumference (cm)" ), :Name( "Wrist circumference (cm)" ) ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run(
Fit(
Estimation Method( Lasso( Adaptive ) ),
Validation Method( AICc ),
Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
Name( "Hip circumference (cm)" )(99.905, Lock( 0 ), Show( 1 )),
Name( "Neck circumference (cm)" )(37.992, Lock( 0 ), Show( 1 )),
Name( "Wrist circumference (cm)" )(18.2298, Lock( 0 ), Show( 1 ))
)
)
)
),
SendToReport(
Dispatch( {"Normal Adaptive Lasso with AICc Validation"}, "Model Summary", OutlineBox, {Close( 1 )} ),
Dispatch( {"Normal Adaptive Lasso with AICc Validation"}, "Estimation Details", OutlineBox, {Close( 1 )} ),
Dispatch( {"Normal Adaptive Lasso with AICc Validation"}, "Solution Path", OutlineBox, {Close( 1 )} ),
Dispatch( {"Normal Adaptive Lasso with AICc Validation"}, "Parameter Estimates for Original Predictors", OutlineBox, {Close( 1 )} ),
Dispatch( {"Normal Adaptive Lasso with AICc Validation", "Effect Tests"}, "", TableBox, {Sort By Column( 5, 1 )} )
)
);
Code Explanation:
- Open data table;
- Define model object.
- Set response variable.
- Add predictor variables.
- Choose modeling personality.
- Specify distribution type.
- Run model fitting.
- Apply Lasso estimation method.
- Use AICc validation.
- Generate profiler report.
Example 46
Summary: Fits a parametric survival model to analyze the relationship between various factors and patient outcomes, utilizing Weibull distribution and generating quantile and distribution profilers.
Code:
dt = Open("data_table.jmp");
obj = Fit Model(
Censor( :censor ),
Censor Code( "1" ),
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Personality( "Parametric Survival" ),
Distribution( "Weibull" ),
Run(
Likelihood Ratio Tests( 1 ),
Likelihood Confidence Intervals( 1 ),
Correlation of Estimates( 1 ),
Covariance of Estimates( 1 ),
Quantile Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
Cell Type( "Adeno", Lock( 0 ), Show( 1 ) ),
Treatment( "Standard", Lock( 0 ), Show( 1 ) ),
Prior( "No", Lock( 0 ), Show( 1 ) ),
Age( 58.307, Lock( 0 ), Show( 1 ) ),
Diag Time( 8.774, Lock( 0 ), Show( 1 ) ),
KPS( 58.569, Lock( 0 ), Show( 1 ) ),
Failure Probability( 0.1, Lock( 0 ), Show( 1 ) )
)
),
Distribution Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
Cell Type( "Adeno", Lock( 0 ), Show( 1 ) ),
Treatment( "Standard", Lock( 0 ), Show( 1 ) ),
Prior( "No", Lock( 0 ), Show( 1 ) ),
Age( 58.307, Lock( 0 ), Show( 1 ) ),
Diag Time( 8.774, Lock( 0 ), Show( 1 ) ),
KPS( 58.569, Lock( 0 ), Show( 1 ) ),
Time( 500.5, Lock( 0 ), Show( 1 ) )
)
)
)
);
:Time << Set Property( "Missing Value Codes", 0 );
:Time << Set Values( [0, 0, 0] );
obj2 = obj << Redo Analysis;
rpt = obj2 << Report;
Code Explanation:
- Open data table;
- Fit parametric survival model.
- Specify censor variable.
- Set censor code to "1".
- Define response variable.
- Include multiple effects.
- Choose Weibull distribution.
- Enable likelihood ratio tests.
- Generate quantile profiler.
- Create distribution profiler.
Example 47
Summary: Fits a parametric survival model to analyze patient data, utilizing Weibull distribution and enabling various diagnostic tests.
Code:
dt = Open("data_table.jmp");
obj = Fit Model(
Censor( :censor ),
Censor Code( "1" ),
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Personality( "Parametric Survival" ),
Distribution( "Weibull" ),
Run(
Likelihood Ratio Tests( 1 ),
Likelihood Confidence Intervals( 1 ),
Correlation of Estimates( 1 ),
Covariance of Estimates( 1 ),
Quantile Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
Cell Type( "Adeno", Lock( 0 ), Show( 1 ) ),
Treatment( "Standard", Lock( 0 ), Show( 1 ) ),
Prior( "No", Lock( 0 ), Show( 1 ) ),
Age( 58.307, Lock( 0 ), Show( 1 ) ),
Diag Time( 8.774, Lock( 0 ), Show( 1 ) ),
KPS( 58.569, Lock( 0 ), Show( 1 ) ),
Failure Probability( 0.1, Lock( 0 ), Show( 1 ) )
)
),
Distribution Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
Cell Type( "Adeno", Lock( 0 ), Show( 1 ) ),
Treatment( "Standard", Lock( 0 ), Show( 1 ) ),
Prior( "No", Lock( 0 ), Show( 1 ) ),
Age( 58.307, Lock( 0 ), Show( 1 ) ),
Diag Time( 8.774, Lock( 0 ), Show( 1 ) ),
KPS( 58.569, Lock( 0 ), Show( 1 ) ),
Time( 500.5, Lock( 0 ), Show( 1 ) )
)
)
)
);
:Age << Set Property( "Missing Value Codes", {999} );
:Age << Set Values( {999, 999, 999} );
obj2 = obj << Redo Analysis;
rpt = obj2 << Report;
actN = (rpt[Number Col Box( 4 )][1]);
Code Explanation:
- Open data table;
- Fit parametric survival model.
- Specify censoring variable and code.
- Set response variable.
- Define effects for analysis.
- Choose Weibull distribution.
- Enable likelihood ratio tests.
- Enable confidence intervals.
- Enable correlation of estimates.
- Enable covariance of estimates.
Example 48
Summary: Fits a generalized regression model to data, utilizing Lasso estimation and holdback validation, while handling missing values and generating report values.
Code:
dt = Open("data_table.jmp");
fm1 = Fit Model(
Y( :Household Income ),
Effects(
:Population, :Eighth Grade Math, :High School Graduates, :Gross State Product, :Vegetable Consumption, :Smokers, :Physical Activity
),
Personality( Generalized Regression ),
Generalized Distribution( Gamma ),
Run(
Set Random Seed( 345 ),
Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Holdback, 0.3 ), Save Validation Column( 1 ) )
)
);
rp1 = Report( fm1 );
dt << Clear Row States;
dt << Select where( Is Missing( :Physical Activity ) ) << Delete Rows;
fm2 = Fit Model(
Y( :Household Income ),
Effects(
:Population, :Eighth Grade Math, :High School Graduates, :Gross State Product, :Vegetable Consumption, :Smokers, :Physical Activity
),
Personality( Generalized Regression ),
Generalized Distribution( Gamma ),
Run(
Set Random Seed( 345 ),
Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Holdback, 0.3 ), Save Validation Column( 1 ) )
)
);
rp2 = Report( fm2 );
val1 = (dt:Validation << get values);
val2 = (dt:Validation 2 << get values);
ms1 = rp1["Model Summary"][Table Box( 2 )] << get as matrix;
ms2 = rp2["Model Summary"][Table Box( 2 )] << get as matrix;
pe1 = rp1["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )] << get as matrix;
pe2 = rp2["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )] << get as matrix;
Code Explanation:
- Open data table.
- Fit generalized regression model.
- Set random seed.
- Use Lasso estimation.
- Apply holdback validation.
- Save validation column.
- Clear row states.
- Delete rows with missing values.
- Refit model without missing values.
- Retrieve various report values.
Example 49
Summary: Fits a generalized regression model with Cauchy distribution and Lasso estimation, generating reports and relaunching with active effects.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Cauchy" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) )
);
rpt = obj << report;
dlg1 = obj << (fit[1] << Relaunch with Active Effects( 1 ));
obj2 = dlg1 << Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) );
rpt2 = obj2 << report;
res = rpt2[Outline Box( "Cauchy Lasso with Validation Column" )][Outline Box( "Parameter Estimates for Original Predictors" )][
Number Col Box( "Estimate" )] << getasmatrix;
obj << Fit( Estimation Method( Double Lasso ), Validation Method( Validation Column ) );
obj << (fit[2] << Active Parameter Estimates( 1 ));
aRes = rpt[Outline Box( "Cauchy Double Lasso with Validation Column" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set validation method.
- Define response variable.
- Specify predictor effects.
- Choose Cauchy distribution.
- Run Lasso estimation.
- Generate initial report.
- Relaunch with active effects.
- Run Double Lasso estimation.
Example 50
Summary: Generalized regression analysis with Lasso estimation and validation using the Fit Model platform in JMP, generating reports for initial and active parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Exponential" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) )
);
rpt = obj << report;
dlg1 = obj << (fit[1] << Relaunch with Active Effects( 1 ));
obj2 = dlg1 << Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) );
rpt2 = obj2 << report;
res = rpt2[Outline Box( "Exponential Lasso with Validation Column" )][Outline Box( "Parameter Estimates for Original Predictors" )][
Number Col Box( "Estimate" )] << getasmatrix;
obj << Fit( Estimation Method( Double Lasso ), Validation Method( Validation Column ) );
obj << (fit[2] << Active Parameter Estimates( 1 ));
aRes = rpt[Outline Box( "Exponential Double Lasso with Validation Column" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Launch Fit Model platform.
- Set validation method.
- Specify response variable.
- Add predictor effects.
- Choose Generalized Regression personality.
- Select Exponential distribution.
- Run initial Lasso fit.
- Extract initial report.
- Relaunch with active effects.
- Run second Lasso fit.
- Extract second report.
- Retrieve parameter estimates.
- Run Double Lasso fit.
- Activate parameter estimates.
- Retrieve active parameter estimates.
Example 51
Summary: Generalized regression analysis with Lasso estimation and validation, generating reports for original and active parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Gamma" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) )
);
rpt = obj << report;
dlg1 = obj << (fit[1] << Relaunch with Active Effects( 1 ));
obj2 = dlg1 << Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) );
rpt2 = obj2 << report;
res = rpt2[Outline Box( "Gamma Lasso with Validation Column" )][Outline Box( "Parameter Estimates for Original Predictors" )][
Number Col Box( "Estimate" )] << getasmatrix;
obj << Fit( Estimation Method( Double Lasso ), Validation Method( Validation Column ) );
obj << (fit[2] << Active Parameter Estimates( 1 ));
aRes = rpt[Outline Box( "Gamma Double Lasso with Validation Column" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set validation column.
- Specify response variable.
- Define predictor variables.
- Choose Generalized Regression personality.
- Select Gamma distribution.
- Run Lasso estimation with validation.
- Extract first report.
- Relaunch fit with active effects.
- Run Lasso estimation again.
- Extract second report.
- Retrieve original parameter estimates.
- Perform Double Lasso estimation.
- Activate parameter estimates.
- Retrieve active parameter estimates.
Example 52
Summary: Fits and validates a generalized regression model using Weibull distribution, with Lasso estimation and double Lasso estimation, and generates reports for parameter estimates and solution path summaries.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Weibull" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) )
);
rpt = obj << report;
dlg1 = obj << (fit[1] << Relaunch with Active Effects( 1 ));
obj2 = dlg1 << Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) );
rpt2 = obj2 << report;
res = rpt2[Outline Box( "Weibull Lasso with Validation Column" )][Outline Box( "Parameter Estimates for Original Predictors" )][
Number Col Box( "Estimate" )] << getasmatrix;
obj << Fit( Estimation Method( Double Lasso ), Validation Method( Validation Column ) );
obj << (fit[2] << Active Parameter Estimates( 1 ));
aRes = rpt[Outline Box( "Weibull Double Lasso with Validation Column" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
obj << (Fit[1] << Show Solution Path Summary( 1 ));
obj << (Fit[2] << Show Solution Path Summary( 1 ));
obj2 << (Fit[1] << Show Solution Path Summary( 1 ));
rpt = obj << report;
rpt2 = obj2 << report;
summary1 = rpt[Outline Box( "Weibull Double Lasso with Validation Column" )][Outline Box( "Solution Path Summary" )][Table Box( 1 )] <<
get as matrix;
summary2 = rpt2[Outline Box( "Solution Path Summary" )][Table Box( 1 )] << get as matrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set validation method.
- Define response variable.
- Specify predictor effects.
- Choose Weibull distribution.
- Run Lasso estimation.
- Generate initial report.
- Relaunch with active effects.
- Run double Lasso estimation.
Example 53
Summary: Fits and creates reports for generalized regression models with Lasso estimation method and validation column, generating parameter estimates matrices for original and active predictors.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "LogNormal" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) )
);
rpt = obj << report;
dlg1 = obj << (fit[1] << Relaunch with Active Effects( 1 ));
obj2 = dlg1 << Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) );
rpt2 = obj2 << report;
res = rpt2[Outline Box( "LogNormal Lasso with Validation Column" )][Outline Box( "Parameter Estimates for Original Predictors" )][
Number Col Box( "Estimate" )] << getasmatrix;
obj << Fit( Estimation Method( Double Lasso ), Validation Method( Validation Column ) );
obj << (fit[2] << Active Parameter Estimates( 1 ));
aRes = rpt[Outline Box( "LogNormal Double Lasso with Validation Column" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Launch Fit Model platform.
- Specify validation column.
- Set response variable.
- Define model effects.
- Choose Generalized Regression personality.
- Select LogNormal distribution.
- Run initial Lasso fit.
- Extract first report.
- Relaunch with active effects.
- Run second Lasso fit.
- Extract second report.
- Retrieve parameter estimates matrix.
- Fit Double Lasso model.
- Activate parameter estimates.
- Retrieve active parameter estimates matrix.
Example 54
Summary: Fits and creates reports for a generalized regression model with Poisson distribution, Lasso estimation method, and validation column, generating two reports with parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) )
);
rpt = obj << report;
dlg1 = obj << (fit[1] << Relaunch with Active Effects( 1 ));
obj2 = dlg1 << Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) );
rpt2 = obj2 << report;
res = rpt2[Outline Box( "Poisson Lasso with Validation Column" )][Outline Box( "Parameter Estimates for Original Predictors" )][
Number Col Box( "Estimate" )] << getasmatrix;
obj << Fit( Estimation Method( Double Lasso ), Validation Method( Validation Column ) );
obj << (fit[2] << Active Parameter Estimates( 1 ));
aRes = rpt[Outline Box( "Poisson Double Lasso with Validation Column" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Fit Generalized Regression model.
- Set Poisson distribution.
- Use Lasso estimation method.
- Generate initial report.
- Relaunch model with active effects.
- Refit model with Lasso.
- Generate second report.
- Extract original parameter estimates.
- Fit model with Double Lasso.
- Activate parameter estimates.
- Extract active parameter estimates.
Example 55
Summary: Fits and creates reports for a generalized regression model with negative binomial distribution, utilizing Lasso estimation and validation column for data analysis.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) )
);
rpt = obj << report;
dlg1 = obj << (fit[1] << Relaunch with Active Effects( 1 ));
obj2 = dlg1 << Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) );
rpt2 = obj2 << report;
res = rpt2[Outline Box( "Negative Binomial Lasso with Validation Column" )][Outline Box( "Parameter Estimates for Original Predictors" )][
Number Col Box( "Estimate" )] << getasmatrix;
obj << Fit( Estimation Method( Double Lasso ), Validation Method( Validation Column ) );
obj << (fit[2] << Active Parameter Estimates( 1 ));
aRes = rpt[Outline Box( "Negative Binomial Double Lasso with Validation Column" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Specify validation column.
- Set response variable.
- Define effects.
- Choose negative binomial distribution.
- Run Lasso estimation.
- Extract parameter estimates report.
- Relaunch with active effects.
- Run double Lasso estimation.
Example 56
Summary: Fits a Poisson model with Lasso estimation method, generating reports, and extracting parameter estimates matrices.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
dlg1 = obj << (fit[1] << Relaunch with Active Effects( 1 ));
obj2 = dlg1 << Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) );
rpt2 = obj2 << report;
res = rpt2[Outline Box( "Poisson Lasso with Validation Column" )][Outline Box( "Parameter Estimates for Original Predictors" )][
Number Col Box( "Estimate" )] << getasmatrix;
obj << Fit( Estimation Method( Double Lasso ), Validation Method( Validation Column ) );
obj << (fit[2] << Active Parameter Estimates( 1 ));
aRes = rpt[Outline Box( "Poisson Double Lasso with Validation Column" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
aRes = rpt[Outline Box( "Active Parameter Estimates" )][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open table.
- Fit model with Poisson distribution.
- Use Lasso estimation method.
- Generate report.
- Relaunch fit with active effects.
- Run fit again with Lasso.
- Generate second report.
- Extract parameter estimates matrix.
- Fit model with Double Lasso.
- Extract active parameter estimates matrix.
Example 57
Summary: Fits and creates reports for a generalized regression model with negative binomial distribution, using Lasso estimation and validation column for 'Fish Caught' data.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
dlg1 = obj << (fit[1] << Relaunch with Active Effects( 1 ));
obj2 = dlg1 << Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) );
rpt2 = obj2 << report;
res = rpt2[Outline Box( "Negative Binomial Lasso with Validation Column" )][Outline Box( "Parameter Estimates for Original Predictors" )][
Number Col Box( "Estimate" )] << getasmatrix;
obj << Fit( Estimation Method( Double Lasso ), Validation Method( Validation Column ) );
obj << (fit[2] << Active Parameter Estimates( 1 ));
aRes = rpt[Outline Box( "Negative Binomial Double Lasso with Validation Column" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
aRes = rpt[Outline Box( "Active Parameter Estimates" )][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set response variable to "Fish Caught".
- Use "Validation" column for validation.
- Include specified effects in model.
- Choose negative binomial distribution.
- Run Lasso estimation with validation.
- Extract initial report.
- Relaunch model with active effects.
- Run Double Lasso estimation with validation.
Example 58
Summary: Runs the estimation and validation of a generalized regression model using Lasso and Double Lasso methods, with interactive features for relaunching fits and extracting parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Poisson" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
dlg1 = obj << (fit[1] << Relaunch with Active Effects( 1 ));
obj2 = dlg1 << Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) );
rpt2 = obj2 << report;
res = rpt2[Outline Box( "ZI Poisson Lasso with Validation Column" )][Outline Box( "Parameter Estimates for Original Predictors" )][
Number Col Box( "Estimate" )] << getasmatrix;
obj << Fit( Estimation Method( Double Lasso ), Validation Method( Validation Column ) );
obj << (fit[2] << Active Parameter Estimates( 1 ));
aRes = rpt[Outline Box( "ZI Poisson Double Lasso with Validation Column" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Create a Fit Model object.
- Set response variable to Fish Caught.
- Use Validation column for validation.
- Include specified effects in the model.
- Choose Generalized Regression personality.
- Specify ZI Poisson distribution.
- Run initial Lasso estimation.
- Extract first report.
- Relaunch fit with active effects.
- Run second Lasso estimation.
- Extract second report.
- Get parameter estimates matrix.
- Fit model using Double Lasso method.
- Activate parameter estimates for the second fit.
- Extract active parameter estimates matrix.
Example 59
Summary: Fits a Generalized Regression model with ZI Negative Binomial distribution and Lasso estimation, utilizing validation column for model validation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Negative Binomial" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
dlg1 = obj << (fit[1] << Relaunch with Active Effects( 1 ));
obj2 = dlg1 << Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) );
rpt2 = obj2 << report;
res = rpt2[Outline Box( "ZI Negative Binomial Lasso with Validation Column" )][Outline Box( "Parameter Estimates for Original Predictors" )
][Number Col Box( "Estimate" )] << getasmatrix;
obj << Fit( Estimation Method( Double Lasso ), Validation Method( Validation Column ) );
obj << (fit[2] << Active Parameter Estimates( 1 ));
aRes = rpt[Outline Box( "ZI Negative Binomial Double Lasso with Validation Column" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Initiate Fit Model with specified parameters.
- Set response variable to Fish Caught.
- Use validation column for model validation.
- Include specific effects in the model.
- Choose Generalized Regression personality.
- Select ZI Negative Binomial distribution.
- Run initial fit with Lasso estimation.
- Retrieve the initial report.
- Relaunch with active effects from the first fit.
- Run second fit with Lasso estimation.
- Extract parameter estimates matrix from second report.
- Refit model with Double Lasso estimation.
- Activate parameter estimates for the second fit.
- Extract active parameter estimates matrix from original report.
Example 60
Summary: Fits and creates reports for a generalized regression model with Lasso estimation and validation, including parameter estimates extraction.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Gamma" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
dlg1 = obj << (fit[1] << Relaunch with Active Effects( 1 ));
obj2 = dlg1 << Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) );
rpt2 = obj2 << report;
res = rpt2[Outline Box( "ZI Gamma Lasso with Validation Column" )][Outline Box( "Parameter Estimates for Original Predictors" )][
Number Col Box( "Estimate" )] << getasmatrix;
obj << Fit( Estimation Method( Double Lasso ), Validation Method( Validation Column ) );
obj << (fit[2] << Active Parameter Estimates( 1 ));
aRes = rpt[Outline Box( "ZI Gamma Double Lasso with Validation Column" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Launch Fit Model platform.
- Set response variable to "Fish Caught".
- Use "Validation" column for validation.
- Include specified effects in model.
- Choose "Generalized Regression" personality.
- Set distribution to "ZI Gamma".
- Fit model using Lasso estimation and validation.
- Retrieve initial report.
- Relaunch fit with active effects.
- Refit model using Lasso again.
- Retrieve second report.
- Extract parameter estimates matrix.
- Fit model using Double Lasso.
- Activate parameter estimates for Double Lasso.
- Extract active parameter estimates matrix.
Example 61
Summary: Fits a generalized regression model to a data table, specifying validation, response variable, predictor effects, and estimation method.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Double Lasso( Adaptive ) ), Validation Method( Validation Column ) ) )
);
rpt = obj << report;
aRes = rpt["Parameter Estimates for Original Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
bRes = [-341.363302940626, 0, 17.1591963179321, 6.43584547615154, 1.03929652117688, -0.248860069407453, 0, 0, 3.99337556654972,
53.7482486751033, 0];
obj << closewindow;
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set validation method.
- Specify response variable.
- Define predictor effects.
- Choose Generalized Regression personality.
- Select Normal distribution.
- Run model with Double Lasso estimation.
- Retrieve report object.
- Extract parameter estimates matrix.
- Define baseline coefficients vector.
- Close Fit Model window.
Example 62
Summary: Fits a generalized regression model to predict continuous outcomes, utilizing an Exponential distribution and Double Lasso estimation method.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Exponential" ),
Run( Fit( Estimation Method( Double Lasso( Adaptive ) ), Validation Method( Validation Column ) ) )
);
rpt = obj << report;
aRes = rpt["Parameter Estimates for Original Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
bRes = [1.53340885601848, 0, 0.176436055642607, 0.0331097418905866, 0.00732184628053149, -0.007296788859666, 0.00665822672385978, 0, 0,
0.514819234428085, 0];
obj << closewindow;
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set validation method.
- Define response variable.
- Specify predictor variables.
- Choose Generalized Regression personality.
- Select Exponential distribution.
- Run model with Double Lasso.
- Extract parameter estimates.
- Close window.
Example 63
Summary: Fits a Generalized Regression model to a data table, specifying validation column and response variable, and extracting parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Gamma" ),
Run( Fit( Estimation Method( Double Lasso( Adaptive ) ), Validation Method( Validation Column ) ) )
);
rpt = obj << report;
aRes = rpt["Parameter Estimates for Original Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
bRes = [1.67156067927418, 0, 0.100697167072285, 0.0364156720376482, 0.00669277155281754, -0.00404366217275674, 0.00352693576226483, 0, 0,
0.434553360369654, 0];
If( Host is( Windows ), , );
obj << closewindow;
Code Explanation:
- Open data table;
- Fit Generalized Regression model.
- Specify validation column.
- Set response variable.
- Define predictor effects.
- Choose Gamma distribution.
- Run Double Lasso estimation.
- Use validation column method.
- Extract parameter estimates.
- Close model window.
Example 64
Summary: Generalized regression analysis with Poisson distribution to model the relationship between 'Fish Caught' and various predictors, utilizing the Fit Model platform.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Double Lasso( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
aRes = rpt["Parameter Estimates for Original Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
bRes = [1.4928525293345, -2.2093304575535, 0.355402995493408, -0.578715218978198, 0, -0.19656579228422];
Code Explanation:
- Open data table.
- Launch Fit Model platform.
- Set response variable: "Fish Caught".
- Specify validation column: "Validation".
- Add effects: "live bait", "Fishing Poles", "camper", "People", "Children".
- Choose "Generalized Regression" personality.
- Set distribution to "Poisson".
- Run model with Double Lasso adaptive estimation and validation method.
- Retrieve report from the model object.
- Extract parameter estimates matrix.
Example 65
Summary: Fits a Generalized Regression model with Negative Binomial distribution to predict Fish Caught, incorporating live bait, Fishing Poles, camper, People, and Children as effects.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
Run( Fit( Estimation Method( Double Lasso( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
aRes = rpt["Parameter Estimates for Original Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
If( Host is( Windows ),
bRes = [1.65183747052457, -2.31108537722351, 0.266862903780285, -0.388979971828953, -0.113694883144592, 0],
bRes = [1.65183746957997, -2.3110853781765, 0.266862903990903, -0.388979972915192, -0.113694883596013, 0]
);
Code Explanation:
- Open data table;
- Start Fit Model.
- Set response variable: Fish Caught.
- Use Validation column.
- Include live bait, Fishing Poles, camper, People, Children as effects.
- Choose Generalized Regression personality.
- Set Negative Binomial distribution.
- Run model with Double Lasso estimation.
- Extract Parameter Estimates report.
- Retrieve Estimate column values.
Example 66
Summary: Fits a generalized regression model to predict 'Fish Caught' using 'live bait', 'Fishing Poles', 'camper', 'People', and 'Children' as predictors, with ZI Poisson distribution and double lasso estimation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Poisson" ),
Run( Fit( Estimation Method( Double Lasso( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
aRes = rpt["Parameter Estimates for Original Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
bRes = [1.94773114762186, -0.677050001225616, 0.232894038708065, -0.789795835137991, 0, -0.313157446119767, 0.7706479181149];
Code Explanation:
- Open table.
- Fit generalized regression model.
- Specify response variable.
- Use validation column.
- Define predictor effects.
- Set personality to generalized regression.
- Choose ZI Poisson distribution.
- Run fit with double lasso estimation.
- Extract parameter estimates.
- Compare results with expected values.
Example 67
Summary: Fits a generalized regression model with double lasso estimation and BIC validation, extracting parameter estimates for original predictors.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Negative Binomial" ),
Run( Fit( Estimation Method( Double Lasso( Adaptive ) ), Validation Method( BIC ) ) ),
);
rpt = obj << report;
aRes = rpt["Parameter Estimates for Original Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
aRes2 = rpt["Parameter Estimates for Original Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << getasmatrix;
bRes = [1.88301646586903, -0.80533322068309, 0.251247325993138, -0.537069400688075, 0, -0.337704846253243, 0.0684328838698654,
0.742251366745635];
Code Explanation:
- Open data table.
- Fit generalized regression model.
- Set response variable.
- Specify validation column.
- Define predictor effects.
- Choose personality type.
- Select distribution.
- Run model with double lasso.
- Extract parameter estimates.
- Store additional results matrix.
Example 68
Summary: Fits a generalized regression model to predict 'Fish Caught' using live bait, Fishing Poles, camper, People, and Children as predictors, with ZI Gamma distribution and Double Lasso adaptive estimation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Gamma" ),
Run( Fit( Estimation Method( Double Lasso( Adaptive ) ), Validation Method( ERIC ) ) ),
);
rpt = obj << report;
aRes = rpt["Parameter Estimates for Original Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
bRes = [1.95034410593115, -0.6387582454112, 0.208492478643915, -0.497061504639771, 0, -0.300208959488129, 1.12260466171349, 0.784];
Code Explanation:
- Open data table;
- Launch Fit Model platform.
- Set response variable: "Fish Caught".
- Specify validation column: "Validation".
- Include effects: live bait, Fishing Poles, camper, People, Children.
- Choose Generalized Regression personality.
- Select ZI Gamma distribution.
- Run model with Double Lasso adaptive estimation.
- Use ERIC validation method.
- Extract parameter estimates matrix.
Example 69
Summary: Fits a generalized regression model with Cauchy distribution and Lasso estimation, retrieving reports, and extracting parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Cauchy" ),
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) )
);
rpt = obj << report;
dlg1 = obj << (fit[1] << Relaunch with Active Effects( 1 ));
obj2 = dlg1 << Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) );
rpt2 = obj2 << report;
res = rpt2[Outline Box( "Cauchy Lasso with Validation Column" )][Outline Box( "Parameter Estimates for Original Predictors" )][
Number Col Box( "Estimate" )] << getasmatrix;
obj << Fit( Estimation Method( Double Lasso( Linear Grid ) ), Validation Method( Validation Column ) );
obj << (fit[2] << Active Parameter Estimates( 1 ));
aRes = rpt[Outline Box( "Cauchy Double Lasso with Validation Column" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Specify validation column.
- Set response variable Y.
- Define effects: Age, Gender, BMI, BP, Total Cholesterol, LDL, HDL, TCH, LTG, Glucose.
- Choose Cauchy distribution.
- Run model with Lasso estimation.
- Retrieve initial report.
- Relaunch with active effects.
- Refit model with Lasso estimation again.
- Retrieve updated report.
- Extract parameter estimates matrix.
- Fit model with Double Lasso estimation.
- Activate parameter estimates.
- Extract active parameter estimates matrix.
Example 70
Summary: Fits and creates reports for generalized regression models with Lasso estimation, utilizing validation columns and active parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Exponential" ),
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) )
);
rpt = obj << report;
dlg1 = obj << (fit[1] << Relaunch with Active Effects( 1 ));
obj2 = dlg1 << Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) );
rpt2 = obj2 << report;
res = rpt2[Outline Box( "Exponential Lasso with Validation Column" )][Outline Box( "Parameter Estimates for Original Predictors" )][
Number Col Box( "Estimate" )] << getasmatrix;
obj << Fit( Estimation Method( Double Lasso( Linear Grid ) ), Validation Method( Validation Column ) );
obj << (fit[2] << Active Parameter Estimates( 1 ));
aRes = rpt[Outline Box( "Exponential Double Lasso with Validation Column" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Specify validation column.
- Set response variable.
- Define predictor effects.
- Choose exponential distribution.
- Run Lasso estimation.
- Generate initial report.
- Relaunch with active effects.
- Run double Lasso estimation.
Example 71
Summary: Generalized regression analysis with Lasso estimation and validation, generating parameter estimates matrices for original and active predictors.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Gamma" ),
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) )
);
rpt = obj << report;
dlg1 = obj << (fit[1] << Relaunch with Active Effects( 1 ));
obj2 = dlg1 << Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) );
rpt2 = obj2 << report;
res = rpt2[Outline Box( "Gamma Lasso with Validation Column" )][Outline Box( "Parameter Estimates for Original Predictors" )][
Number Col Box( "Estimate" )] << getasmatrix;
obj << Fit( Estimation Method( Double Lasso( Linear Grid ) ), Validation Method( Validation Column ) );
obj << (fit[2] << Active Parameter Estimates( 1 ));
aRes = rpt[Outline Box( "Gamma Double Lasso with Validation Column" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Start Fit Model platform.
- Set validation method.
- Specify response variable.
- Define predictor effects.
- Choose Generalized Regression personality.
- Select Gamma distribution.
- Run initial fit with Lasso estimation.
- Extract first report.
- Relaunch fit with active effects.
- Run second fit with Lasso estimation.
- Extract second report.
- Retrieve parameter estimates matrix.
- Refit with Double Lasso estimation.
- Activate second fit's parameter estimates.
- Retrieve active parameter estimates matrix.
Example 72
Summary: Fits and creates reports for a generalized regression model with Weibull distribution, using Lasso estimation method and validation column.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Weibull" ),
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) )
);
rpt = obj << report;
dlg1 = obj << (fit[1] << Relaunch with Active Effects( 1 ));
obj2 = dlg1 << Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) );
rpt2 = obj2 << report;
res = rpt2[Outline Box( "Weibull Lasso with Validation Column" )][Outline Box( "Parameter Estimates for Original Predictors" )][
Number Col Box( "Estimate" )] << getasmatrix;
obj << Fit( Estimation Method( Double Lasso( Linear Grid ) ), Validation Method( Validation Column ) );
obj << (fit[2] << Active Parameter Estimates( 1 ));
aRes = rpt[Outline Box( "Weibull Double Lasso with Validation Column" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set validation column.
- Specify response variable.
- Define predictor effects.
- Choose Weibull distribution.
- Run initial fit with Lasso.
- Generate initial report.
- Relaunch fit with active effects.
- Run second fit with Lasso.
- Extract parameter estimates.
- Refit with Double Lasso.
- Activate parameter estimates.
- Extract active parameter estimates.
Example 73
Summary: Generalized regression analysis with Lasso method and validation column, generating reports for parameter estimates and active effects.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "LogNormal" ),
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) )
);
rpt = obj << report;
dlg1 = obj << (fit[1] << Relaunch with Active Effects( 1 ));
obj2 = dlg1 << Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) );
rpt2 = obj2 << report;
res = rpt2[Outline Box( "LogNormal Lasso with Validation Column" )][Outline Box( "Parameter Estimates for Original Predictors" )][
Number Col Box( "Estimate" )] << getasmatrix;
obj << Fit( Estimation Method( Double Lasso( Linear Grid ) ), Validation Method( Validation Column ) );
obj << (fit[2] << Active Parameter Estimates( 1 ));
aRes = rpt[Outline Box( "LogNormal Double Lasso with Validation Column" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set validation method.
- Define response variable.
- Specify predictor effects.
- Choose Generalized Regression personality.
- Select LogNormal distribution.
- Run initial fit with Lasso method.
- Generate report from initial fit.
- Relaunch with active effects.
- Refit model using Double Lasso method.
- Extract parameter estimates for original predictors.
- Extract active parameter estimates for Double Lasso.
Example 74
Summary: Fits and validates a generalized regression model with Poisson distribution, utilizing Lasso and Double Lasso estimation methods.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) )
);
rpt = obj << report;
dlg1 = obj << (fit[1] << Relaunch with Active Effects( 1 ));
obj2 = dlg1 << Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) );
rpt2 = obj2 << report;
res = rpt2[Outline Box( "Poisson Lasso with Validation Column" )][Outline Box( "Parameter Estimates for Original Predictors" )][
Number Col Box( "Estimate" )] << getasmatrix;
obj << Fit( Estimation Method( Double Lasso( Linear Grid ) ), Validation Method( Validation Column ) );
obj << (fit[2] << Active Parameter Estimates( 1 ));
aRes = rpt[Outline Box( "Poisson Double Lasso with Validation Column" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Specify validation column.
- Set response variable.
- Define predictor effects.
- Choose Poisson distribution.
- Run initial fit with Lasso.
- Extract first report.
- Relaunch with active effects.
- Refit with Lasso.
- Extract second report.
- Get parameter estimates matrix.
- Fit with Double Lasso.
- Activate parameter estimates.
- Get active parameter estimates matrix.
Example 75
Summary: Fits a generalized regression model with negative binomial distribution and Lasso estimation, generating reports and relaunching with active effects.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) )
);
rpt = obj << report;
dlg1 = obj << (fit[1] << Relaunch with Active Effects( 1 ));
obj2 = dlg1 << Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) );
rpt2 = obj2 << report;
res = rpt2[Outline Box( "Negative Binomial Lasso with Validation Column" )][Outline Box( "Parameter Estimates for Original Predictors" )][
Number Col Box( "Estimate" )] << getasmatrix;
obj << Fit( Estimation Method( Double Lasso( Linear Grid ) ), Validation Method( Validation Column ) );
obj << (fit[2] << Active Parameter Estimates( 1 ));
aRes = rpt[Outline Box( "Negative Binomial Double Lasso with Validation Column" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set validation method.
- Define response variable.
- Specify predictor variables.
- Choose negative binomial distribution.
- Run initial fit with Lasso estimation.
- Generate report from initial fit.
- Relaunch with active effects.
- Refit with double Lasso estimation.
Example 76
Summary: Fits and creates reports for a generalized regression model with Poisson distribution, Lasso estimation, and validation column, extracting parameter estimates matrices.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
dlg1 = obj << (fit[1] << Relaunch with Active Effects( 1 ));
obj2 = dlg1 << Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) );
rpt2 = obj2 << report;
res = rpt2[Outline Box( "Poisson Lasso with Validation Column" )][Outline Box( "Parameter Estimates for Original Predictors" )][
Number Col Box( "Estimate" )] << getasmatrix;
obj << Fit( Estimation Method( Double Lasso( Linear Grid ) ), Validation Method( Validation Column ) );
obj << (fit[2] << Active Parameter Estimates( 1 ));
aRes = rpt[Outline Box( "Poisson Double Lasso with Validation Column" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
aRes = rpt[Outline Box( "Active Parameter Estimates" )][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set response variable: Fish Caught.
- Specify validation column.
- Define effects: live bait, Fishing Poles, camper, People, Children.
- Use Poisson distribution.
- Run model with Lasso estimation.
- Extract first report.
- Relaunch with active effects.
- Fit model again with Lasso estimation.
- Extract second report.
- Retrieve parameter estimates matrix.
- Fit model with Double Lasso estimation.
- Set active parameter estimates.
- Retrieve active parameter estimates matrix.
Example 77
Summary: Fits a generalized regression model with negative binomial distribution and Lasso estimation, utilizing validation column for model evaluation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
dlg1 = obj << (fit[1] << Relaunch with Active Effects( 1 ));
obj2 = dlg1 << Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) );
rpt2 = obj2 << report;
res = rpt2[Outline Box( "Negative Binomial Lasso with Validation Column" )][Outline Box( "Parameter Estimates for Original Predictors" )][
Number Col Box( "Estimate" )] << getasmatrix;
obj << Fit( Estimation Method( Double Lasso( Linear Grid ) ), Validation Method( Validation Column ) );
obj << (fit[2] << Active Parameter Estimates( 1 ));
aRes = rpt[Outline Box( "Negative Binomial Double Lasso with Validation Column" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
aRes = rpt[Outline Box( "Active Parameter Estimates" )][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open table.
- Fit generalized regression model.
- Specify response variable.
- Use validation column.
- Define effects.
- Set distribution to negative binomial.
- Run initial fit with Lasso estimation.
- Generate report.
- Relaunch with active effects.
- Refit with double Lasso estimation.
Example 78
Summary: Fits and creates reports for a generalized regression model with ZI Poisson distribution, Lasso estimation, and validation column, including relaunching fit with active effects and extracting parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Poisson" ),
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
dlg1 = obj << (fit[1] << Relaunch with Active Effects( 1 ));
obj2 = dlg1 << Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) );
rpt2 = obj2 << report;
res = rpt2[Outline Box( "ZI Poisson Lasso with Validation Column" )][Outline Box( "Parameter Estimates for Original Predictors" )][
Number Col Box( "Estimate" )] << getasmatrix;
obj << Fit( Estimation Method( Double Lasso( Linear Grid ) ), Validation Method( Validation Column ) );
obj << (fit[2] << Active Parameter Estimates( 1 ));
aRes = rpt[Outline Box( "ZI Poisson Double Lasso with Validation Column" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set response variable: "Fish Caught".
- Specify validation column: "Validation".
- Include effects: live bait, Fishing Poles, camper, People, Children.
- Use ZI Poisson distribution.
- Run Lasso estimation with validation.
- Extract first report.
- Relaunch fit with active effects.
- Run double Lasso estimation with validation.
Example 79
Summary: Fits and creates reports for a Generalized Regression model with Lasso estimation, utilizing the Validation column for validation, and extracting parameter estimates from the report.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Negative Binomial" ),
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
dlg1 = obj << (fit[1] << Relaunch with Active Effects( 1 ));
obj2 = dlg1 << Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) );
rpt2 = obj2 << report;
res = rpt2[Outline Box( "ZI Negative Binomial Lasso with Validation Column" )][Outline Box( "Parameter Estimates for Original Predictors" )
][Number Col Box( "Estimate" )] << getasmatrix;
obj << Fit( Estimation Method( Double Lasso( Linear Grid ) ), Validation Method( Validation Column ) );
obj << (fit[2] << Active Parameter Estimates( 1 ));
aRes = rpt[Outline Box( "ZI Negative Binomial Double Lasso with Validation Column" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Fit Generalized Regression model.
- Set response variable to "Fish Caught".
- Use "Validation" column for validation.
- Include specified effects in model.
- Use ZI Negative Binomial distribution.
- Run model with Lasso estimation.
- Generate initial report.
- Relaunch model with active effects.
- Run model again with Lasso estimation.
- Extract parameter estimates from second report.
- Fit model with Double Lasso estimation.
- Display active parameter estimates.
- Extract active parameter estimates from first report.
Example 80
Summary: Generalized regression analysis with Lasso estimation and validation method, extracting parameter estimates and active effects for a specified data table.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Gamma" ),
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
dlg1 = obj << (fit[1] << Relaunch with Active Effects( 1 ));
obj2 = dlg1 << Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) );
rpt2 = obj2 << report;
res = rpt2[Outline Box( "ZI Gamma Lasso with Validation Column" )][Outline Box( "Parameter Estimates for Original Predictors" )][
Number Col Box( "Estimate" )] << getasmatrix;
obj << Fit( Estimation Method( Double Lasso( Linear Grid ) ), Validation Method( Validation Column ) );
obj << (fit[2] << Active Parameter Estimates( 1 ));
aRes = rpt[Outline Box( "ZI Gamma Double Lasso with Validation Column" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Initiate Fit Model dialog.
- Set response variable to "Fish Caught".
- Specify validation column.
- Define effects: live bait, Fishing Poles, camper, People, Children.
- Choose Generalized Regression personality.
- Select ZI Gamma distribution.
- Run model with Lasso estimation and validation method.
- Extract report from initial fit.
- Relaunch fit with active effects.
- Re-run model with Lasso estimation and validation method.
- Extract second report.
- Retrieve parameter estimates matrix.
- Fit model with Double Lasso estimation and validation method.
- Activate parameter estimates for second fit.
- Retrieve active parameter estimates matrix.
Example 81
Summary: Fits generalized regression models with normal and exponential distributions to a data table, retrieving parameter estimates for original predictors.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Double Lasso( Adaptive, Linear Grid ) ), Validation Method( Validation Column ) ) )
);
rpt = obj << report;
aRes = rpt["Parameter Estimates for Original Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
bRes = [-336.846399900175, 0, 16.9094567898721, 6.40236572942143, 1.01978812990243, -0.242485376651342, 0, 0, 4.61060454932105,
52.593441585394, 0];
If( Host is( Windows ), , );
obj << closewindow;
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Exponential" ),
Run( Fit( Estimation Method( Double Lasso( Adaptive, Linear Grid ) ), Validation Method( Validation Column ) ) )
);
rpt = obj << report;
aRes = rpt["Parameter Estimates for Original Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
bRes = [1.49948358403474, 0, 0.190013808087686, 0.0328215806042336, 0.00763032500346691, -0.00797612294234551, 0.00734193061659583, 0, 0,
0.526624365931972, 0];
obj << closewindow;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set validation column.
- Specify response variable.
- Define predictor effects.
- Choose personality as generalized regression.
- Select normal distribution.
- Run fit with double lasso method.
- Retrieve parameter estimates.
- Close window.
- Repeat steps 2-10 with exponential distribution.
Example 82
Summary: Fits a generalized regression model to predict 'Fish Caught' using specified effects, personality, and distribution, with validation column method.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Double Lasso( Adaptive, Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
aRes = rpt["Parameter Estimates for Original Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
bRes = [1.46658988868472, -2.20806865298334, 0.352446112725839, -0.537127827884125, 0, -0.17678973758587];
Code Explanation:
- Open data table.
- Fit model with specified parameters.
- Set response variable.
- Specify validation column.
- Define effects for analysis.
- Choose Generalized Regression personality.
- Set Poisson distribution.
- Run model with Double Lasso estimation.
- Use validation column method.
- Extract parameter estimates matrix.
Example 83
Summary: Fits a generalized negative binomial regression model to predict Fish Caught, incorporating specified effects and validation column, and extracts parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
Run( Fit( Estimation Method( Double Lasso( Adaptive, Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
aRes = rpt["Parameter Estimates for Original Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
bRes = [1.59673896477913, -2.31633902782148, 0.272018934737661, -0.360725945230062, -0.0958743914220044, 0];
Code Explanation:
- Open data table;
- Initiate Fit Model dialog.
- Set response variable: Fish Caught.
- Use Validation column for validation.
- Include specified effects in model.
- Choose Generalized Regression personality.
- Select Negative Binomial distribution.
- Run model with Double Lasso method.
- Extract Parameter Estimates report.
- Retrieve estimates matrix from report.
Example 84
Summary: Fits a generalized regression model to predict Fish Caught, incorporating validation and effects from various predictors.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Poisson" ),
Run( Fit( Estimation Method( Double Lasso( Adaptive, Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
aRes = rpt["Parameter Estimates for Original Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
bRes = [1.9477311468057, -0.677050000852431, 0.232894038654408, -0.789795835035383, 0, -0.3131574460617, 0.770647918022203];
Code Explanation:
- Open table.
- Fit model.
- Set response variable.
- Specify validation column.
- Define effects.
- Choose personality.
- Set distribution.
- Run fit with method.
- Extract report.
- Get parameter estimates.
Example 85
Summary: Fits a generalized negative binomial regression model to data, using double lasso estimation and BIC validation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Negative Binomial" ),
Run( Fit( Estimation Method( Double Lasso( Adaptive, Linear Grid ) ), Validation Method( BIC ) ) ),
);
rpt = obj << report;
aRes = rpt["Parameter Estimates for Original Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
bRes = [1.88301646853116, -0.805333219655931, 0.251247326087285, -0.537069402825238, 0, -0.337704847365148, 0.0684328808564093,
0.742251367131557];
Code Explanation:
- Open data table.
- Start Fit Model process.
- Set response variable.
- Define validation column.
- Specify predictor effects.
- Choose Generalized Regression personality.
- Select ZI Negative Binomial distribution.
- Run model with Double Lasso and BIC validation.
- Extract parameter estimates report.
- Retrieve estimate values from report.
Example 86
Summary: Fits a generalized regression model with ZI Gamma distribution to predict 'Fish Caught' based on specified effects and validation, generating parameter estimates for original predictors.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Gamma" ),
Run( Fit( Estimation Method( Double Lasso( Adaptive, Linear Grid ) ), Validation Method( ERIC ) ) ),
);
rpt = obj << report;
aRes = rpt["Parameter Estimates for Original Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
bRes = [1.95035926269622, -0.638768832128516, 0.20849841119734, -0.497092836050866, 0, -0.300224083390829, 1.12260086431002, 0.784];
Code Explanation:
- Open data table;
- Fit model with specified parameters.
- Set response variable as "Fish Caught".
- Use "Validation" column for validation.
- Include specified effects in the model.
- Choose "Generalized Regression" personality.
- Set distribution to "ZI Gamma".
- Run model with Double Lasso and ERIC validation.
- Extract parameter estimates report.
- Retrieve estimate values from report.
Example 87
Summary: Fits a generalized regression model to an ordinal response variable, utilizing elastic net adaptive estimation and AICc validation method.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y Ordinal ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Ordinal Logistic" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( "AICc" ) ) )
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
tnll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set validation method.
- Specify ordinal logistic distribution.
- Use elastic net adaptive estimation.
- Extract model report.
- Retrieve solution path.
- Obtain validation negative log-likelihood.
- Extract parameter estimates matrix.
Example 88
Summary: Fits and creates reports for an ordinal logistic regression model with Lasso estimation, including validation and active parameter estimates.
Code:
dt = Open("data_table.jmp");
obj1 = dt << Fit Model(
Validation( :Validation ),
Y( :Y Ordinal ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Ordinal Logistic" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) )
);
rpt1 = obj1 << report;
dlg1 = obj1 << (fit[1] << Relaunch with Active Effects( 1 ));
obj2 = dlg1 << Run( Fit( Estimation Method( Lasso( Min Ratio( 0 ) ) ), Validation Method( Validation Column ) ) );
obj2 << (Fit[1] << Active Parameter Estimates( 1 ));
rpt2 = obj2 << report;
res = rpt2[Outline Box( "Ordinal Logistic Lasso with Validation Column" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
obj1 << Fit( Estimation Method( Double Lasso ), Validation Method( Validation Column ) );
obj1 << (fit[2] << Active Parameter Estimates( 1 ));
aRes = rpt1[Outline Box( "Ordinal Logistic Double Lasso with Validation Column" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Fit model with validation.
- Set response variable as Y Ordinal.
- Include Age, Gender, BMI, BP, Total Cholesterol effects.
- Use Generalized Regression personality.
- Specify Ordinal Logistic distribution.
- Run fit with Lasso estimation.
- Generate report from first fit.
- Relaunch fit with active effects.
- Run second fit with Lasso (Min Ratio 0).
- Extract active parameter estimates.
- Fit model with Double Lasso estimation.
- Extract active parameter estimates for Double Lasso.
Example 89
Summary: Fits a generalized regression model to an ordinal response variable using Lasso estimation and Multinomial distribution, with specified effects and validation method.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y Ordinal ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Multinomial" ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ) ) )
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
tnll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
Close( dt, no save );
b actmin = [1.37955224563164, 0, -9.49459731991732, -20.9646081168289, -17.3654913469597, 35.3713350402518, -26.5656511866495, 0, 0,
-40.8257288707835, 0, 0.412839066139869, 0, 0, -16.0545060938333, -8.60234967697212, 2.47204742983661, 0, 0, -5.5216996784394,
-13.3472463104537, 0];
Code Explanation:
- Open data table;
- Fit model using Fit Model platform.
- Set validation method.
- Specify response variable.
- Define predictor effects.
- Choose Generalized Regression personality.
- Set Multinomial distribution.
- Run model with Lasso estimation.
- Extract model report.
- Close dataset without saving.
Example 90
Summary: Fits a generalized regression model to an ordinal response variable, incorporating multiple predictor variables and utilizing elastic net adaptive estimation with AICc validation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y Ordinal ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Multinomial" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( "AICc" ) ) )
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
tnll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
If( Host is( Windows ), , );
Code Explanation:
- Open data table;
- Fit model using Generalized Regression.
- Specify validation column.
- Set response variable as ordinal.
- Include multiple predictor variables.
- Choose Multinomial distribution.
- Run model with Elastic Net adaptive estimation.
- Use AICc for validation method.
- Retrieve model report.
- Extract solution path and validation negative log likelihood.
Example 91
Summary: Fits and creates reports for a generalized regression model with Lasso estimation and validation, utilizing Multinomial distribution and active parameter estimates.
Code:
dt = Open("data_table.jmp");
obj1 = dt << Fit Model(
Validation( :Validation ),
Y( :Y Ordinal ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Multinomial" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) )
);
rpt1 = obj1 << report;
dlg1 = obj1 << (fit[1] << Relaunch with Active Effects( 1 ));
obj2 = dlg1 << Run( Fit( Estimation Method( Lasso( Min Ratio( 0 ) ) ), Validation Method( Validation Column ) ) );
obj2 << (Fit[1] << Active Parameter Estimates( 1 ));
rpt2 = obj2 << report;
res = rpt2[Outline Box( "Multinomial Lasso with Validation Column" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
obj1 << Fit( Estimation Method( Double Lasso ), Validation Method( Validation Column ) );
obj1 << (fit[2] << Active Parameter Estimates( 1 ));
aRes = rpt1[Outline Box( "Multinomial Double Lasso with Validation Column" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Fit model using Generalized Regression.
- Set validation method.
- Specify response variable.
- Define effects for analysis.
- Choose Multinomial distribution.
- Run fit with Lasso estimation.
- Generate initial report.
- Relaunch fit with active effects.
- Refit with adjusted Lasso parameters.
- Extract parameter estimates matrix.
- Fit model using Double Lasso.
- Activate parameter estimates.
- Extract active parameter estimates matrix.
Example 92
Summary: Fits and creates reports for a generalized regression model with Lasso estimation and BIC validation, including active parameter estimates and estimate matrix extraction.
Code:
dt = Open("data_table.jmp");
obj1 = dt << Fit Model(
Validation( :Validation ),
Y( :Y Ordinal ),
Effects( :Age, :Gender, :BMI, :BP ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Multinomial" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( "BIC" ) ) )
);
rpt1 = obj1 << report;
dlg1 = obj1 << (fit[1] << Relaunch with Active Effects( 1 ));
obj2 = dlg1 << Run( Fit( Estimation Method( Lasso( Min Ratio( 0 ) ) ), Validation Method( "BIC" ) ) );
obj2 << (Fit[1] << Active Parameter Estimates( 1 ));
rpt2 = obj2 << report;
res = rpt2[Outline Box( "Multinomial Lasso with BIC Validation" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
obj1 << Fit( Estimation Method( Double Lasso ), Validation Method( "BIC" ) );
obj1 << (fit[2] << Active Parameter Estimates( 1 ));
aRes = rpt1[Outline Box( "Multinomial Double Lasso with BIC Validation" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set validation column.
- Specify ordinal response variable.
- Include Age, Gender, BMI, BP effects.
- Use multinomial distribution.
- Run Lasso estimation with BIC validation.
- Generate initial report.
- Relaunch fit with active effects.
- Run Lasso estimation with Min Ratio 0.
- Display active parameter estimates.
- Extract estimate matrix from report.
- Fit double Lasso estimation with BIC validation.
- Display active parameter estimates for double Lasso.
- Extract estimate matrix for double Lasso results.
Example 93
Summary: Fits and creates reports for an ordinal logistic model with Lasso estimation and BIC validation, enabling active parameter estimates and extracting estimate matrices.
Code:
dt = Open("data_table.jmp");
obj1 = dt << Fit Model(
Validation( :Validation ),
Y( :Y Ordinal ),
Effects( :Age, :Gender, :BMI, :BP ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Ordinal Logistic" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( "BIC" ) ) )
);
rpt1 = obj1 << report;
dlg1 = obj1 << (fit[1] << Relaunch with Active Effects( 1 ));
obj2 = dlg1 << Run( Fit( Estimation Method( Lasso( Min Ratio( 0 ) ) ), Validation Method( "BIC" ) ) );
obj2 << (Fit[1] << Active Parameter Estimates( 1 ));
rpt2 = obj2 << report;
res = rpt2[Outline Box( "Ordinal Logistic Lasso with BIC Validation" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
obj1 << Fit( Estimation Method( Double Lasso ), Validation Method( "BIC" ) );
obj1 << (fit[2] << Active Parameter Estimates( 1 ));
aRes = rpt1[Outline Box( "Ordinal Logistic Double Lasso with BIC Validation" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Fit model using Generalized Regression.
- Specify ordinal logistic distribution.
- Use Lasso estimation and BIC validation.
- Generate initial report.
- Relaunch fit with active effects.
- Run second fit with modified Lasso.
- Enable active parameter estimates.
- Generate second report.
- Extract estimate matrix from second report.
Example 94
Summary: Fits a generalized regression model to an ordinal response variable, incorporating multiple effects and validation techniques.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y Ordinal ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Multinomial" ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ) ) )
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
tnll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Start Fit Model.
- Use Validation column.
- Set Y as Ordinal.
- Include multiple effects.
- Choose Generalized Regression personality.
- Select Multinomial distribution.
- Run model with Lasso Adaptive estimation.
- Use Validation Column method.
- Retrieve solution path, validation negative log-likelihood, and parameter estimates.
Example 95
Summary: Runs a quantile regression analysis to predict BMI values, utilizing the Fit Model platform with Generalized Regression personality and Maximum Likelihood estimation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Effects( :BMI ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Quantile Regression" ),
Quantile( 0.95 ),
Run(
Fit(
Estimation Method( Maximum Likelihood ),
Validation Method( None ),
Inverse Prediction( Response( 150 ), Term Value( BMI( . ) ) ),
Inverse Prediction( Response( 150 ), Term Value( BMI( . ) ), Individual )
)
),
);
rpt = obj << getreport;
Code Explanation:
- Open data table;
- Start Fit Model platform.
- Set response variable Y.
- Add effect BMI.
- Choose Generalized Regression personality.
- Select Quantile Regression distribution.
- Set quantile to 0.95.
- Run the model fit.
- Use Maximum Likelihood estimation.
- Perform inverse prediction for BMI.
Example 96
Summary: Fits a generalized regression model to a data table, incorporating BMI and Gender effects, with quantile regression distribution and maximum likelihood estimation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Effects( :BMI, :Gender ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Quantile Regression" ),
Quantile( 0.7 ),
Run(
Fit(
Estimation Method( Maximum Likelihood ),
Validation Method( None ),
Covariance of Estimates( 1 ),
Correlation of Estimates( 1 ),
Multiple Comparisons( Effect( Gender ), Student's t( 1 ) )
)
),
);
rpt = obj << getreport;
Code Explanation:
- Open data table;
- Initiate Fit Model process.
- Set response variable Y.
- Include BMI and Gender effects.
- Choose Generalized Regression personality.
- Select Quantile Regression distribution.
- Set quantile to 0.7.
- Run model fit.
- Use Maximum Likelihood estimation.
- Disable validation method.
- Enable covariance estimates.
- Enable correlation estimates.
- Perform multiple comparisons for Gender.
- Retrieve model report.
Example 97
Summary: Generalized regression analysis with quantile regression distribution, incorporating HDL effect and its squared term, using Maximum Likelihood estimation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Effects( :HDL, :HDL * :HDL ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Quantile Regression" ),
Quantile( 0.5 ),
Run(
Fit(
Estimation Method( Maximum Likelihood ),
Validation Method( None ),
Covariance of Estimates( 1 ),
Correlation of Estimates( 1 )
)
),
);
rpt = obj << getreport;
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set response variable Y.
- Include HDL effect.
- Include HDL squared effect.
- Choose Generalized Regression personality.
- Select Quantile Regression distribution.
- Set quantile to 0.5.
- Run model with Maximum Likelihood.
- Disable validation method.
- Enable covariance estimates.
- Enable correlation estimates.
- Retrieve report object.
Example 98
Summary: Fits a Generalized Regression model to a data table, incorporating HDL, HDL^2, and Gender effects, with Quantile Regression distribution and Maximum Likelihood estimation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Effects( :HDL, :HDL * :HDL, :Gender ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Quantile Regression" ),
Quantile( 0.9 ),
Run(
Fit(
Estimation Method( Maximum Likelihood ),
Validation Method( None ),
Covariance of Estimates( 1 ),
Correlation of Estimates( 1 ),
Multiple Comparisons( Effect( Gender ), Student's t( 1 ) )
)
),
);
rpt = obj << getreport;
Code Explanation:
- Open data table;
- Fit Generalized Regression model.
- Set response variable to Y.
- Include HDL, HDL^2, and Gender effects.
- Use Quantile Regression distribution.
- Set quantile level to 0.9.
- Run the fit using Maximum Likelihood estimation.
- Disable validation method.
- Enable covariance and correlation of estimates.
- Perform multiple comparisons for Gender effect.
Example 99
Summary: Fits a generalized regression model to a data table, utilizing quantile regression and maximum likelihood estimation.
Code:
dt = Open("data_table.jmp");
y1 = dt:Y << get as matrix;
x1 = dt:Age << get as matrix;
obj1 = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Quantile Regression" ),
Run( Fit( Estimation Method( "Maximum Likelihood" ), Validation Method( "None" ) ) )
);
rpt1 = obj1 << report;
Code Explanation:
- Open data table;
- Extract Y variable.
- Extract Age variable.
- Start Fit Model process.
- Use validation column.
- Set Y as response.
- Include Age and Gender effects.
- Choose Generalized Regression personality.
- Select Quantile Regression distribution.
- Run Maximum Likelihood estimation.
Example 100
Summary: Fits a generalized regression model to predict sex based on height and weight, utilizing Maximum Likelihood estimation and capturing log output.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :sex ),
Effects( :height, :weight ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Binomial" ),
Run( Fit( Estimation Method( Maximum Likelihood ), Validation Method( None ) ) )
);
rpt = obj << report;
Log Capture( obj << (Fit[1] << save simulation formula) );
col = Column( "sex Simulation Formula" );
form = col << get formula;
obj << close window;
dt << deletecolumn( "sex Simulation Formula" );
Code Explanation:
- Open table.
- Fit generalized regression model.
- Set response variable.
- Add predictor variables.
- Specify distribution.
- Run model fit.
- Retrieve report object.
- Capture log output.
- Save simulation formula.
- Extract formula.
Example 101
Summary: Fits a generalized regression model to a data table, utilizing Poisson distribution and Elastic Net with adaptive method for estimation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Launch Fit Model platform.
- Set response variable Y.
- Specify validation column.
- Define model effects.
- Choose Generalized Regression personality.
- Select Poisson distribution.
- Fit model using Elastic Net with adaptive method.
- Retrieve validation negative log-likelihood.
- Extract parameter estimates matrix.
Example 102
Summary: Fits a Generalized Regression model to a data table, utilizing an Exponential distribution and Elastic Net adaptive estimation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Exponential" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Fit Generalized Regression model.
- Set response variable.
- Specify validation column.
- Define predictor effects.
- Choose Exponential distribution.
- Run Elastic Net adaptive estimation.
- Use validation column method.
- Retrieve model report.
- Extract solution path.
Example 103
Summary: Fits a generalized regression model to predict continuous outcomes, utilizing adaptive elastic net estimation and gamma distribution.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Gamma" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Initiate Fit Model.
- Set response variable Y.
- Specify validation column.
- Define predictor effects.
- Choose Generalized Regression personality.
- Select Gamma distribution.
- Run model with Adaptive Elastic Net.
- Retrieve model report.
- Extract solution path.
- Get negative log-likelihood.
- Fetch active minimum estimates.
- Collect dispersion estimates.
Example 104
Summary: Fits a generalized regression model with negative binomial distribution to a data table, utilizing an Elastic Net adaptive estimation method and extracting relevant report metrics.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Initiate Fit Model dialog.
- Set response variable Y.
- Specify validation column.
- Define predictor effects.
- Choose Generalized Regression personality.
- Select Negative Binomial distribution.
- Run Elastic Net (Adaptive) fit.
- Extract model report.
- Retrieve solution path.
Example 105
Summary: Fits a generalized regression model to a Poisson-distributed response variable, utilizing adaptive elastic net estimation and generating a report with parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open table.
- Fit model.
- Set response variable.
- Specify validation column.
- Define effects.
- Choose personality.
- Set distribution.
- Run fit with adaptive elastic net.
- Generate report.
- Extract solution path.
Example 106
Summary: Generalized regression analysis on the 'Fish Caught' response variable, utilizing an elastic net adaptive fit with ZI Poisson distribution and retrieving solution path, negative log-likelihood, and parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Poisson" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( Validation Column ) ) )
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data_table data
- Start fitting model.
- Set response variable.
- Specify validation method.
- Define effects to include.
- Choose model personality.
- Select generalized distribution.
- Run elastic net adaptive fit.
- Extract fit report.
- Retrieve solution path.
- Get negative log-likelihood.
- Fetch active minimum estimates.
- Obtain scale estimates.
Example 107
Summary: Fits a generalized regression model using adaptive elastic net estimation and negative binomial distribution to predict 'Fish Caught' based on various effects, with report generation and solution path extraction.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Launch Fit Model platform.
- Set response variable: "Fish Caught".
- Use "Validation" column for validation.
- Include effects: "live bait", "Fishing Poles", "camper", "People", "Children".
- Choose "Generalized Regression" personality.
- Specify "Negative Binomial" distribution.
- Fit model using Adaptive Elastic Net method.
- Retrieve model report.
- Extract solution path, negative log-likelihood, and parameter estimates.
Example 108
Summary: Fits a generalized regression model with ZI Negative Binomial distribution to predict 'Fish Caught' based on specified effects and validation column, generating solution path, negative log-likelihood, and parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Negative Binomial" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open table.
- Fit model with specified parameters.
- Set response variable.
- Specify validation column.
- Define effects to include.
- Choose generalized regression personality.
- Select ZI Negative Binomial distribution.
- Run fit with adaptive elastic net estimation.
- Use validation column method.
- Retrieve solution path, negative log-likelihood, and parameter estimates.
Example 109
Summary: Fits a generalized regression model to predict 'Fish Caught' using live bait, Fishing Poles, camper, People, and Children as effects, with ZI Gamma distribution and Elastic Net adaptive estimation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Gamma" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set response variable: "Fish Caught".
- Specify validation column: "Validation".
- Define effects: live bait, Fishing Poles, camper, People, Children.
- Choose "Generalized Regression" personality.
- Select "ZI Gamma" distribution.
- Run model with Elastic Net adaptive estimation.
- Use validation column method.
- Extract model report.
- Retrieve solution path.
- Get negative log-likelihood.
- Extract centered parameter estimates.
- Extract scaled parameter estimates.
Example 110
Summary: Fits a Weibull generalized regression model to a data table, utilizing adaptive elastic net estimation and AICc validation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :censor ),
Censor Code( "1" ),
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Weibull" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( AICc ) ) )
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << gettrainingnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table.
- Fit model using Fit Model platform.
- Specify censoring variable and code.
- Set response variable.
- Define effects for analysis.
- Choose Generalized Regression personality.
- Select Weibull distribution.
- Run fit with Adaptive Elastic Net estimation.
- Use AICc for validation.
- Extract report and solution path.
Example 111
Summary: Fits a generalized regression model to a data table, specifying censoring and response variables, predictor effects, and distribution type.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :censor ),
Censor Code( "1" ),
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Personality( "Generalized Regression" ),
Generalized Distribution( "LogNormal" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( AICc ) ) )
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << gettrainingnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open table.
- Fit generalized regression model.
- Specify censor variable.
- Set censor code.
- Define response variable.
- Include predictor effects.
- Choose LogNormal distribution.
- Use Elastic Net method.
- Validate using AICc.
- Retrieve solution path, NLL, and estimates.
Example 112
Summary: Fits a generalized regression model with elastic net estimation and normal distribution, using the Fit Model platform in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive, Linear Grid, Alpha( 0.9 ) ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = (rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix);
scale = (rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << getasmatrix);
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set response variable Y.
- Specify validation method.
- Define model effects.
- Choose Generalized Regression personality.
- Set Normal distribution.
- Run Elastic Net model with Alpha 0.9.
- Extract report object.
- Retrieve solution path.
Example 113
Summary: Fits a generalized regression model to a data table, utilizing Elastic Net estimation and Poisson distribution, and retrieves relevant metrics such as solution path and negative log-likelihood.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive, Linear Grid, Alpha( 0.9 ) ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = (rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix);
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set response variable Y.
- Specify validation column.
- Define predictor effects.
- Choose Generalized Regression personality.
- Set Poisson distribution.
- Run model with Elastic Net method.
- Retrieve model report.
- Extract solution path.
- Get negative log-likelihood.
- Obtain parameter estimates matrix.
Example 114
Summary: Fits a generalized regression model to predict continuous outcomes, utilizing an Exponential distribution and Elastic Net estimation method.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Exponential" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive, Linear Grid, Alpha( 0.9 ) ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = (rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix);
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set response variable.
- Specify validation method.
- Define predictor effects.
- Choose Generalized Regression personality.
- Select Exponential distribution.
- Run model with Elastic Net.
- Extract solution path.
- Retrieve negative log-likelihood.
Example 115
Summary: Fits a generalized regression model with elastic net adaptive estimation to predict continuous outcomes, utilizing multiple effects and validation column.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Gamma" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive, Linear Grid, Alpha( 0.9 ) ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = (rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix);
disp = (rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << getasmatrix);
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set response variable Y.
- Use validation column.
- Include multiple effects.
- Choose Gamma distribution.
- Run elastic net adaptive estimation.
- Get model report.
- Extract solution path.
- Calculate negative log-likelihood.
Example 116
Summary: Generalized regression analysis with elastic net estimation and negative binomial distribution, using the Fit Model platform to generate report objects and extract solution paths, NLL, and parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive, Linear Grid, Alpha( 0.9 ) ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = (rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix);
disp = (rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << getasmatrix);
Code Explanation:
- Open data table;
- Launch Fit Model platform.
- Set response variable Y.
- Use validation column.
- Include multiple effects.
- Choose Generalized Regression personality.
- Select Negative Binomial distribution.
- Run model with Elastic Net.
- Retrieve report object.
- Extract solution path, NLL, and parameter estimates.
Example 117
Summary: Fits a generalized regression model with Poisson distribution to a dataset, utilizing Elastic Net estimation method and validation column for evaluation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive, Linear Grid, Alpha( 0.9 ) ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = (rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix);
Code Explanation:
- Open table.
- Define model object.
- Set response variable.
- Specify validation method.
- Add effects to model.
- Choose personality.
- Set distribution.
- Run fit with Elastic Net.
- Retrieve report.
- Get solution path.
Example 118
Summary: Fits a generalized regression model with elastic net adaptive linear grid to predict Fish Caught, utilizing specified effects and validation column.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Poisson" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive, Linear Grid, Alpha( 0.9 ) ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = (rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix);
scale = (rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << getasmatrix);
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set response variable: Fish Caught.
- Use validation column.
- Include specified effects.
- Choose "Generalized Regression" personality.
- Set distribution to "ZI Poisson".
- Run model with elastic net adaptive linear grid.
- Retrieve report object.
- Extract solution path, negative log-likelihood, and parameter estimates.
Example 119
Summary: Fits a generalized regression model with negative binomial distribution and elastic net estimation method, extracting solution path and validation negative log-likelihood.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive, Linear Grid, Alpha( 0.9 ) ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table.
- Fit generalized regression model.
- Set response variable.
- Specify validation column.
- Define effects.
- Choose personality: Generalized Regression.
- Select negative binomial distribution.
- Run model with elastic net method.
- Extract solution path.
- Get validation negative log-likelihood.
Example 120
Summary: Fits a generalized regression model with elastic net adaptive linear grid to predict fish caught, utilizing a ZI negative binomial distribution and retrieving relevant solution paths and validation metrics.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Negative Binomial" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive, Linear Grid, Alpha( 0.9 ) ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set Fish Caught as response variable.
- Specify Validation column.
- Include live bait, Fishing Poles, camper, People, Children as effects.
- Choose Generalized Regression personality.
- Use ZI Negative Binomial distribution.
- Run model with Elastic Net adaptive linear grid.
- Retrieve model report.
- Extract solution path.
- Get validation negative log-likelihood.
- Extract centered parameter estimates.
- Extract scaled parameter estimates.
Example 121
Summary: Fits a generalized regression model to predict Fish Caught, utilizing adaptive elastic net estimation with ZI Gamma distribution and validation column.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Gamma" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive, Linear Grid, Alpha( 0.9 ) ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data_table data
- Fit generalized regression model.
- Set response variable: Fish Caught.
- Use validation column.
- Include specified effects.
- Choose ZI Gamma distribution.
- Apply adaptive elastic net method.
- Set alpha to 0.9.
- Retrieve model report.
- Extract solution path.
- Get negative log-likelihood.
- Fetch active minimum estimates.
- Retrieve dispersion estimates.
Example 122
Summary: Fits a generalized regression model with Weibull distribution to a dataset, utilizing elastic net estimation and AICc validation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :censor ),
Censor Code( "1" ),
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Weibull" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive, Linear Grid, Alpha( 0.9 ) ) ), Validation Method( AICc ) ) )
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << gettrainingnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open table.
- Fit generalized regression model.
- Set censoring options.
- Specify response variable.
- Define model effects.
- Choose Weibull distribution.
- Run model with elastic net.
- Use AICc for validation.
- Retrieve model report.
- Extract solution path.
Example 123
Summary: Fits a generalized regression model to a data table, utilizing elastic net estimation and AICc validation, while extracting solution path, negative log-likelihood, and parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :censor ),
Censor Code( "1" ),
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Personality( "Generalized Regression" ),
Generalized Distribution( "LogNormal" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive, Linear Grid, Alpha( 0.9 ) ) ), Validation Method( AICc ) ) )
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << gettrainingnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table.
- Fit model with specified parameters.
- Set censor variable and code.
- Define response variable.
- Specify effects for analysis.
- Choose generalized regression personality.
- Select log-normal distribution.
- Run fit with elastic net method.
- Use AICc for validation.
- Extract solution path, negative log-likelihood, and parameter estimates.
Example 124
Summary: Fits a generalized regression model using Exponential distribution and Elastic Net Adaptive estimation, with AICc validation, to analyze the relationship between various predictors and Time.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :censor ),
Censor Code( "1" ),
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Exponential" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( AICc ) ) )
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << gettrainingnegativeloglikelihood);
actmin = (rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix);
Code Explanation:
- Open table.
- Fit model using Fit Model platform.
- Specify censor variable.
- Set censor code.
- Define response variable.
- Add effects to model.
- Choose Generalized Regression personality.
- Select Exponential distribution.
- Run model with Elastic Net Adaptive estimation.
- Use AICc for validation.
Example 125
Summary: Fits a generalized regression model to a data table, utilizing the Gamma distribution and Elastic Net estimation method.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :censor ),
Censor Code( "1" ),
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Gamma" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( AICc ) ) )
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << gettrainingnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
obj << closewindow;
Code Explanation:
- Open data table;
- Initiate Fit Model.
- Set censor variable.
- Define censor code.
- Specify response variable.
- Add effects variables.
- Choose Generalized Regression personality.
- Select Gamma distribution.
- Run model with Elastic Net method.
- Retrieve report and solution path.
Example 126
Summary: Fits and creates reports for generalized regression models with LogNormal and Exponential distributions, utilizing Elastic Net estimation method and AICc validation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :censor ),
Censor Code( "1" ),
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Personality( "Generalized Regression" ),
Generalized Distribution( "LogNormal" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive, Linear Grid, Alpha( 0.9 ) ) ), Validation Method( AICc ) ) )
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << gettrainingnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :censor ),
Censor Code( "1" ),
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Exponential" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( AICc ) ) )
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << gettrainingnegativeloglikelihood);
actmin = (rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix);
Code Explanation:
- Open data_table data
- Fit generalized regression model.
- Set censor variable.
- Define response variable.
- Specify model effects.
- Choose personality: Generalized Regression.
- Select LogNormal distribution.
- Run fit with Elastic Net, Adaptive method, Linear Grid, Alpha 0.9.
- Validate using AICc.
- Retrieve solution path, negative log-likelihood, and parameter estimates.
- Open VA Lung Cancer data again.
- Fit generalized regression model.
- Set censor variable.
- Define response variable.
- Specify model effects.
- Choose personality: Generalized Regression.
- Select Exponential distribution.
- Run fit with Elastic Net, Adaptive method.
- Validate using AICc.
- Retrieve solution path, negative log-likelihood, and parameter estimates.
Example 127
Summary: Fits a generalized regression model with gamma distribution and elastic net adaptive method, using AICc for validation, and extracts solution path and parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :censor ),
Censor Code( "1" ),
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Gamma" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( AICc ) ) )
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << gettrainingnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open table.
- Fit generalized regression model.
- Set censor variable.
- Set censor code.
- Set response variable.
- Define effects.
- Use gamma distribution.
- Run elastic net adaptive method.
- Validate using AICc.
- Extract solution path.
Example 128
Summary: Generalized regression analysis to estimate model parameters and retrieve solution path, negative log-likelihood, and parameter estimates from a specified data table.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
No Intercept,
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Start Fit Model platform.
- Set Y variable.
- Use Validation column.
- Exclude intercept term.
- Include specified effects.
- Choose Generalized Regression personality.
- Specify Normal distribution.
- Run Elastic Net Adaptive estimation.
- Retrieve solution path, negative log-likelihood, and parameter estimates.
Example 129
Summary: Generalized regression analysis to predict the response variable Y, incorporating specified effects and using adaptive estimation with Poisson distribution.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
No Intercept,
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Start Fit Model analysis.
- Set response variable to Y.
- Use Validation column.
- Include specified effects.
- Choose Generalized Regression personality.
- Exclude intercept term.
- Specify Poisson distribution.
- Run Elastic Net adaptive estimation.
- Validate using validation column.
Example 130
Summary: Fits a generalized regression model with specified effects, personality, and distribution to a data table, generating a report object and retrieving solution path and negative log-likelihood values.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
No Intercept,
Generalized Distribution( "Exponential" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Fit model with specified parameters.
- Use Generalized Regression personality.
- Exclude intercept from model.
- Set Exponential distribution.
- Apply Elastic Net adaptive method.
- Validate using Validation column.
- Retrieve report object.
- Get solution path.
- Calculate negative log-likelihood.
Example 131
Summary: Fits a generalized regression model to a data table, utilizing elastic net adaptive estimation and retrieving the solution path.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Gamma" ),
No Intercept,
Run( Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set response variable Y.
- Use validation column.
- Include specified effects.
- Choose Gamma distribution.
- Exclude intercept.
- Run elastic net adaptive estimation.
- Retrieve model report.
- Extract solution path.
Example 132
Summary: Fits a generalized regression model to a data table, utilizing negative binomial distribution and elastic net adaptive estimation method.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
No Intercept,
Run( Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set response variable to Y.
- Use validation column for validation.
- Include specified effects in model.
- Choose negative binomial distribution.
- Exclude intercept from model.
- Run elastic net adaptive estimation method.
- Retrieve solution path.
- Get validation negative log-likelihood.
- Extract centered and scaled parameter estimates.
- Extract dispersions.
Example 133
Summary: Fits a generalized regression model using Poisson distribution, excluding intercept, and retrieving solution path, negative log-likelihood, and parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Poisson" ),
No Intercept,
Run( Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open table.
- Fit model using Generalized Regression.
- Specify Poisson distribution.
- Exclude intercept.
- Use Elastic Net adaptive method.
- Validate using column.
- Generate report.
- Retrieve solution path.
- Get negative log-likelihood.
- Extract parameter estimates.
Example 134
Summary: Fits a generalized regression model to predict 'Fish Caught' using live bait, Fishing Poles, camper, People, and Children as effects, with adaptive elastic net estimation and ZI Poisson distribution.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Poisson" ),
No Intercept,
Run( Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set response variable: "Fish Caught".
- Use validation column: "Validation".
- Include effects: live bait, Fishing Poles, camper, People, Children.
- Choose "Generalized Regression" personality.
- Specify "ZI Poisson" distribution.
- Exclude intercept from model.
- Run model with adaptive elastic net estimation.
- Retrieve solution path, negative log-likelihood, and parameter estimates.
Example 135
Summary: Fits a generalized negative binomial model to a dataset, with elastic net adaptive estimation and validation, and retrieves solution path and active minimum estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
No Intercept,
Run( Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open table.
- Fit model with specified parameters.
- Set response variable.
- Specify validation method.
- Define effects.
- Choose model personality.
- Set distribution type.
- Exclude intercept.
- Run elastic net adaptive estimation.
- Retrieve solution path.
- Get negative log-likelihood.
- Extract active minimum estimates.
- Extract dispersion estimates.
Example 136
Summary: Fits a generalized regression model with ZI Negative Binomial distribution and Elastic Net adaptive method, using validation column for validation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Negative Binomial" ),
No Intercept,
Run( Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit a generalized regression model.
- Set the response variable to Fish Caught.
- Use validation column for validation.
- Include specified effects in the model.
- Choose ZI Negative Binomial distribution.
- Exclude intercept from the model.
- Fit using Elastic Net adaptive method.
- Retrieve the solution path.
- Get the negative log-likelihood of validation.
Example 137
Summary: Fits a Generalized Regression model with ZI Gamma distribution to predict Fish Caught, using Adaptive Elastic Net estimation and Validation Column method.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Gamma" ),
No Intercept,
Run( Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Create a Fit Model object.
- Set the response variable to Fish Caught.
- Use the Validation column for validation.
- Include live bait, Fishing Poles, camper, People, Children as effects.
- Choose Generalized Regression personality.
- Specify ZI Gamma distribution.
- Exclude the intercept from the model.
- Fit the model using Adaptive Elastic Net estimation.
- Validate the model using the Validation Column method.
Example 138
Summary: Fits a generalized regression model to a data table, extracting solution path, negative log-likelihood, and parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
No Intercept,
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive, Linear Grid, Alpha( 0.9 ) ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Launch Fit Model platform.
- Set response variable as Y.
- Use validation column.
- Exclude intercept from model.
- Include multiple predictors.
- Choose Generalized Regression personality.
- Specify Normal distribution.
- Run Elastic Net estimation.
- Extract solution path, negative log-likelihood, and parameter estimates.
Example 139
Summary: Fits a generalized regression model to a data table, utilizing an Elastic Net adaptive estimation method and Poisson distribution.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
No Intercept,
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive, Linear Grid, Alpha( 0.9 ) ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set response variable Y.
- Specify validation column.
- Define model effects.
- Choose Generalized Regression personality.
- Exclude intercept from model.
- Select Poisson distribution.
- Run Elastic Net adaptive estimation.
- Use validation column method.
Example 140
Summary: Generalized regression analysis to predict continuous outcomes, utilizing the Fit Model platform with an Exponential distribution and Elastic Net estimation method.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
No Intercept,
Generalized Distribution( "Exponential" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive, Linear Grid, Alpha( 0.9 ) ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Launch Fit Model platform.
- Set response variable.
- Specify validation column.
- Add predictor effects.
- Choose Generalized Regression personality.
- Exclude intercept term.
- Select Exponential distribution.
- Run Elastic Net with adaptive method.
- Extract solution path, validation negative log-likelihood, and parameter estimates.
Example 141
Summary: Generalized regression analysis on a data table, using the Fit Model platform to estimate model parameters and validate results.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Gamma" ),
No Intercept,
Run( Fit( Estimation Method( Elastic Net( Adaptive, Linear Grid, Alpha( 0.9 ) ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = (rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix);
disp = (rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << getasmatrix);
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set Y variable to :Y.
- Specify validation using :Validation.
- Include multiple effects variables.
- Choose Generalized Regression personality.
- Select Gamma distribution.
- Exclude intercept from model.
- Run model with Elastic Net method.
- Extract solution path, negative log-likelihood, and parameter estimates.
Example 142
Summary: Fits a generalized negative binomial regression model to a data table, using elastic net estimation with adaptive method and excluding an intercept term.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
No Intercept,
Run( Fit( Estimation Method( Elastic Net( Adaptive, Linear Grid, Alpha( 0.9 ) ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = (rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix);
disp = (rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << getasmatrix);
obj << closewindow;
Code Explanation:
- Open data table;
- Launch Fit Model platform.
- Set response variable Y.
- Use validation column.
- Include multiple effects.
- Choose Generalized Regression personality.
- Specify Negative Binomial distribution.
- Exclude intercept term.
- Run Elastic Net with Adaptive method.
- Retrieve solution path, negative log-likelihood, and parameter estimates.
Example 143
Summary: Fits a generalized regression model to predict 'Fish Caught' using Poisson distribution, with adaptive elastic net regularization and no intercept.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Poisson" ),
No Intercept,
Run( Fit( Estimation Method( Elastic Net( Adaptive, Linear Grid, Alpha( 0.9 ) ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table.
- Launch Fit Model platform.
- Set response variable to "Fish Caught".
- Specify validation column.
- Add effects: live bait, Fishing Poles, camper, People, Children.
- Choose "Generalized Regression" personality.
- Set distribution to Poisson.
- Exclude intercept from model.
- Run model with Elastic Net adaptive linear grid, alpha 0.9.
- Use validation column for method.
Example 144
Summary: Fits a generalized regression model to predict 'Fish Caught' using elastic net adaptive linear grid with alpha 0.9, and retrieves solution path, validation negative log-likelihood, and parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Poisson" ),
No Intercept,
Run( Fit( Estimation Method( Elastic Net( Adaptive, Linear Grid, Alpha( 0.9 ) ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = (rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix) |/ (
rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << getasmatrix);
Code Explanation:
- Open data table.
- Launch Fit Model platform.
- Set response variable "Fish Caught".
- Specify validation column "Validation".
- Include effects: "live bait", "Fishing Poles", "camper", "People", "Children".
- Choose "Generalized Regression" personality.
- Use "ZI Poisson" distribution.
- Exclude intercept from model.
- Run model with Elastic Net adaptive linear grid, alpha 0.9.
- Retrieve solution path, validation negative log-likelihood, and parameter estimates.
Example 145
Summary: Fits a generalized regression model with negative binomial distribution to predict fish caught, using elastic net estimation and excluding intercept.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
No Intercept,
Run( Fit( Estimation Method( Elastic Net( Adaptive, Linear Grid, Alpha( 0.9 ) ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit model with specified settings.
- Set response variable: Fish Caught.
- Use validation column: Validation.
- Include effects: live bait, Fishing Poles, camper, People, Children.
- Choose Generalized Regression personality.
- Select Negative Binomial distribution.
- Exclude intercept from model.
- Run model with Elastic Net method.
- Retrieve solution path, negative log-likelihood, and parameter estimates.
Example 146
Summary: Fits a generalized regression model with ZI Negative Binomial distribution to predict 'Fish Caught' using specified effects and validation column, generating a report and extracting solution path.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Negative Binomial" ),
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit model with specified settings.
- Set response variable: "Fish Caught".
- Use validation column for validation.
- Include specified effects in model.
- Choose "Generalized Regression" personality.
- Set distribution to "ZI Negative Binomial".
- Run fit with Lasso method on linear grid.
- Extract report from fit object.
- Get solution path from fit object.
Example 147
Summary: Fits a generalized regression model with Elastic Net estimation and ZI Gamma distribution to predict 'Fish Caught' based on various effects, excluding an intercept.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Gamma" ),
No Intercept,
Run( Fit( Estimation Method( Elastic Net( Adaptive, Linear Grid, Alpha( 0.9 ) ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open table.
- Define model object.
- Set response variable.
- Specify validation column.
- Add effects.
- Choose personality.
- Set distribution.
- Exclude intercept.
- Run fit with Elastic Net.
- Retrieve report.
Example 148
Summary: Fits a generalized regression model to a data table, utilizing the Fit Model platform with Elastic Net estimation and Negative Binomial distribution.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
No Intercept,
Run( Fit( Estimation Method( Elastic Net( Adaptive, Linear Grid, Alpha( 0.9 ) ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = (rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix);
disp = (rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << getasmatrix);
Code Explanation:
- Open data table;
- Launch Fit Model platform.
- Set response variable Y.
- Specify validation column.
- Add multiple effects.
- Choose Generalized Regression personality.
- Select Negative Binomial distribution.
- Exclude intercept from model.
- Run model with Elastic Net method.
- Extract solution path, negative log-likelihood, and parameter estimates.
Example 149
Summary: Fits a generalized regression model to a data table, utilizing adaptive Lasso estimation and validation methods.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set response variable Y.
- Use validation column.
- Include multiple effects.
- Choose normal distribution.
- Run adaptive Lasso estimation.
- Use validation method.
- Extract model report.
- Retrieve solution path.
- Get negative log likelihood.
- Extract parameter estimates.
- Extract scale estimates.
Example 150
Summary: Generalized regression analysis process to fit a Poisson distribution model, incorporating multiple predictor variables and adaptive Lasso estimation method.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Initiate Fit Model process.
- Set response variable as Y.
- Use Validation column for validation.
- Include multiple predictor variables.
- Choose Generalized Regression personality.
- Specify Poisson distribution.
- Run Lasso (Adaptive) estimation method.
- Validate using Validation Column method.
- Extract solution path, negative log likelihood, and parameter estimates.
Example 151
Summary: Fits a generalized regression model to a data table, utilizing adaptive Lasso estimation and an exponential distribution.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Exponential" ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set response variable.
- Specify validation column.
- Define model effects.
- Choose Generalized Regression personality.
- Select Exponential distribution.
- Run model with Adaptive Lasso estimation.
- Retrieve model report.
- Extract solution path.
Example 152
Summary: Fits a generalized regression model to a data table, utilizing adaptive Lasso estimation and gamma distribution, and retrieves relevant reports and estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Gamma" ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix;
disp = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << get as matrix;
Code Explanation:
- Open data table;
- Fit model using Generalized Regression.
- Set Gamma distribution.
- Use Adaptive Lasso estimation method.
- Validate using Validation column.
- Retrieve fit object report.
- Extract solution path.
- Get validation negative log-likelihood.
- Extract centered/scaled predictors estimates.
- Extract original predictors estimates.
Example 153
Summary: Fits a generalized regression model with negative binomial distribution and adaptive Lasso estimation, extracting key metrics from the report.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix;
disp = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << get as matrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set response variable Y.
- Specify validation column.
- Include multiple predictor effects.
- Choose negative binomial distribution.
- Run adaptive Lasso estimation.
- Use validation column method.
- Extract model report.
- Retrieve solution path.
- Get validation negative log-likelihood.
- Extract centered parameter estimates.
- Extract scaled parameter estimates.
Example 154
Summary: Fits a generalized regression model with Poisson distribution to predict 'Fish Caught' using specified effects, and retrieves model report, solution path, and negative log-likelihood values.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table.
- Fit model with "Fish Caught" as response.
- Use "Validation" column for validation.
- Include specified effects in model.
- Choose "Generalized Regression" personality.
- Set distribution to "Poisson".
- Run model with adaptive Lasso estimation.
- Retrieve model report.
- Get solution path from fit.
- Extract negative log-likelihood values.
- Fetch parameter estimates matrix.
Example 155
Summary: Fits a generalized regression model with ZI Poisson distribution and adaptive Lasso estimation, utilizing validation column for model evaluation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Poisson" ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix;
scale = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open table.
- Fit generalized regression model.
- Set response variable.
- Specify validation column.
- Define effects.
- Choose ZI Poisson distribution.
- Use adaptive Lasso estimation.
- Validate using validation column.
- Retrieve report object.
- Extract solution path.
- Get validation negative log likelihood.
- Fetch parameter estimates matrix.
- Fetch scaling estimates matrix.
Example 156
Summary: Fits a generalized regression model with adaptive Lasso estimation and Negative Binomial distribution to predict Fish Caught, utilizing validation column for validation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix;
disp = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << get as matrix;
Code Explanation:
- Open data table;
- Fit a generalized regression model.
- Set response variable: Fish Caught.
- Use validation column for validation.
- Include specified effects in the model.
- Choose Generalized Regression personality.
- Specify Negative Binomial distribution.
- Run the model with adaptive Lasso estimation.
- Retrieve the model report.
- Extract the solution path and validation negative log-likelihood.
Example 157
Summary: Generalized regression analysis with adaptive Lasso estimation to model the relationship between 'Fish Caught' and various effects, generating a report with solution path and validation negative log-likelihood.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Negative Binomial" ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix;
disp = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << get as matrix;
Code Explanation:
- Open data table;
- Launch Fit Model platform.
- Set response variable: Fish Caught.
- Use validation column: Validation.
- Include effects: live bait, Fishing Poles, camper, People, Children.
- Choose Generalized Regression personality.
- Select ZI Negative Binomial distribution.
- Run model with Adaptive Lasso estimation.
- Retrieve model report.
- Extract solution path and validation negative log-likelihood.
Example 158
Summary: Fits a generalized regression model to predict Fish Caught, utilizing adaptive Lasso estimation and ZI Gamma distribution.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Gamma" ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix;
disp = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << get as matrix;
Code Explanation:
- Open data table;
- Fit a generalized regression model.
- Set the response variable to Fish Caught.
- Use validation column for validation.
- Include specified effects in the model.
- Choose Generalized Regression personality.
- Set distribution to ZI Gamma.
- Run the model with adaptive Lasso estimation.
- Retrieve the model report.
- Extract the solution path, validation negative log-likelihood, and parameter estimates.
Example 159
Summary: Fits a generalized regression model with Weibull distribution and adaptive Lasso estimation to analyze the relationship between multiple effects and response variable, while accounting for censoring.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :censor ),
Censor Code( "1" ),
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Weibull" ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( AICc ) ) )
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << gettrainingnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix;
scale = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data_table data
- Fit generalized regression model.
- Specify censor variable.
- Set censor code.
- Define response variable.
- Include multiple effects.
- Choose Weibull distribution.
- Run adaptive Lasso estimation.
- Use AICc validation.
- Extract solution path.
Example 160
Summary: Fits a generalized regression model with censoring and adaptive Lasso estimation, generating a report and extracting solution path and training negative log-likelihood.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :censor ),
Censor Code( "1" ),
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Personality( "Generalized Regression" ),
Generalized Distribution( "LogNormal" ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( AICc ) ) )
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << gettrainingnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
scale = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data_table data
- Fit model with censoring.
- Set censor code.
- Define response variable.
- Specify effects variables.
- Choose generalized regression.
- Set log-normal distribution.
- Run adaptive lasso estimation.
- Retrieve fit report.
- Extract solution path.
Example 161
Summary: Fits a generalized regression model to a data table, including multiple predictor effects and validation column, and retrieves parameter estimates and scales.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Lasso( Adaptive, Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Launch Fit Model platform.
- Set response variable Y.
- Use Validation column.
- Include multiple predictor effects.
- Choose Generalized Regression personality.
- Specify Normal distribution.
- Run Lasso regression with adaptive linear grid.
- Retrieve validation negative log-likelihood.
- Extract parameter estimates and scales.
Example 162
Summary: Fits a Generalized Regression model to a data table, utilizing Lasso regression with an adaptive linear grid and retrieving key metrics such as negative log-likelihood.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Lasso( Adaptive, Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Fit Generalized Regression model.
- Set response variable Y.
- Use validation column.
- Include multiple predictor effects.
- Choose Poisson distribution.
- Run Lasso regression with adaptive linear grid.
- Retrieve model report.
- Get solution path.
- Fetch negative log-likelihood.
Example 163
Summary: Generalized regression analysis on a data table, utilizing the Fit Model platform to estimate model parameters and retrieve solution paths.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Exponential" ),
Run( Fit( Estimation Method( Lasso( Adaptive, Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Start Fit Model platform.
- Set Y variable as :Y.
- Use :Validation for validation.
- Include multiple effects.
- Choose Generalized Regression personality.
- Specify Exponential distribution.
- Run model with Adaptive Lasso method.
- Retrieve model report.
- Extract solution path.
- Get validation negative log-likelihood.
- Fetch parameter estimates matrix.
Example 164
Summary: Generalized regression analysis with adaptive Lasso estimation and validation, extracting solution paths and negative log-likelihood values from the fitted model.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Gamma" ),
Run( Fit( Estimation Method( Lasso( Adaptive, Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
disp = (rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << getasmatrix);
Code Explanation:
- Open data table;
- Start Fit Model process.
- Set response variable Y.
- Use validation column.
- Include multiple effects.
- Choose Generalized Regression personality.
- Specify Gamma distribution.
- Run model with Adaptive Lasso.
- Extract solution path.
- Get validation negative log-likelihood.
Example 165
Summary: Fits a generalized regression model to a data table, utilizing adaptive Lasso and linear grid estimation methods, and generates a report with parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
Run( Fit( Estimation Method( Lasso( Adaptive, Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
disp = (rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << getasmatrix);
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set response variable Y.
- Specify validation column.
- Define model effects.
- Choose Generalized Regression personality.
- Select Negative Binomial distribution.
- Run model with Adaptive Lasso and Linear Grid.
- Extract model report.
- Retrieve solution path.
Example 166
Summary: Performs the generalized regression modeling process for a Poisson-distributed response variable, incorporating specified effects and validation column, and generates a report with parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Lasso( Adaptive, Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Initiate Fit Model process.
- Set response variable: Fish Caught.
- Use Validation column for validation.
- Include specified effects in model.
- Choose Generalized Regression personality.
- Select Poisson distribution for generalized regression.
- Run the model with Adaptive Lasso and Linear Grid estimation.
- Retrieve the model report.
- Extract solution path from fit.
- Get validation negative log-likelihood.
- Fetch parameter estimates matrix.
Example 167
Summary: Fits a generalized regression model with adaptive Lasso estimation and ZI Poisson distribution to predict 'Fish Caught' based on specified effects, then generates reports and extracts solution path, negative log-likelihood, and parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Poisson" ),
Run( Fit( Estimation Method( Lasso( Adaptive, Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
scale = (rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << getasmatrix);
Code Explanation:
- Open data table.
- Fit generalized regression model.
- Set response variable to "Fish Caught".
- Use "Validation" column for validation.
- Include specified effects in the model.
- Choose "Generalized Regression" personality.
- Select "ZI Poisson" distribution.
- Run fit with adaptive Lasso method.
- Retrieve model report.
- Extract solution path, negative log-likelihood, and parameter estimates.
Example 168
Summary: Fits a generalized regression model to predict 'Fish Caught' using negative binomial distribution, with adaptive Lasso estimation and validation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
Run( Fit( Estimation Method( Lasso( Adaptive, Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open table.
- Fit model using generalized regression.
- Set response variable.
- Specify validation column.
- Define effects.
- Choose negative binomial distribution.
- Run fit with adaptive lasso.
- Retrieve report.
- Get solution path.
- Get validation negative log likelihood.
Example 169
Summary: Fits a generalized regression model with adaptive Lasso and linear grid, using 'ZI Negative Binomial' distribution to predict 'Fish Caught' based on specified effects.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Negative Binomial" ),
Run( Fit( Estimation Method( Lasso( Adaptive, Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Start fitting a model.
- Set response variable: "Fish Caught".
- Use "Validation" column for validation.
- Include specified effects in model.
- Choose "Generalized Regression" personality.
- Set distribution to "ZI Negative Binomial".
- Run model with adaptive Lasso and linear grid.
- Extract model report.
- Retrieve solution path from fit.
Example 170
Summary: Generalized regression analysis process for a data table, specifying effects, personality, and distribution parameters to generate model reports and extract solution paths.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Gamma" ),
Run( Fit( Estimation Method( Lasso( Adaptive, Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table.
- Initiate Fit Model process.
- Set response variable to "Fish Caught".
- Specify validation method using "Validation" column.
- Include effects: live bait, Fishing Poles, camper, People, Children.
- Choose "Generalized Regression" personality.
- Select "ZI Gamma" distribution.
- Run model with adaptive Lasso method on linear grid.
- Retrieve model report.
- Extract solution path and validation negative log likelihood.
- Get active minimum parameter estimates matrix.
- Fetch displayed parameter estimates matrix.
Example 171
Summary: Fits a generalized regression model to a data table, specifying censoring and response variables, predictor effects, and distribution, while utilizing Lasso estimation and AICc validation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :censor ),
Censor Code( "1" ),
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Weibull" ),
Run( Fit( Estimation Method( Lasso( Adaptive, Linear Grid ) ), Validation Method( AICc ) ) )
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << gettrainingnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Specify censoring variable.
- Set censor code.
- Define response variable.
- Add predictor effects.
- Choose Weibull distribution.
- Run Lasso estimation.
- Use AICc validation.
- Extract solution path.
Example 172
Summary: Fits a generalized regression model to a data table, utilizing Lasso Adaptive Linear Grid estimation and AICc validation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :censor ),
Censor Code( "1" ),
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Personality( "Generalized Regression" ),
Generalized Distribution( "LogNormal" ),
Run( Fit( Estimation Method( Lasso( Adaptive, Linear Grid ) ), Validation Method( AICc ) ) )
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << gettrainingnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
If( Host is( "Windows" ), , );
Code Explanation:
- Open data table;
- Fit model using Fit Model platform.
- Specify censor variable and code.
- Set response variable as Time.
- Include multiple effects in the model.
- Choose Generalized Regression personality.
- Select LogNormal distribution.
- Run the model with Lasso Adaptive Linear Grid estimation.
- Use AICc for validation.
- Extract report and solution path.
Example 173
Summary: Fits a generalized regression model to a data table, utilizing Lasso regression with adaptive linear grid and AICc validation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :censor ),
Censor Code( "1" ),
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Exponential" ),
Run( Fit( Estimation Method( Lasso( Adaptive, Linear Grid ) ), Validation Method( AICc ) ) )
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << gettrainingnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table.
- Fit model using Generalized Regression.
- Set censor variable.
- Specify censor code.
- Define response variable.
- Add predictor effects.
- Choose Exponential distribution.
- Run Lasso regression with adaptive linear grid.
- Use AICc for validation.
- Extract solution path, negative log-likelihood, and parameter estimates.
Example 174
Summary: Fits a generalized regression model to a data table, utilizing adaptive Lasso estimation and AICc validation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :censor ),
Censor Code( "1" ),
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Gamma" ),
Run( Fit( Estimation Method( Lasso( Adaptive, Linear Grid ) ), Validation Method( AICc ) ) )
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << gettrainingnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table.
- Start fitting model.
- Specify censor variable.
- Define censor code.
- Set response variable.
- Include effect variables.
- Choose generalized regression personality.
- Select gamma distribution.
- Run fit with adaptive Lasso.
- Extract solution path, negative log-likelihood, and parameter estimates.
Example 175
Summary: Performs the generalized regression modeling process for a data table, utilizing adaptive Lasso and linear grid estimation methods to generate solution paths, negative log-likelihood values, and parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :censor ),
Censor Code( "1" ),
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Personality( "Generalized Regression" ),
Generalized Distribution( "LogNormal" ),
Run( Fit( Estimation Method( Lasso( Adaptive, Linear Grid ) ), Validation Method( AICc ) ) )
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << gettrainingnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table.
- Start Fit Model process.
- Set censor variable.
- Define censor code.
- Specify response variable.
- List model effects.
- Choose Generalized Regression personality.
- Select LogNormal distribution.
- Run model with adaptive Lasso and Linear Grid.
- Extract solution path, negative log-likelihood, and parameter estimates.
Example 176
Summary: Fits a generalized regression model to a data table, excluding an intercept term and including specified effects, with adaptive Lasso estimation and normal distribution.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
No Intercept,
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit model using Fit Model platform.
- Set response variable as Y.
- Use validation column.
- Exclude intercept term.
- Include specified effects.
- Choose Generalized Regression personality.
- Specify Normal distribution.
- Run model with Adaptive Lasso estimation.
- Retrieve report object.
Example 177
Summary: Generalized regression analysis on the specified data table, using Lasso with Adaptive method and Poisson distribution to estimate model parameters.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
No Intercept,
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set Y variable to :Y.
- Use :Validation for validation.
- Include specified effects in model.
- Choose Generalized Regression personality.
- Exclude intercept from model.
- Set distribution to Poisson.
- Run Lasso with Adaptive method.
- Extract solution path, negative log-likelihood, and parameter estimates.
Example 178
Summary: Performs the generalized regression modeling process, fitting an exponential distribution to predict continuous outcomes while excluding intercept and using adaptive Lasso estimation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
No Intercept,
Generalized Distribution( "Exponential" ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Start Fit Model process.
- Set response variable.
- Specify validation column.
- Define predictor variables.
- Choose Generalized Regression personality.
- Exclude intercept from model.
- Select Exponential distribution.
- Run adaptive Lasso estimation.
- Retrieve model report.
Example 179
Summary: Fits a generalized regression model to a data table, utilizing adaptive Lasso estimation and excluding an intercept term.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Gamma" ),
No Intercept,
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix;
disp = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << get as matrix;
Code Explanation:
- Open data table;
- Fit model using Generalized Regression.
- Set Gamma distribution.
- Exclude intercept term.
- Use Adaptive Lasso method.
- Validate using specified column.
- Retrieve model report.
- Extract solution path.
- Get negative log-likelihood.
- Fetch actual minimum estimates.
Example 180
Summary: Fits a Generalized Regression model with Negative Binomial distribution, excluding intercept and using Lasso estimation method with adaptive validation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
No Intercept,
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix;
disp = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << get as matrix;
Code Explanation:
- Open data table;
- Fit model with specified effects.
- Use Generalized Regression personality.
- Set Negative Binomial distribution.
- Exclude intercept from model.
- Run Lasso with adaptive method.
- Validate using validation column.
- Retrieve model report.
- Get solution path.
- Obtain negative log-likelihood.
Example 181
Summary: Fits a generalized regression model with Poisson distribution to predict Fish Caught, using Adaptive Lasso estimation and validation column for validation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Poisson" ),
No Intercept,
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table.
- Start fitting a model.
- Set the response variable to Fish Caught.
- Use Validation column for validation.
- Include specified effects in the model.
- Choose Generalized Regression personality.
- Specify Poisson distribution.
- Exclude intercept from the model.
- Run the model with Adaptive Lasso estimation.
- Use Validation Column method for validation.
Example 182
Summary: Generalized regression analysis with ZI Poisson distribution to model the relationship between 'Fish Caught' and various effects, excluding intercept and using Adaptive Lasso estimation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Poisson" ),
No Intercept,
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix;
scale = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set response variable: "Fish Caught".
- Specify validation column: "Validation".
- Define effects: live bait, Fishing Poles, camper, People, Children.
- Choose "Generalized Regression" personality.
- Select "ZI Poisson" distribution.
- Exclude intercept from model.
- Run model with Adaptive Lasso estimation.
- Retrieve model report.
- Extract solution path.
- Get negative log-likelihood.
- Fetch actual minimum estimates matrix.
- Obtain scaling matrix.
Example 183
Summary: Fits a generalized negative binomial model to predict fish caught, utilizing adaptive Lasso estimation and excluding an intercept.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
No Intercept,
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix;
disp = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << get as matrix;
Code Explanation:
- Open table.
- Define model object.
- Set response variable.
- Specify validation column.
- Add predictor effects.
- Choose model personality.
- Select distribution.
- Exclude intercept.
- Run model with adaptive Lasso.
- Retrieve solution path.
- Get negative log-likelihood.
- Extract active minimum estimates.
- Obtain dispersion estimates.
Example 184
Summary: Fits a Generalized Regression model with ZI Negative Binomial distribution to predict Fish Caught, utilizing Lasso estimation and retrieving solution path, validation negative log-likelihood, and centered/scaled parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Negative Binomial" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix;
disp = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << get as matrix;
Code Explanation:
- Open data table;
- Launch Fit Model platform.
- Set response variable to Fish Caught.
- Specify validation column.
- Define model effects.
- Choose Generalized Regression personality.
- Select ZI Negative Binomial distribution.
- Run model with Lasso estimation.
- Extract model report.
- Retrieve solution path.
- Get validation negative log-likelihood.
- Extract centered parameter estimates.
- Extract scaled parameter estimates.
Example 185
Summary: Generalized regression analysis with ZI Gamma distribution, using Lasso (Adaptive) estimation method and Validation Column validation on the 'Fish Caught' response variable.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Gamma" ),
No Intercept,
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix;
disp = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << get as matrix;
Code Explanation:
- Open data table.
- Start Fit Model process.
- Set response variable: "Fish Caught".
- Use "Validation" column for validation.
- Include specified effects in model.
- Choose "Generalized Regression" personality.
- Set distribution to "ZI Gamma".
- Exclude intercept from model.
- Run Lasso (Adaptive) estimation method.
- Validate using Validation Column method.
Example 186
Summary: Fits a generalized regression model to a data table, utilizing Lasso estimation and extracting solution paths, scale estimates, and negative log-likelihood.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
No Intercept,
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Lasso( Adaptive, Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Initiate Fit Model.
- Set response variable.
- Specify validation column.
- Exclude intercept term.
- Define predictor effects.
- Choose Generalized Regression personality.
- Set Normal distribution.
- Run Lasso estimation.
- Extract solution path.
- Get negative log-likelihood.
- Retrieve parameter estimates.
- Fetch scale estimates.
Example 187
Summary: Fits a generalized regression model to predict continuous outcomes using Poisson distribution, with adaptive Lasso estimation and linear grid for Lasso.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
No Intercept,
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Lasso( Adaptive, Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set response variable Y.
- Specify validation column.
- Include multiple predictor effects.
- Choose generalized regression personality.
- Exclude intercept term.
- Use Poisson distribution.
- Apply adaptive Lasso estimation.
- Use linear grid for Lasso.
Example 188
Summary: Fits a generalized regression model to a data table, utilizing multiple predictors and excluding an intercept term.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
No Intercept,
Generalized Distribution( "Exponential" ),
Run( Fit( Estimation Method( Lasso( Adaptive, Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Launch Fit Model platform.
- Set response variable Y.
- Use validation column.
- Include multiple predictors.
- Choose Generalized Regression personality.
- Exclude intercept term.
- Specify Exponential distribution.
- Run model with Adaptive Lasso and Linear Grid.
- Retrieve solution path.
- Get negative log-likelihood.
- Extract parameter estimates matrix.
Example 189
Summary: Fits a generalized regression model to a data table, using adaptive Lasso estimation and excluding an intercept term.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Gamma" ),
No Intercept,
Run( Fit( Estimation Method( Lasso( Adaptive, Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
disp = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << get as matrix;
Code Explanation:
- Open data table;
- Fit model with specified variables.
- Use generalized regression personality.
- Set Gamma distribution.
- Exclude intercept term.
- Apply adaptive Lasso estimation method.
- Use validation column for validation.
- Generate report from fit object.
- Retrieve solution path.
- Get negative log-likelihood for validation.
Example 190
Summary: Fits a generalized regression model with negative binomial distribution, excluding intercept and using Lasso adaptive linear grid estimation, to analyze the relationship between Y and multiple predictor variables.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
No Intercept,
Run( Fit( Estimation Method( Lasso( Adaptive, Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
disp = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << get as matrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set response variable to Y.
- Use validation column.
- Include multiple predictor variables.
- Choose negative binomial distribution.
- Exclude intercept from model.
- Run Lasso adaptive linear grid estimation.
- Use validation column method.
- Retrieve solution path, NLL, estimates, and dispersions.
Example 191
Summary: Fits a generalized regression model to predict Fish Caught using Poisson distribution, with Lasso estimation and adaptive linear grid, and retrieves solution path and negative log-likelihood.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Poisson" ),
No Intercept,
Run( Fit( Estimation Method( Lasso( Adaptive, Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open table.
- Fit model.
- Set response variable.
- Specify validation method.
- Define effects.
- Choose personality.
- Select distribution.
- Exclude intercept.
- Run fit with Lasso.
- Retrieve solution path.
- Get negative log-likelihood.
- Extract parameter estimates.
Example 192
Summary: Fits a generalized regression model to predict 'Fish Caught' using 'live bait', 'Fishing Poles', 'camper', 'People', and 'Children' as predictors, with Lasso estimation method and ZI Poisson distribution.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Poisson" ),
No Intercept,
Run( Fit( Estimation Method( Lasso( Adaptive, Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix;
scale = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open table.
- Define model object.
- Specify response variable.
- Set validation column.
- Define effects.
- Choose model personality.
- Select distribution.
- Exclude intercept.
- Fit model with Lasso method.
- Extract solution path.
- Get negative log-likelihood.
- Retrieve actual minimum estimates.
- Obtain scaling matrix.
Example 193
Summary: Fits a generalized negative binomial regression model to a data table, utilizing adaptive Lasso estimation and excluding an intercept.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
No Intercept,
Run( Fit( Estimation Method( Lasso( Adaptive, Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix;
disp = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << get as matrix;
Code Explanation:
- Open data table.
- Start fitting model.
- Set response variable.
- Specify validation column.
- Define predictor effects.
- Choose generalized regression personality.
- Select negative binomial distribution.
- Exclude intercept from model.
- Run model with adaptive Lasso method.
- Extract solution path, NLL, and parameter estimates.
Example 194
Summary: Fits a generalized negative binomial model to predict fish caught, utilizing Lasso estimation and validation, with subsequent report generation and extraction of solution path, negative log-likelihood, and parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Negative Binomial" ),
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix;
disp = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << get as matrix;
Code Explanation:
- Open table.
- Fit model.
- Specify response variable.
- Set validation method.
- Define effects.
- Choose personality.
- Select distribution.
- Run fit with Lasso.
- Retrieve report.
- Extract solution path.
- Get negative log-likelihood.
- Fetch actual minimum estimates.
- Obtain dispersion estimates.
Example 195
Summary: Fits a generalized regression model with adaptive Lasso estimation and ZI Gamma distribution to predict 'Fish Caught' based on various predictor variables, excluding an intercept term.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Gamma" ),
No Intercept,
Run( Fit( Estimation Method( Lasso( Adaptive, Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
nll = obj << (fit[1] << getvalidationnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix;
disp = rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << get as matrix;
Code Explanation:
- Open data_table data
- Define response variable.
- Specify validation column.
- Select predictor variables.
- Choose generalized regression.
- Set distribution to ZI Gamma.
- Exclude intercept term.
- Run adaptive Lasso model.
- Retrieve report object.
- Extract solution path.
Example 196
Summary: Fits a generalized regression model to predict Y, incorporating Age and Gender effects, with Exponential distribution and Maximum Likelihood estimation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Effects( :Age, :Gender ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Exponential" ),
Run(
Fit(
Estimation Method( Maximum Likelihood ),
Validation Method( None ),
Multiple Comparisons( Effect( Gender ), Student's t( 1 ) )
)
),
);
rpt = obj << report;
actEst = rpt["Parameter Estimates for Original Predictors"][Table Box( 1 )] << get as matrix;
b lsmeans = (actEst[1, 1] + actEst[2, 1] * 48.5181 + actEst[3, 1]) |/ (actEst[1, 1] + actEst[2, 1] * 48.5181);
Code Explanation:
- Open data table;
- Launch Fit Model platform.
- Set response variable Y.
- Include Age and Gender effects.
- Choose Generalized Regression personality.
- Select Exponential distribution.
- Run model with ML estimation.
- Disable validation method.
- Compare Gender effects using t-test.
- Extract parameter estimates.
- Calculate adjusted estimate for Age.
Example 197
Summary: Fits a generalized linear model to predict weight based on age and height, utilizing Maximum Likelihood Estimation and generating a profiler with confidence intervals.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :weight ),
Effects( :age, :height ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run(
Fit(
Estimation Method( Maximum Likelihood ),
Validation Method( None ),
Profiler(
1,
Confidence Intervals( 1 ),
Term Value( age( 17, Lock( 0 ), Show( 1 ) ), height( 75.12258, Max( 75.12258 ), Lock( 0 ), Show( 1 ) ) )
),
Inverse Prediction( Response( 95 ), Term Value( age( All ), height( . ) ) )
)
)
);
rpt = obj << report;
Code Explanation:
- Open table.
- Fit model.
- Set response variable.
- Add effects.
- Choose personality.
- Specify distribution.
- Run fit.
- Estimate using MLE.
- Disable validation.
- Generate profiler.
Example 198
Summary: Fits a generalized regression model to data, utilizing Lasso estimation method and AICc validation, with effect tests sorted by p-value.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :weight ),
Effects( :age, :sex, :height ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Lasso( Adaptive, Linear Grid ) ), Validation Method( AICc ) ) ),
SendToReport( Dispatch( {"Normal Adaptive Lasso with AICc Validation", "Effect Tests"}, "", TableBox, {Sort By Column( 5, 1 )} ) )
);
rpt = obj << report;
Code Explanation:
- Open data table.
- Fit model to data.
- Set response variable.
- Define effect variables.
- Choose generalized regression personality.
- Specify normal distribution.
- Run fit with Lasso method.
- Use AICc for validation.
- Sort effect tests by p-value.
- Retrieve model report.
Example 199
Summary: Fits a generalized regression model to predict Y, incorporating multiple effects and interactions, and saves the prediction formula.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Effects(
:Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose, :Age * :BMI, :Age * :BP, :Age * :Total Cholesterol,
:Age * :LDL, :Age * :HDL, :Age * :TCH, :Age * :LTG, :Age * :Glucose, :BMI * :BP, :BMI * :Total Cholesterol, :BMI * :LDL,
:BMI * :HDL, :BMI * :TCH, :BMI * :LTG, :BMI * :Glucose, :BP * :Total Cholesterol, :BP * :LDL, :BP * :HDL, :BP * :TCH, :BP * :LTG,
:BP * :Glucose, :Total Cholesterol * :LDL, :Total Cholesterol * :HDL, :Total Cholesterol * :TCH, :Total Cholesterol * :LTG,
:Total Cholesterol * :Glucose, :LDL * :HDL, :LDL * :TCH, :LDL * :LTG, :LDL * :Glucose, :HDL * :TCH, :HDL * :LTG, :HDL * :Glucose,
:TCH * :LTG, :TCH * :Glucose, :LTG * :Glucose
),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( "AICc" ) ) )
);
obj << (fit[1] << savepredictionformula);
col = Column( "Y Prediction Formula" );
Form = col << get formula;
dt << delete columns( "Y Prediction Formula" );
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set response variable Y.
- Define multiple effects.
- Choose Generalized Regression personality.
- Specify Normal distribution.
- Run model with Lasso estimation.
- Save prediction formula.
- Retrieve prediction formula.
- Delete prediction formula column.
Example 200
Summary: Generalized regression analysis with elastic net adaptive estimation and AICc validation, generating a prediction formula for the dataset.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Effects(
:Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose, :Age * :BMI, :Age * :BP, :Age * :Total Cholesterol,
:Age * :LDL, :Age * :HDL, :Age * :TCH, :Age * :LTG, :Age * :Glucose, :BMI * :BP, :BMI * :Total Cholesterol, :BMI * :LDL,
:BMI * :HDL, :BMI * :TCH, :BMI * :LTG, :BMI * :Glucose, :BP * :Total Cholesterol, :BP * :LDL, :BP * :HDL, :BP * :TCH, :BP * :LTG,
:BP * :Glucose, :Total Cholesterol * :LDL, :Total Cholesterol * :HDL, :Total Cholesterol * :TCH, :Total Cholesterol * :LTG,
:Total Cholesterol * :Glucose, :LDL * :HDL, :LDL * :TCH, :LDL * :LTG, :LDL * :Glucose, :HDL * :TCH, :HDL * :LTG, :HDL * :Glucose,
:TCH * :LTG, :TCH * :Glucose, :LTG * :Glucose
),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( AICc ) ) )
);
obj << (fit[1] << savepredictionformula);
col = Column( "Y Prediction Formula" );
Form = col << get formula;
dt << delete columns( "Y Prediction Formula" );
Code Explanation:
- Open data table;
- Start Fit Model platform.
- Set Y variable to :Y.
- Define multiple effects including interactions.
- Choose Generalized Regression personality.
- Specify Normal distribution.
- Run model with Elastic Net adaptive estimation and AICc validation.
- Save prediction formula to dataset.
- Retrieve the prediction formula.
- Delete the prediction formula column.
Example 201
Summary: Fits a generalized regression model to a data table, utilizing multiple effects and elastic net estimation method.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Effects(
:Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose, :Age * :BMI, :Age * :BP, :Age * :Total Cholesterol,
:Age * :LDL, :Age * :HDL, :Age * :TCH, :Age * :LTG, :Age * :Glucose, :BMI * :BP, :BMI * :Total Cholesterol, :BMI * :LDL,
:BMI * :HDL, :BMI * :TCH, :BMI * :LTG, :BMI * :Glucose, :BP * :Total Cholesterol, :BP * :LDL, :BP * :HDL, :BP * :TCH, :BP * :LTG,
:BP * :Glucose, :Total Cholesterol * :LDL, :Total Cholesterol * :HDL, :Total Cholesterol * :TCH, :Total Cholesterol * :LTG,
:Total Cholesterol * :Glucose, :LDL * :HDL, :LDL * :TCH, :LDL * :LTG, :LDL * :Glucose, :HDL * :TCH, :HDL * :LTG, :HDL * :Glucose,
:TCH * :LTG, :TCH * :Glucose, :LTG * :Glucose
),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Elastic Net ), Validation Method( AICc ) ) )
);
obj << (fit[1] << savepredictionformula);
col = Column( "Y Prediction Formula" );
Form = col << get formula;
dt << delete columns( "Y Prediction Formula" );
Code Explanation:
- Open data table;
- Define model with multiple effects.
- Use Generalized Regression personality.
- Set Normal distribution.
- Fit model using Elastic Net.
- Validate model using AICc.
- Save prediction formula.
- Retrieve prediction formula.
- Delete prediction formula column.
Example 202
Summary: Generalized regression analysis process to predict Y, incorporating multiple effects and interactions, with Ridge estimation and Holdback validation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Effects(
:Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose, :Age * :BMI, :Age * :BP, :Age * :Total Cholesterol,
:Age * :LDL, :Age * :HDL, :Age * :TCH, :Age * :LTG, :Age * :Glucose, :BMI * :BP, :BMI * :Total Cholesterol, :BMI * :LDL,
:BMI * :HDL, :BMI * :TCH, :BMI * :LTG, :BMI * :Glucose, :BP * :Total Cholesterol, :BP * :LDL, :BP * :HDL, :BP * :TCH, :BP * :LTG,
:BP * :Glucose, :Total Cholesterol * :LDL, :Total Cholesterol * :HDL, :Total Cholesterol * :TCH, :Total Cholesterol * :LTG,
:Total Cholesterol * :Glucose, :LDL * :HDL, :LDL * :TCH, :LDL * :LTG, :LDL * :Glucose, :HDL * :TCH, :HDL * :LTG, :HDL * :Glucose,
:TCH * :LTG, :TCH * :Glucose, :LTG * :Glucose
),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Ridge ), Validation Method( Holdback, 0.3 ) ) )
);
obj << (fit[1] << savepredictionformula);
col = Column( "Y Prediction Formula" );
Form = col << get formula;
dt << delete columns( "Y Prediction Formula" );
Code Explanation:
- Open data table;
- Initiate Fit Model process.
- Set response variable Y.
- Define multiple effects.
- Choose Generalized Regression personality.
- Specify Normal distribution.
- Run model with Ridge estimation.
- Use Holdback validation method.
- Save prediction formula.
- Retrieve and delete prediction column.
Example 203
Summary: Fits a generalized regression model to predict Y, incorporating multiple effects and specifying normal distribution, with interactive features for saving and retrieving prediction formulas.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Effects(
:Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose, :Age * :BMI, :Age * :BP, :Age * :Total Cholesterol,
:Age * :LDL, :Age * :HDL, :Age * :TCH, :Age * :LTG, :Age * :Glucose, :BMI * :BP, :BMI * :Total Cholesterol, :BMI * :LDL,
:BMI * :HDL, :BMI * :TCH, :BMI * :LTG, :BMI * :Glucose, :BP * :Total Cholesterol, :BP * :LDL, :BP * :HDL, :BP * :TCH, :BP * :LTG,
:BP * :Glucose, :Total Cholesterol * :LDL, :Total Cholesterol * :HDL, :Total Cholesterol * :TCH, :Total Cholesterol * :LTG,
:Total Cholesterol * :Glucose, :LDL * :HDL, :LDL * :TCH, :LDL * :LTG, :LDL * :Glucose, :HDL * :TCH, :HDL * :LTG, :HDL * :Glucose,
:TCH * :LTG, :TCH * :Glucose, :LTG * :Glucose
),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Forward Selection ), Validation Method( AICc ) ) )
);
obj << (fit[1] << savepredictionformula);
col = Column( "Y Prediction Formula" );
Form = col << get formula;
dt << delete columns( "Y Prediction Formula" );
obj << closewindow;
Code Explanation:
- Open data table;
- Define model with Y.
- Include multiple effects.
- Set personality to Generalized Regression.
- Specify Normal distribution.
- Run model with Forward Selection.
- Save prediction formula.
- Retrieve prediction formula.
- Delete prediction formula column.
- Close model window.
Example 204
Summary: Fits and evaluates a generalized regression model with Lasso adaptive estimation, ERIC validation, and penalty grid analysis on a specified data table.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( ERIC ) ) ),
);
rpt = obj << report;
grid = obj << (fit[1] << get penalty grid);
tnll = obj << (fit[1] << gettrainingnegativeloglikelihood);
path = obj << (fit[1] << getsolutionpath);
actmin = (rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix) |/ (
rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << getasmatrix);
n = N Row( dt );
fits = J( 4, 150, . );
For( i = 1, i <= 150, i++,
k = N Row( Loc( path[0, i] ) );
fits[1, i] = 2 * tnll[i] + k * Log( n );
fits[2, i] = 2 * tnll[i] + 2 * k + 2 * k * (k + 1) / (n - k - 1);
fits[4, i] = 1 - (Exp( tnll[i] - tnll[1] )) ^ (2 / n);
fits[3, i] = 2 * tnll[i] + 2 * .5 * (k - 2) * Log( (n * path[N Row( path ), i] ^ 2) / grid[i] );
);
bicpath = obj << (fit[1] << getbicpath);
aiccpath = obj << (fit[1] << getaiccpath);
ericpath = obj << (fit[1] << getericpath);
r2path = obj << (fit[1] << gettrainingrsquarepath);
minimum = Loc Min( fits[3, 0] );
minsol = path[0, minimum];
Code Explanation:
- Open data table;
- Define model with response Y.
- Specify validation column.
- Include multiple predictor effects.
- Use Generalized Regression personality.
- Set Normal distribution.
- Run Lasso Adaptive estimation with ERIC validation.
- Retrieve model report.
- Get penalty grid.
- Calculate training negative log-likelihood.
Example 205
Summary: Fits and evaluates a generalized regression model, retrieving key metrics such as BIC, AICc, ERI, and R².
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( ERIC ) ) ),
);
rpt = obj << report;
grid = obj << (fit[1] << get penalty grid);
tnll = obj << (fit[1] << gettrainingnegativeloglikelihood);
path = obj << (fit[1] << getsolutionpath);
actmin = (rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix) |/ (
rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << getasmatrix);
n = N Row( dt );
fits = J( 4, 150, . );
For( i = 1, i <= 150, i++,
k = N Row( Loc( path[0, i] ) );
fits[1, i] = 2 * tnll[i] + k * Log( n );
fits[2, i] = 2 * tnll[i] + 2 * k + 2 * k * (k + 1) / (n - k - 1);
fits[4, i] = 1 - (Exp( tnll[i] - tnll[1] )) ^ (2 / n);
fits[3, i] = 2 * tnll[i] + 2 * .5 * (k - 2) * Log( (n * path[N Row( path ), i] ^ 2) / grid[i] );
);
bicpath = obj << (fit[1] << getbicpath);
aiccpath = obj << (fit[1] << getaiccpath);
ericpath = obj << (fit[1] << getericpath);
r2path = obj << (fit[1] << gettrainingrsquarepath);
minimum = Loc Min( fits[3, 0] );
minsol = path[0, minimum];
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Specify response variable.
- Define validation method.
- Set effects for predictors.
- Choose normal distribution.
- Run Lasso estimation.
- Retrieve model report.
- Extract penalty grid.
- Get training negative log-likelihood.
- Obtain solution path.
- Calculate parameter estimates.
- Initialize fit matrix.
- Loop through path rows.
- Compute BIC, AICc, ERI, R².
- Find minimum AICc.
- Retrieve minimum solution.
Example 206
Summary: Fits and evaluates a generalized regression model with Lasso adaptive estimation method, utilizing a Poisson distribution and extracting relevant metrics such as penalty grid data, training negative log-likelihood, and solution path.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( ERIC ) ) ),
);
rpt = obj << report;
grid = obj << (fit[1] << get penalty grid);
tnll = obj << (fit[1] << gettrainingnegativeloglikelihood);
path = obj << (fit[1] << getsolutionpath);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
n = N Row( dt );
fits = J( 4, 150, . );
For( i = 1, i <= 150, i++,
k = N Row( Loc( path[0, i] ) );
fits[1, i] = 2 * tnll[i] + k * Log( n );
fits[2, i] = 2 * tnll[i] + 2 * k + 2 * k * (k + 1) / (n - k - 1);
fits[4, i] = 1 - (Exp( tnll[i] - tnll[1] )) ^ (2 / n);
fits[3, i] = 2 * tnll[i] + 2 * .5 * (k - 1) * Log( (n * 1 ^ 2) / grid[i] );
);
bicpath = obj << (fit[1] << getbicpath);
aiccpath = obj << (fit[1] << getaiccpath);
ericpath = obj << (fit[1] << getericpath);
r2path = obj << (fit[1] << gettrainingrsquarepath);
minimum = Loc Min( fits[3, 0] );
minsol = path[0, minimum];
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set response variable Y.
- Use validation column.
- Include multiple predictor variables.
- Specify Poisson distribution.
- Run Lasso adaptive estimation method.
- Extract model report.
- Get penalty grid data.
- Calculate training negative log-likelihood.
Example 207
Summary: Fits a generalized regression model with Poisson distribution and Lasso estimation method, extracting key metrics such as penalty grid, training negative log-likelihood, and solution path.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( ERIC ) ) ),
);
rpt = obj << report;
grid = obj << (fit[1] << get penalty grid);
tnll = obj << (fit[1] << gettrainingnegativeloglikelihood);
path = obj << (fit[1] << getsolutionpath);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
n = N Row( dt );
fits = J( 4, 150, . );
For( i = 1, i <= 150, i++,
k = N Row( Loc( path[0, i] ) );
fits[1, i] = 2 * tnll[i] + k * Log( n );
fits[2, i] = 2 * tnll[i] + 2 * k + 2 * k * (k + 1) / (n - k - 1);
fits[4, i] = 1 - (Exp( tnll[i] - tnll[1] )) ^ (2 / n);
fits[3, i] = 2 * tnll[i] + 2 * .5 * (k - 1) * Log( (n * 1 ^ 2) / grid[i] );
);
bicpath = obj << (fit[1] << getbicpath);
aiccpath = obj << (fit[1] << getaiccpath);
ericpath = obj << (fit[1] << getericpath);
r2path = obj << (fit[1] << gettrainingrsquarepath);
minimum = Loc Min( fits[3, 0] );
minsol = path[0, minimum];
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set response variable Y.
- Specify validation column.
- Define predictor effects.
- Choose Poisson distribution.
- Use Lasso estimation method.
- Apply ERIC validation method.
- Extract model report.
- Retrieve penalty grid.
Example 208
Summary: Fits and evaluates a generalized regression model with Lasso estimation, adaptive linear grid, and ERIC validation, extracting key metrics and solution paths.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Exponential" ),
Run( Fit( Estimation Method( Lasso( Adaptive, Linear Grid ) ), Validation Method( ERIC ) ) ),
);
rpt = obj << report;
grid = obj << (fit[1] << get penalty grid);
tnll = obj << (fit[1] << gettrainingnegativeloglikelihood);
path = obj << (fit[1] << getsolutionpath);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
n = N Row( dt );
fits = J( 4, 150, . );
For( i = 1, i <= 150, i++,
k = N Row( Loc( path[0, i] ) );
fits[1, i] = 2 * tnll[i] + k * Log( n );
fits[2, i] = 2 * tnll[i] + 2 * k + 2 * k * (k + 1) / (n - k - 1);
fits[4, i] = 1 - (Exp( tnll[i] - tnll[1] )) ^ (2 / n);
fits[3, i] = 2 * tnll[i] + 2 * .5 * (k - 1) * Log( (n * 1 ^ 2) / grid[i] );
);
bicpath = obj << (fit[1] << getbicpath);
aiccpath = obj << (fit[1] << getaiccpath);
ericpath = obj << (fit[1] << getericpath);
r2path = obj << (fit[1] << gettrainingrsquarepath);
minimum = Loc Min( fits[3, 0] );
minsol = path[0, minimum];
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Specify response variable Y.
- Use validation column.
- Include multiple predictors.
- Choose exponential distribution.
- Run Lasso estimation with adaptive linear grid.
- Validate using ERIC method.
- Extract report object.
- Retrieve penalty grid, negative log-likelihood, solution path, and parameter estimates.
- Calculate BIC, AICc, EIC, and R² paths.
- Find minimum AICc value.
- Identify corresponding solution path.
Example 209
Summary: Fits a generalized regression model to a data table, extracting various metrics and solution paths.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Exponential" ),
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( ERIC ) ) ),
);
rpt = obj << report;
grid = obj << (fit[1] << get penalty grid);
tnll = obj << (fit[1] << gettrainingnegativeloglikelihood);
path = obj << (fit[1] << getsolutionpath);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
n = N Row( dt );
fits = J( 4, 150, . );
For( i = 1, i <= 150, i++,
k = N Row( Loc( path[0, i] ) );
fits[1, i] = 2 * tnll[i] + k * Log( n );
fits[2, i] = 2 * tnll[i] + 2 * k + 2 * k * (k + 1) / (n - k - 1);
fits[4, i] = 1 - (Exp( tnll[i] - tnll[1] )) ^ (2 / n);
fits[3, i] = 2 * tnll[i] + 2 * .5 * (k - 1) * Log( (n * 1 ^ 2) / grid[i] );
);
bicpath = obj << (fit[1] << getbicpath);
aiccpath = obj << (fit[1] << getaiccpath);
ericpath = obj << (fit[1] << getericpath);
r2path = obj << (fit[1] << gettrainingrsquarepath);
minimum = Loc Min( fits[3, 0] );
minsol = path[0, minimum];
Code Explanation:
- Open data table;
- Initiate Fit Model dialog.
- Set response variable Y.
- Specify validation method.
- Define predictor effects.
- Choose Generalized Regression personality.
- Select Exponential distribution.
- Run model with Lasso estimation and ERIC validation.
- Extract model report.
- Retrieve penalty grid, negative log-likelihood, and solution path.
- Get parameter estimates matrix.
- Initialize fits matrix.
- Loop through path to calculate fit metrics.
- Retrieve BIC, AICc, ERIC, and R² paths.
- Find minimum AICc value.
- Identify minimum solution path.
Example 210
Summary: Fits a generalized regression model to predict continuous outcomes, utilizing Lasso estimation and ERIC validation method.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Gamma" ),
Run( Fit( Estimation Method( Lasso( Adaptive, Linear Grid ) ), Validation Method( ERIC ) ) ),
);
rpt = obj << report;
grid = obj << (fit[1] << get penalty grid);
tnll = obj << (fit[1] << gettrainingnegativeloglikelihood);
path = obj << (fit[1] << getsolutionpath);
actmin = (rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix) |/ (
rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << getasmatrix);
n = N Row( dt );
fits = J( 4, 150, . );
For( i = 1, i <= 150, i++,
k = N Row( Loc( path[0, i] ) );
fits[1, i] = 2 * tnll[i] + k * Log( n );
fits[2, i] = 2 * tnll[i] + 2 * k + 2 * k * (k + 1) / (n - k - 1);
fits[4, i] = 1 - (Exp( tnll[i] - tnll[1] )) ^ (2 / n);
fits[3, i] = 2 * tnll[i] + 2 * .5 * (k - 2) * Log( (n * path[N Row( path ), i]) / grid[i] );
);
bicpath = obj << (fit[1] << getbicpath);
aiccpath = obj << (fit[1] << getaiccpath);
ericpath = obj << (fit[1] << getericpath);
r2path = obj << (fit[1] << gettrainingrsquarepath);
minimum = Loc Min( fits[3, 0] );
minsol = path[0, minimum];
Code Explanation:
- Open data table;
- Initiate fit model process.
- Set response variable.
- Define validation method.
- Specify predictor variables.
- Choose generalized regression personality.
- Select gamma distribution.
- Run model with Lasso estimation.
- Retrieve model report.
- Extract penalty grid.
Example 211
Summary: Fits and evaluates a Generalized Regression model with Lasso estimation, utilizing Gamma distribution and ERIC validation method.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Gamma" ),
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( ERIC ) ) ),
);
rpt = obj << report;
grid = obj << (fit[1] << get penalty grid);
tnll = obj << (fit[1] << gettrainingnegativeloglikelihood);
path = obj << (fit[1] << getsolutionpath);
actmin = (rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix) |/ (
rpt["Parameter Estimates for Centered and Scaled Predictors"][Table Box( 2 )][Number Col Box( "Estimate" )] << getasmatrix);
n = N Row( dt );
fits = J( 4, 150, . );
For( i = 1, i <= 150, i++,
k = N Row( Loc( path[0, i] ) );
fits[1, i] = 2 * tnll[i] + k * Log( n );
fits[2, i] = 2 * tnll[i] + 2 * k + 2 * k * (k + 1) / (n - k - 1);
fits[4, i] = 1 - (Exp( tnll[i] - tnll[1] )) ^ (2 / n);
fits[3, i] = 2 * tnll[i] + 2 * .5 * (k - 2) * Log( (n * path[N Row( path ), i]) / grid[i] );
);
bicpath = obj << (fit[1] << getbicpath);
aiccpath = obj << (fit[1] << getaiccpath);
ericpath = obj << (fit[1] << getericpath);
r2path = obj << (fit[1] << gettrainingrsquarepath);
minimum = Loc Min( fits[3, 0] );
minsol = path[0, minimum];
Code Explanation:
- Open data table;
- Fit Generalized Regression model.
- Set response variable.
- Specify validation column.
- Define predictor effects.
- Choose Gamma distribution.
- Run model with Lasso estimation.
- Extract model report.
- Retrieve penalty grid.
- Calculate training negative log-likelihood.
- Get solution path.
- Compute parameter estimates.
- Initialize fit matrix.
- Loop through solution path.
- Calculate AICc values.
- Calculate BIC values.
- Calculate ERIC values.
- Calculate R² values.
- Find minimum AICc.
- Identify minimum solution.
Example 212
Summary: Fits a generalized regression model to a data table, specifying effects and personality, and generating a report with summary statistics.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( None ) ) ),
SendToReport( Dispatch( {}, "Model Launch", OutlineBox, {Close( 0 )} ) )
);
rpt = obj << report;
aLabel = rpt[Outline Box( "Model Summary" )][String Col Box( 3 )] << get;
bLabel = {"Number of rows", "Sum of Frequencies", "-LogLikelihood", "Number of Parameters", "BIC", "AICc", "ERIC", "RSquare"};
Code Explanation:
- Open data table;
- Fit model using Fit Model platform.
- Set response variable to Y.
- Include specified effects: Age, Gender, BMI, BP, Total Cholesterol, LDL, HDL, TCH, LTG, Glucose.
- Choose Generalized Regression personality.
- Specify Normal distribution.
- Run model with Lasso adaptive estimation.
- Disable validation method.
- Close Model Launch outline box in report.
- Retrieve report object.
Example 213
Summary: Fits a generalized regression model to a data table, specifying validation method, response variable, predictor effects, and distribution, then extracts text from the model report.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run(
Fit(
Estimation Method( Standard Least Squares ),
Validation Method( Validation Column ),
Model Summary( 0 ),
Original Parameter Estimates( 0 ),
Effect Tests( 0 )
)
),
);
rpt = obj << report;
aText = rpt[Outline Box( 4 )] << gettext;
aText = Left( aText, Contains( aText, "Parameter" ) - 1 );
aText = Substitute( aText, "\!t", "", "\!N", "", "\!r", "", "\!n", "" );
bText = "Normal Standard Least Squares with Validation Column";
Code Explanation:
- Open data table;
- Launch Fit Model platform.
- Set validation method.
- Specify response variable Y.
- Define predictor effects.
- Choose Generalized Regression personality.
- Select Normal distribution.
- Run model with specified settings.
- Retrieve model report.
- Extract text from report outline box.
Example 214
Summary: Runs a Binomial Logistic Regression analysis with validation column, specifying response variable Gender and effects for Age, BMI, BP, Total Cholesterol, LDL, HDL, TCH, LTG, Glucose, and Y.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Gender ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose, :Y ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Binomial" ),
Run(
Fit(
Estimation Method( Maximum Likelihood ),
Validation Method( Validation Column ),
Model Summary( 0 ),
Original Parameter Estimates( 0 ),
Effect Tests( 0 )
)
)
);
rpt = obj << report;
aText = rpt[Outline Box( 4 )] << gettext;
aText = Left( aText, Contains( aText, "Parameter" ) - 1 );
aText = Substitute( aText, "\!t", "", "\!N", "", "\!r", "", "\!n", "" );
bText = "Binomial Logistic Regression with Validation Column";
Code Explanation:
- Open data table;
- Create Fit Model object.
- Set validation method.
- Specify response variable (Gender).
- Define effects (Age, BMI, BP, Total Cholesterol, LDL, HDL, TCH, LTG, Glucose, Y).
- Choose Generalized Regression personality.
- Set Binomial distribution.
- Run model with Maximum Likelihood estimation.
- Extract report from model.
- Retrieve text from outline box 4.
Example 215
Summary: Fits a binomial logistic regression model with validation column, specifying response variable Gender and effects Age, BMI, BP, Total Cholesterol, LDL, HDL, TCH, LTG, Glucose, Y, and generating a report from the fit.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Gender ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose, :Y ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Binomial" ),
Run(
Fit(
Estimation Method( Logistic Regression ),
Validation Method( Validation Column ),
Model Summary( 0 ),
Original Parameter Estimates( 0 ),
Effect Tests( 0 )
)
)
);
rpt = obj << report;
aText = rpt[Outline Box( 4 )] << gettext;
aText = Left( aText, Contains( aText, "Parameter" ) - 1 );
aText = Substitute( aText, "\!t", "", "\!N", "", "\!r", "", "\!n", "" );
bText = "Binomial Logistic Regression with Validation Column";
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set validation column.
- Specify response variable (Gender).
- Define effects (Age, BMI, etc.).
- Choose Generalized Regression personality.
- Select Binomial distribution.
- Run logistic regression model.
- Generate report from fit.
- Extract text from report outline box.
Example 216
Summary: Fits a generalized regression model to a data table, extracting original parameter estimates, and displaying active parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Forward Selection ), Validation Method( Validation Column ) ) )
);
obj << (fit[1] << active parameter estimates);
rpt = obj << report;
oParms = (rpt["Parameter Estimates for Original Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix);
oParms2 = [];
For( i = 1, i <= N Rows( oParms ), i++,
If( oParms[i] != 0,
oParms2 |/= oParms[i]
)
);
aParms = rpt["Active Parameter Estimates"][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Launch Fit Model platform.
- Set validation column.
- Specify response variable.
- Add predictor effects.
- Choose Generalized Regression personality.
- Select Normal distribution.
- Run model with Forward Selection.
- Display active parameter estimates.
- Extract original parameter estimates matrix.
Example 217
Summary: Fits a generalized regression model to a data table, extracting original and active parameter estimates, and reporting results.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( Validation Column ) ) )
);
obj << (fit[1] << active parameter estimates);
rpt = obj << report;
oParms = (rpt["Parameter Estimates for Original Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix);
oParms2 = [];
For( i = 1, i <= N Rows( oParms ), i++,
If( oParms[i] != 0,
oParms2 |/= oParms[i]
)
);
aParms = rpt["Active Parameter Estimates"][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Launch Fit Model platform.
- Set validation method.
- Specify response variable.
- Add predictor effects.
- Choose Generalized Regression personality.
- Select Normal distribution.
- Run model with Elastic Net adaptive estimation.
- Display active parameter estimates.
- Extract original parameter estimates matrix.
Example 218
Summary: Fits a generalized regression model to a data table, extracting active and original parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Double Lasso ), Validation Method( Validation Column ) ) )
);
obj << (fit[1] << active parameter estimates);
rpt = obj << report;
oParms = (rpt["Parameter Estimates for Original Predictors"][Table Box( 1 )][Number Col Box( "Estimate" )] << getasmatrix);
oParms2 = [];
For( i = 1, i <= N Rows( oParms ), i++,
If( oParms[i] != 0,
oParms2 |/= oParms[i]
)
);
aParms = rpt["Active Parameter Estimates"][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Launch Fit Model platform.
- Set validation column.
- Specify response variable.
- Add predictor effects.
- Choose Generalized Regression personality.
- Select Normal distribution.
- Run model with Double Lasso estimation.
- Display active parameter estimates.
- Extract original parameter estimates.
Example 219
Summary: Fits a generalized regression model to predict continuous outcomes, utilizing Lasso estimation and Gamma distribution.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Gamma" ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ) ) )
);
obj << (fit[1] << meanconfidenceinterval);
saved = (dt << getasmatrix)[2, 0];
saved = saved[0, N Col( saved ) - 1 :: N Col( saved )];
saved = Round( saved, 5 );
obj << (fit[1] << Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
Age( 48.518, Lock( 0 ), Show( 0 ) ),
Gender( 1, Lock( 0 ), Show( 1 ) ),
BMI( 21.6, Lock( 0 ), Show( 1 ) ),
BP( 87, Lock( 0 ), Show( 1 ) ),
Total Cholesterol( 183, Lock( 0 ), Show( 1 ) ),
LDL( 103.2, Lock( 0 ), Show( 1 ) ),
HDL( 49.788, Lock( 0 ), Show( 0 ) ),
TCH( 4, Lock( 0 ), Show( 0 ) ),
LTG( 3.8918, Lock( 0 ), Show( 1 ) ),
Glucose( 91.26, Lock( 0 ), Show( 0 ) )
)
));
rpt = obj << report;
Code Explanation:
- Open data table;
- Fit Generalized Regression model.
- Set validation method.
- Specify response variable.
- Define predictor variables.
- Choose Gamma distribution.
- Use Lasso estimation method.
- Calculate mean confidence interval.
- Extract prediction matrix.
- Round predictions to 5 decimal places.
- Create profiler with specified term values.
- Generate report.
Example 220
Summary: Fits a generalized regression model with Lasso adaptive estimation to predict binary outcomes, extracting parameter estimates and calculating odds ratios and confidence intervals.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y Binary ),
Target Level( "Low" ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Binomial" ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ), Odds Ratios( 1 ) ) )
);
rpt = obj << report;
parms = rpt["Parameter Estimates for Original Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
lowerci = rpt["Parameter Estimates for Original Predictors"][Number Col Box( "Lower 95%" )] << getasmatrix;
upperci = rpt["Parameter Estimates for Original Predictors"][Number Col Box( "Upper 95%" )] << getasmatrix;
genderparms = parms[3] || lowerci[3] || upperci[3];
contparms = parms || lowerci || upperci;
contparms[1, 0] = [];
contparms[2, 0] = [];
b unit OR = Exp( contparms );
range age = Col Max( dt:age ) - Col Min( dt:age );
range bmi = Col Max( dt:bmi ) - Col Min( dt:bmi );
range bp = Col Max( dt:bp ) - Col Min( dt:bp );
range tc = Col Max( dt:total cholesterol ) - Col Min( dt:total cholesterol );
range ldl = Col Max( dt:ldl ) - Col Min( dt:ldl );
range hdl = Col Max( dt:hdl ) - Col Min( dt:hdl );
range tch = Col Max( dt:tch ) - Col Min( dt:tch );
range ltg = Col Max( dt:ltg ) - Col Min( dt:ltg );
range glu = Col Max( dt:glucose ) - Col Min( dt:glucose );
scale = J( 1, 3, range age ) |/ J( 1, 3, range bmi ) |/ J( 1, 3, range bp ) |/ J( 1, 3, range tc ) |/ J( 1, 3, range ldl ) |/
J( 1, 3, range hdl ) |/ J( 1, 3, range tch ) |/ J( 1, 3, range ltg ) |/ J( 1, 3, range glu );
b range OR = Exp( contparms :* scale );
b gender or = Exp( genderparms );
b gender or = b gender or |/ (1 / b gender or);
b gender or = (b gender or[1, 0]) |/ ((b gender or[2, 1]) || (b gender or[2, 3]) || (b gender or[2, 2]));
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set validation column.
- Define binary response variable.
- Specify target level "Low".
- Include multiple effects.
- Use binomial distribution.
- Run model with Lasso adaptive estimation.
- Extract parameter estimates.
- Calculate odds ratios and confidence intervals.
Example 221
Summary: Fits a generalized regression model to predict binary outcomes, incorporating multiple effects and elastic net estimation, with parameter estimates and confidence intervals extracted for further analysis.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y Binary ),
Target Level( "Low" ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Binomial" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( Validation Column ), Odds Ratios( 1 ) ) )
);
rpt = obj << report;
parms = rpt["Parameter Estimates for Original Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
lowerci = rpt["Parameter Estimates for Original Predictors"][Number Col Box( "Lower 95%" )] << getasmatrix;
upperci = rpt["Parameter Estimates for Original Predictors"][Number Col Box( "Upper 95%" )] << getasmatrix;
genderparms = parms[3] || lowerci[3] || upperci[3];
contparms = parms || lowerci || upperci;
contparms[1, 0] = [];
contparms[2, 0] = [];
b unit OR = Exp( contparms );
range age = Col Max( dt:age ) - Col Min( dt:age );
range bmi = Col Max( dt:bmi ) - Col Min( dt:bmi );
range bp = Col Max( dt:bp ) - Col Min( dt:bp );
range tc = Col Max( dt:total cholesterol ) - Col Min( dt:total cholesterol );
range ldl = Col Max( dt:ldl ) - Col Min( dt:ldl );
range hdl = Col Max( dt:hdl ) - Col Min( dt:hdl );
range tch = Col Max( dt:tch ) - Col Min( dt:tch );
range ltg = Col Max( dt:ltg ) - Col Min( dt:ltg );
range glu = Col Max( dt:glucose ) - Col Min( dt:glucose );
scale = J( 1, 3, range age ) |/ J( 1, 3, range bmi ) |/ J( 1, 3, range bp ) |/ J( 1, 3, range tc ) |/ J( 1, 3, range ldl ) |/
J( 1, 3, range hdl ) |/ J( 1, 3, range tch ) |/ J( 1, 3, range ltg ) |/ J( 1, 3, range glu );
b range OR = Exp( contparms :* scale );
b gender or = Exp( genderparms );
b gender or = b gender or |/ (1 / b gender or);
b gender or = (b gender or[1, 0]) |/ ((b gender or[2, 1]) || (b gender or[2, 3]) || (b gender or[2, 2]));
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set validation column.
- Specify binary response variable.
- Define target level.
- Include multiple effects.
- Use elastic net estimation.
- Extract parameter estimates.
- Retrieve confidence intervals.
- Calculate odds ratios.
Example 222
Summary: Fits a generalized regression model to predict incidence rate ratios, utilizing Poisson distribution and logistic regression, with interactive features for parameter estimation and odds ratio calculation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Logistic Regression ), Validation Method( Validation Column ), Incidence Rate Ratios( 1 ) ) )
);
rpt = obj << report;
message = rpt["Incidence Rate Ratios"][Text Box( 1 )] << gettext;
parms = rpt["Parameter Estimates for Original Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
lowerci = rpt["Parameter Estimates for Original Predictors"][Number Col Box( "Lower 95%" )] << getasmatrix;
upperci = rpt["Parameter Estimates for Original Predictors"][Number Col Box( "Upper 95%" )] << getasmatrix;
genderparms = parms[3] || lowerci[3] || upperci[3];
contparms = parms || lowerci || upperci;
contparms[1, 0] = [];
contparms[2, 0] = [];
b unit OR = Exp( contparms );
range age = Col Max( dt:age ) - Col Min( dt:age );
range bmi = Col Max( dt:bmi ) - Col Min( dt:bmi );
range bp = Col Max( dt:bp ) - Col Min( dt:bp );
range tc = Col Max( dt:total cholesterol ) - Col Min( dt:total cholesterol );
range ldl = Col Max( dt:ldl ) - Col Min( dt:ldl );
range hdl = Col Max( dt:hdl ) - Col Min( dt:hdl );
range tch = Col Max( dt:tch ) - Col Min( dt:tch );
range ltg = Col Max( dt:ltg ) - Col Min( dt:ltg );
range glu = Col Max( dt:glucose ) - Col Min( dt:glucose );
scale = J( 1, 3, range age ) |/ J( 1, 3, range bmi ) |/ J( 1, 3, range bp ) |/ J( 1, 3, range tc ) |/ J( 1, 3, range ldl ) |/
J( 1, 3, range hdl ) |/ J( 1, 3, range tch ) |/ J( 1, 3, range ltg ) |/ J( 1, 3, range glu );
b range OR = Exp( contparms :* scale );
b gender or = Exp( genderparms );
b gender or = b gender or |/ (1 / b gender or);
b gender or = (b gender or[1, 0]) |/ ((b gender or[2, 1]) || (b gender or[2, 3]) || (b gender or[2, 2]));
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set validation column.
- Define response variable.
- Specify predictor variables.
- Choose Poisson distribution.
- Run logistic regression.
- Extract incidence rate ratios.
- Retrieve parameter estimates.
- Calculate odds ratios and ranges.
Example 223
Summary: Fits a Generalized Regression model with Negative Binomial distribution to predict incidence rate ratios, utilizing a Fit Model script in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
Run( Fit( Estimation Method( Logistic Regression ), Validation Method( Validation Column ), Incidence Rate Ratios( 1 ) ) )
);
rpt = obj << report;
message = rpt["Incidence Rate Ratios"][Text Box( 1 )] << gettext;
parms = rpt["Parameter Estimates for Original Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
lowerci = rpt["Parameter Estimates for Original Predictors"][Number Col Box( "Lower 95%" )] << getasmatrix;
upperci = rpt["Parameter Estimates for Original Predictors"][Number Col Box( "Upper 95%" )] << getasmatrix;
genderparms = parms[3] || lowerci[3] || upperci[3];
contparms = parms || lowerci || upperci;
contparms[1, 0] = [];
contparms[2, 0] = [];
b unit OR = Exp( contparms );
range age = Col Max( dt:age ) - Col Min( dt:age );
range bmi = Col Max( dt:bmi ) - Col Min( dt:bmi );
range bp = Col Max( dt:bp ) - Col Min( dt:bp );
range tc = Col Max( dt:total cholesterol ) - Col Min( dt:total cholesterol );
range ldl = Col Max( dt:ldl ) - Col Min( dt:ldl );
range hdl = Col Max( dt:hdl ) - Col Min( dt:hdl );
range tch = Col Max( dt:tch ) - Col Min( dt:tch );
range ltg = Col Max( dt:ltg ) - Col Min( dt:ltg );
range glu = Col Max( dt:glucose ) - Col Min( dt:glucose );
scale = J( 1, 3, range age ) |/ J( 1, 3, range bmi ) |/ J( 1, 3, range bp ) |/ J( 1, 3, range tc ) |/ J( 1, 3, range ldl ) |/
J( 1, 3, range hdl ) |/ J( 1, 3, range tch ) |/ J( 1, 3, range ltg ) |/ J( 1, 3, range glu );
b range OR = Exp( contparms :* scale );
b gender or = Exp( genderparms );
b gender or = b gender or |/ (1 / b gender or);
b gender or = (b gender or[1, 0]) |/ ((b gender or[2, 1]) || (b gender or[2, 3]) || (b gender or[2, 2]));
Code Explanation:
- Open data table;
- Fit Generalized Regression model.
- Set validation method.
- Specify response variable.
- Define predictor effects.
- Choose Negative Binomial distribution.
- Run logistic regression fit.
- Extract report.
- Get incidence rate ratios.
- Retrieve parameter estimates.
Example 224
Summary: Fits a generalized regression model to a data table, including multiple effects and target level specification.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y Binary ),
Target Level( "Low" ),
Effects(
:Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose, :Age * :Gender, :Age * :BMI, :Age * :BP,
:Age * :Total Cholesterol, :Age * :LDL, :Age * :HDL, :Age * :TCH, :Age * :LTG, :Age * :Glucose, :Gender * :BMI, :Gender * :BP,
:Gender * :Total Cholesterol, :Gender * :LDL, :Gender * :HDL, :Gender * :TCH, :Gender * :LTG, :Gender * :Glucose, :BMI * :BP,
:BMI * :Total Cholesterol, :BMI * :LDL, :BMI * :HDL, :BMI * :TCH, :BMI * :LTG, :BMI * :Glucose, :BP * :Total Cholesterol,
:BP * :LDL, :BP * :HDL, :BP * :TCH, :BP * :LTG, :BP * :Glucose, :Total Cholesterol * :LDL, :Total Cholesterol * :HDL,
:Total Cholesterol * :TCH, :Total Cholesterol * :LTG, :Total Cholesterol * :Glucose, :LDL * :HDL, :LDL * :TCH, :LDL * :LTG,
:LDL * :Glucose, :HDL * :TCH, :HDL * :LTG, :HDL * :Glucose, :TCH * :LTG, :TCH * :Glucose, :LTG * :Glucose
),
Personality( "Generalized Regression" ),
Generalized Distribution( "Binomial" ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ) ) )
);
rpt = obj << report;
nParms = (rpt["Model Summary"][Number Col Box( 1 )] << getasmatrix)[4];
obj << (fit[1] << active parameter estimates( 1 ));
bParms = N Rows( rpt["Active Parameter Estimates"][Number Col Box( "Estimate" )] << getasmatrix );
aLabels = (rpt["Model Summary"][String Col Box( 3 )] << get)[4];
bLabels = "Number of Parameters";
obj << (fit[1] << set solution id( 149 ));
nParms = (rpt["Model Summary"][Number Col Box( 1 )] << getasmatrix)[4];
bParms = N Row( rpt["Active Parameter Estimates"][Number Col Box( "Estimate" )] << getasmatrix );
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set validation column.
- Define binary response variable.
- Specify target level.
- Include multiple effects.
- Use generalized regression personality.
- Set binomial distribution.
- Run fit with Lasso adaptive estimation.
- Extract model summary and parameters.
Example 225
Summary: Fits a generalized regression model to a data table, selecting the best predictors using forward selection and extracting the solution path.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects(
:Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose, :Age * :BMI, :Age * :BP, :Age * :Total Cholesterol,
:Age * :LDL, :Age * :HDL, :Age * :TCH, :Age * :LTG, :Age * :Glucose, :BMI * :BP, :BMI * :Total Cholesterol, :BMI * :LDL,
:BMI * :HDL, :BMI * :TCH, :BMI * :LTG, :BMI * :Glucose, :BP * :Total Cholesterol, :BP * :LDL, :BP * :HDL, :BP * :TCH, :BP * :LTG,
:BP * :Glucose, :Total Cholesterol * :LDL, :Total Cholesterol * :HDL, :Total Cholesterol * :TCH, :Total Cholesterol * :LTG,
:Total Cholesterol * :Glucose, :LDL * :HDL, :LDL * :TCH, :LDL * :LTG, :LDL * :Glucose, :HDL * :TCH, :HDL * :LTG, :HDL * :Glucose,
:TCH * :LTG, :TCH * :Glucose, :LTG * :Glucose
),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Forward Selection ), Validation Method( Validation Column ), Early Stopping ) )
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
actEst = rpt["Parameter Estimates for Original Predictors"][Table Box( 1 )] << get as matrix;
a = Try(
n = N Col( path );
nparm = N Row( actest );
,
"invalid"
);
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set validation column.
- Specify response variable.
- Define model effects.
- Choose Generalized Regression personality.
- Select Normal distribution.
- Run model with Forward Selection.
- Extract model report.
- Retrieve solution path.
Example 226
Summary: Generalized regression analysis on a data table, utilizing the Fit Model platform to specify response and predictor variables, validate model performance, and plot residuals.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ), Plot Residual by Predictor( 1 ) ) )
);
rpt = obj << report;
Code Explanation:
- Open data table;
- Launch Fit Model platform.
- Set validation column.
- Specify response variable.
- Add multiple predictor variables.
- Choose Generalized Regression personality.
- Select Normal distribution.
- Run model with Lasso estimation.
- Use validation column method.
- Plot residuals by predictors.
Example 227
Summary: Analyze and visualize a generalized regression model, generating confusion matrices and retrieving reports.
Code:
dt1 = Open("data_table.jmp");
obj1a = dt1 << Fit Model(
Y( :Nready, :Ntotal ),
Effects( :Heat, :Soak ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Binomial" ),
Run
);
rpt1a = obj1a << report;
obj1a << (Fit[1] << Confusion Matrix( 1 ));
conf1a = rpt1a[Outline Box( "Confusion Matrix" )][Table Box( 2 )] << get as matrix;
s = dt1 << Select Rows( 1 :: 5 );
s << Exclude( 1 );
obj1b = obj1a << Redo Analysis( 1 );
rpt1b = obj1b << report;
conf1b = rpt1b[Outline Box( "Confusion Matrix" )][Table Box( 2 )] << get as matrix;
dt1 << Invert Row Selection( 1 );
dt2 = dt1 << Subset( Selected Rows );
obj2 = dt2 << Fit Model(
Y( :Nready, :Ntotal ),
Effects( :Heat, :Soak ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Binomial" ),
Run
);
rpt2 = obj2 << report;
obj2 << (Fit[1] << Confusion Matrix( 1 ));
conf2 = rpt2[Outline Box( "Confusion Matrix" )][Table Box( 2 )] << get as matrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Retrieve model report.
- Generate confusion matrix.
- Extract confusion matrix data.
- Select first 5 rows.
- Exclude selected rows.
- Redo analysis without excluded rows.
- Retrieve new model report.
- Extract new confusion matrix data.
Example 228
Summary: Fits a generalized regression model to a data table, including censoring and parameter estimation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :censor ),
Censor Code( "1" ),
Y( :Time ),
Effects( :Cell Type, :Treatment, :Age, :Diag Time ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Lognormal" ),
Run( Fit( Estimation Method( Maximum Likelihood ), Validation Method( None ), ) ),
);
rpt = obj << report;
scl2 = (rpt["Parameter Estimates for Original Predictors"][Table Box( 2 )] << get as matrix)[1];
obj << (fit[1] << Std Error of Predicted);
obj << (fit[1] << Std Error of Predicted Formula);
pred1 = dt:Standard Error of Predicted Mean Time << get values;
pred2 = dt:Standard Error of Predicted Time Formula << get values;
expr2 = Char( Arg( dt:Standard Error of Predicted Time Formula << get formula, 2 ) );
Code Explanation:
- Open data table.
- Fit generalized regression model.
- Set censor variable.
- Define censor code.
- Specify response variable.
- Include effect variables.
- Choose personality type.
- Select distribution type.
- Run model fit.
- Extract parameter estimates.
Example 229
Summary: Generalized regression analysis with Lasso estimation method, validation column, and custom test on age and gender, generating a report from the redo analysis.
Code:
dt = Open("data_table.jmp");
obj = Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run(
Fit(
Estimation Method( Lasso( "Adaptive" ) ),
Validation Method( "Validation Column" ),
Covariance of Estimates( 1 ),
Profiler( 1 ),
Distribution Profiler( 1 ),
Correlation of Estimates( 1 ),
Custom Test( [0 1 0 0 0 0 0 0 0 0 0 0, 0 0 1 0 0 0 0 0 0 0 0 0], Label( "age and gender" ) ),
Plot Actual by Predicted( 1 )
)
)
);
obj2 = obj << Redo Analysis;
rpt2 = obj2 << report;
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set validation column.
- Specify response variable Y.
- Define predictor effects.
- Choose Generalized Regression personality.
- Select Normal distribution.
- Run the analysis.
- Apply Lasso estimation method.
- Use validation column for validation.
- Enable covariance of estimates.
- Enable profiler.
- Enable distribution profiler.
- Enable correlation of estimates.
- Conduct custom test on age and gender.
- Plot actual vs predicted.
- Redo the analysis.
- Generate report from redo.
Example 230
Summary: Generalized regression analysis with Dantzig Selector estimation and AICc validation, generating a report with an extracted title.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Effects( :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Exponential" ),
Run( Fit( Estimation Method( Dantzig Selector ), Validation Method( "AICc" ) ) )
);
rpt = obj << report;
title1 = rpt[Outline Box( 6 )] << get title;
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set response variable Y.
- Define predictor variables.
- Choose Generalized Regression personality.
- Select Exponential distribution.
- Run model with Dantzig Selector.
- Use AICc for validation.
- Retrieve model report.
- Extract title from outline box.
Example 231
Summary: Fits a generalized regression model to a data table, utilizing elastic net estimation and normal distribution, with subsequent extraction of solution path and validation negative log likelihood.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Elastic Net ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set response variable as Y.
- Use validation column for validation.
- Include multiple effects in model.
- Specify normal distribution.
- Run elastic net estimation method.
- Retrieve model report.
- Extract solution path.
- Get validation negative log likelihood.
Example 232
Summary: Generalized regression analysis process for a Poisson-distributed response variable, incorporating multiple effects and validation column, and generates a report with solution path and negative log likelihood.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Elastic Net ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Initiate Fit Model process.
- Set response variable Y.
- Use validation column.
- Include multiple effects.
- Choose Generalized Regression personality.
- Select Poisson distribution.
- Run model with Elastic Net estimation.
- Retrieve model report.
- Extract solution path.
Example 233
Summary: Fits a generalized regression model to predict continuous outcomes, utilizing Exponential distribution and Elastic Net estimation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Exponential" ),
Run( Fit( Estimation Method( Elastic Net ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data_table data
- Fit model with specified variables.
- Use Generalized Regression personality.
- Set Exponential distribution.
- Run model with Elastic Net estimation.
- Retrieve validation results.
- Extract solution path.
- Calculate negative log-likelihood.
- Access parameter estimates.
- Convert estimates to matrix.
Example 234
Summary: Fits a generalized regression model to a data table, utilizing Elastic Net estimation and Gamma distribution, and retrieves relevant model reports and parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Gamma" ),
Run( Fit( Estimation Method( Elastic Net ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set response variable.
- Specify validation column.
- Define predictor effects.
- Choose Generalized Regression personality.
- Select Gamma distribution.
- Run model with Elastic Net estimation.
- Retrieve model report.
- Extract solution path.
- Get validation negative log-likelihood.
- Fetch parameter estimates matrix for centered predictors.
- Fetch parameter estimates matrix for scaled predictors.
Example 235
Summary: Fits a generalized regression model with negative binomial distribution to a dataset, using elastic net estimation and extracting relevant statistics.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
Run( Fit( Estimation Method( Elastic Net ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Launch Fit Model platform.
- Set response variable.
- Specify validation method.
- Define predictor variables.
- Choose Generalized Regression personality.
- Select Negative Binomial distribution.
- Run model with Elastic Net estimation.
- Extract model report.
- Retrieve solution path.
- Obtain validation negative log-likelihood.
- Extract active minimum estimates.
- Extract dispersion estimates.
Example 236
Summary: Fits a generalized regression model to a dataset, generating a report and extracting solution path and negative log-likelihood.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Elastic Net ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open table.
- Fit model.
- Specify response variable.
- Set validation method.
- Define effects.
- Choose personality.
- Select distribution.
- Run fit with Elastic Net.
- Generate report.
- Extract solution path.
- Get negative log-likelihood.
- Retrieve parameter estimates.
Example 237
Summary: Fits a generalized regression model with ZI Poisson distribution and Elastic Net estimation, using a validation column to evaluate the model's performance.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Poisson" ),
Run( Fit( Estimation Method( Elastic Net ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open table.
- Fit generalized regression model.
- Specify response variable.
- Use validation column.
- Define effects.
- Set personality to Generalized Regression.
- Choose ZI Poisson distribution.
- Run model with Elastic Net estimation.
- Retrieve report object.
- Extract solution path.
Example 238
Summary: Fits a generalized regression model to predict Fish Caught, utilizing the Negative Binomial distribution and Elastic Net estimation method.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
Run( Fit( Estimation Method( Elastic Net ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set response variable to Fish Caught.
- Use Validation column for validation.
- Include specified effects in model.
- Choose Generalized Regression personality.
- Specify Negative Binomial distribution.
- Run model with Elastic Net estimation.
- Retrieve model report.
- Extract solution path and validation negative log-likelihood.
- Get estimates for centered and scaled predictors.
- Extract estimates for dispersions.
Example 239
Summary: Fits a Generalized Regression model to a dataset, utilizing ZI Negative Binomial distribution and Elastic Net estimation method, and generates reports on parameter estimates and validation metrics.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Negative Binomial" ),
Run( Fit( Estimation Method( Elastic Net ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open table.
- Fit model using Generalized Regression.
- Set response variable.
- Specify validation column.
- Define effects.
- Choose ZI Negative Binomial distribution.
- Use Elastic Net estimation method.
- Validate using validation column.
- Retrieve report object.
- Extract solution path.
- Get validation negative log likelihood.
- Extract active minimum estimates.
- Extract dispersion estimates.
Example 240
Summary: Fits a generalized regression model to predict 'Fish Caught' using 'live bait', 'Fishing Poles', 'camper', 'People', and 'Children' as predictors, with ZI Gamma distribution and Elastic Net estimation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Gamma" ),
Run( Fit( Estimation Method( Elastic Net ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open table.
- Fit model.
- Set response variable.
- Specify validation column.
- Define effects.
- Choose Generalized Regression personality.
- Set ZI Gamma distribution.
- Run Elastic Net estimation.
- Retrieve report.
- Extract solution path.
- Get validation negative log-likelihood.
- Extract active minimum estimates.
- Extract dispersion estimates.
Example 241
Summary: Fits a Weibull generalized regression model to a data table, extracting solution path, negative log-likelihood, and parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :censor ),
Censor Code( "1" ),
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Weibull" ),
Run( Fit( Estimation Method( Elastic Net ), Validation Method( AICc ) ) )
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << gettrainingnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit model using Fit Model platform.
- Specify censoring variable.
- Set censor code.
- Define response variable.
- Include multiple effects.
- Choose Generalized Regression personality.
- Select Weibull distribution.
- Run fit with Elastic Net estimation.
- Extract solution path, negative log-likelihood, and parameter estimates.
Example 242
Summary: Generalized regression analysis on a data table, utilizing the Fit Model platform to estimate model parameters and generate a report.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :censor ),
Censor Code( "1" ),
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Personality( "Generalized Regression" ),
Generalized Distribution( "LogNormal" ),
Run( Fit( Estimation Method( Elastic Net ), Validation Method( AICc ) ) )
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << gettrainingnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Initiate Fit Model.
- Set censor variable.
- Define censor code.
- Specify response variable.
- List model effects.
- Choose Generalized Regression.
- Select LogNormal distribution.
- Run model with Elastic Net.
- Extract report.
Example 243
Summary: Generalized regression analysis process to fit a model with multiple predictors and validate its performance, generating reports and extracting key metrics.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Elastic Net( Alpha( 0.9 ), Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Start Fit Model process.
- Set response variable Y.
- Specify validation column.
- Define predictor effects.
- Choose Generalized Regression personality.
- Set Normal distribution.
- Run model with Elastic Net estimation.
- Use Validation Column method.
- Extract model report.
- Retrieve solution path.
- Obtain validation negative log-likelihood.
- Fetch parameter estimates matrix.
- Get scale estimates matrix.
Example 244
Summary: Generalized regression analysis for a Poisson-distributed response variable, utilizing Elastic Net estimation and validation methods.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Elastic Net( Alpha( 0.9 ), Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set response variable Y.
- Specify validation column.
- Define predictor effects.
- Choose Generalized Regression personality.
- Select Poisson distribution.
- Run model with Elastic Net.
- Extract solution path.
- Retrieve negative log likelihood.
Example 245
Summary: Fits a generalized regression model with specified parameters, extracting solution path data and validation negative log-likelihood.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Exponential" ),
Run( Fit( Estimation Method( Elastic Net( Alpha( 0.9 ), Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit model with specified parameters.
- Set response variable to Y.
- Use validation column for validation.
- Include multiple predictor effects.
- Choose Generalized Regression personality.
- Specify Exponential distribution.
- Run model using Elastic Net method.
- Extract model report.
- Retrieve solution path data.
- Get validation negative log-likelihood.
- Extract parameter estimates matrix.
Example 246
Summary: Fits a generalized regression model to a data table, utilizing Elastic Net estimation and Gamma distribution, with interactive report generation for parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Gamma" ),
Run( Fit( Estimation Method( Elastic Net( Alpha( 0.9 ), Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set response variable Y.
- Use validation column.
- Include multiple predictor effects.
- Choose Generalized Regression personality.
- Specify Gamma distribution.
- Run model with Elastic Net estimation.
- Retrieve model report.
- Extract solution path and negative log-likelihood.
- Get parameter estimates for centered predictors.
- Get parameter estimates for scaled predictors.
Example 247
Summary: Fits a Generalized Regression model to a data table, utilizing the Negative Binomial distribution and Elastic Net estimation method.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
Run( Fit( Estimation Method( Elastic Net( Alpha( 0.9 ), Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Start Fit Model platform.
- Set response variable Y.
- Use validation column.
- Include multiple effects.
- Choose Generalized Regression personality.
- Select Negative Binomial distribution.
- Run model with Elastic Net method.
- Extract solution path.
- Get validation negative log-likelihood.
Example 248
Summary: Fits a generalized regression model to predict Fish Caught, utilizing specified effects and validation, with subsequent retrieval of solution path and validation negative log-likelihood.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Elastic Net( Alpha( 0.9 ), Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit a generalized regression model.
- Set the response variable to Fish Caught.
- Use the Validation column for validation.
- Include specified effects in the model.
- Choose Generalized Regression personality.
- Specify Poisson distribution.
- Run the model with Elastic Net estimation.
- Retrieve the solution path.
- Get validation negative log-likelihood.
- Extract parameter estimates.
Example 249
Summary: Fits a generalized regression model with elastic net estimation and ZI Poisson distribution to predict 'Fish Caught' based on specified effects, utilizing the Validation column for validation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Poisson" ),
Run( Fit( Estimation Method( Elastic Net( Alpha( 0.9 ), Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Start fitting model.
- Set response variable: "Fish Caught".
- Use "Validation" column.
- Include specified effects.
- Choose "Generalized Regression" personality.
- Select "ZI Poisson" distribution.
- Run elastic net estimation.
- Use validation column method.
- Retrieve solution path.
- Get validation negative log-likelihood.
- Extract parameter estimates matrix.
- Retrieve scaling parameters matrix.
Example 250
Summary: Fits a Generalized Regression model with Negative Binomial distribution to predict Fish Caught, incorporating specified effects and validation column.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
Run( Fit( Estimation Method( Elastic Net( Alpha( 0.9 ), Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit Generalized Regression model.
- Set response variable: Fish Caught.
- Use Validation column.
- Include specified effects.
- Choose Negative Binomial distribution.
- Apply Elastic Net estimation with Alpha 0.9.
- Use Linear Grid for estimation.
- Retrieve solution path.
- Get validation negative log-likelihood.
Example 251
Summary: Fits a generalized regression model to predict 'Fish Caught' using Elastic Net estimation and Linear Grid, with validation based on the 'Validation' column.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Negative Binomial" ),
Run( Fit( Estimation Method( Elastic Net( Alpha( 0.9 ), Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Initiate Fit Model dialog.
- Set response variable to "Fish Caught".
- Specify validation method using "Validation" column.
- Include specified effects in model.
- Choose "Generalized Regression" personality.
- Select "ZI Negative Binomial" distribution.
- Run model with Elastic Net estimation and Linear Grid.
- Extract model report.
- Retrieve solution path and validation negative log likelihood.
Example 252
Summary: Fits a Generalized Regression model to predict 'Fish Caught' using Elastic Net estimation and ZI Gamma distribution, with validation based on a specified column.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Gamma" ),
Run( Fit( Estimation Method( Elastic Net( Alpha( 0.9 ), Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open table.
- Fit model using Generalized Regression.
- Set response variable.
- Specify validation column.
- Define effects.
- Choose ZI Gamma distribution.
- Run model with Elastic Net.
- Extract solution path.
- Get validation negative log-likelihood.
- Retrieve parameter estimates matrices.
Example 253
Summary: Fits a Weibull generalized regression model to a data table, extracting solution path, negative log-likelihood, and parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :censor ),
Censor Code( "1" ),
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Weibull" ),
Run( Fit( Estimation Method( Elastic Net( Alpha( 0.9 ), Linear Grid ) ), Validation Method( AICc ) ) )
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << gettrainingnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table.
- Launch Fit Model platform.
- Specify censor variable.
- Set censor code.
- Define response variable.
- Add predictor effects.
- Choose Generalized Regression personality.
- Select Weibull distribution.
- Run model with Elastic Net.
- Extract solution path, negative log-likelihood, and parameter estimates.
Example 254
Summary: Fits a generalized regression model to a data table, utilizing the Fit Model platform with Elastic Net estimation and AICc validation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :censor ),
Censor Code( "1" ),
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Personality( "Generalized Regression" ),
Generalized Distribution( "LogNormal" ),
Run( Fit( Estimation Method( Elastic Net( Alpha( 0.9 ), Linear Grid ) ), Validation Method( AICc ) ) )
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << gettrainingnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table.
- Fit model using Fit Model platform.
- Set censor variable and code.
- Define response variable (Time).
- Specify effects (predictors).
- Choose Generalized Regression personality.
- Select LogNormal distribution.
- Run model with Elastic Net method.
- Use AICc for validation.
- Retrieve solution path, negative log-likelihood, and parameter estimates.
Example 255
Summary: Generalized regression analysis process, fitting a model to predict Y while excluding an intercept term and incorporating multiple predictors.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
No Intercept,
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Elastic Net ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Initiate Fit Model process.
- Set response variable Y.
- Use validation column.
- Exclude intercept term.
- Include multiple predictors.
- Choose Generalized Regression personality.
- Specify Normal distribution.
- Run Elastic Net estimation.
- Retrieve model report.
- Extract solution path.
- Get validation negative log-likelihood.
- Fetch parameter estimates matrix.
- Obtain scaling parameters matrix.
Example 256
Summary: Fits a generalized regression model to a data table, using elastic net estimation and Poisson distribution, with specified effects and validation column.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Poisson" ),
No Intercept,
Run( Fit( Estimation Method( Elastic Net ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set response variable as Y.
- Use validation column.
- Include specified effects.
- Choose Poisson distribution.
- Exclude intercept term.
- Use elastic net estimation.
- Retrieve model report.
- Extract solution path.
Example 257
Summary: Fits a Generalized Regression model to a data table, utilizing multiple predictor effects and excluding an intercept term.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
No Intercept,
Generalized Distribution( "Exponential" ),
Run( Fit( Estimation Method( Elastic Net ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit Generalized Regression model.
- Set response variable Y.
- Use Validation column.
- Include multiple predictor effects.
- Exclude intercept term.
- Specify Exponential distribution.
- Run Elastic Net estimation.
- Retrieve report object.
- Extract solution path.
Example 258
Summary: Fits a Generalized Regression model to a data table, utilizing Gamma distribution and Elastic Net estimation, with validation column and solution path retrieval.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Gamma" ),
No Intercept,
Run( Fit( Estimation Method( Elastic Net ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit Generalized Regression model.
- Set response variable Y.
- Use validation column.
- Include specified effects.
- Choose Gamma distribution.
- Exclude intercept term.
- Run Elastic Net estimation.
- Extract solution path.
- Retrieve validation negative log-likelihood.
Example 259
Summary: Generalized regression analysis process for a data table, utilizing the Fit Model platform to estimate model parameters and validate results.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
No Intercept,
Run( Fit( Estimation Method( Elastic Net ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Start Fit Model process.
- Set response variable Y.
- Use Validation column.
- Include multiple predictor effects.
- Choose Generalized Regression personality.
- Select Negative Binomial distribution.
- Exclude intercept from model.
- Run Elastic Net estimation.
- Validate using Validation Column.
Example 260
Summary: Fits a generalized regression model with Poisson distribution to a data table, utilizing specified effects and validation column.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
No Intercept,
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Elastic Net ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table.
- Fit model with specified settings.
- Set response variable.
- Specify validation column.
- Define model effects.
- Choose Generalized Regression personality.
- Exclude intercept from model.
- Set Poisson distribution.
- Run Elastic Net estimation.
- Use validation column method.
Example 261
Summary: Fits a generalized regression model to predict 'Fish Caught' using 'live bait', 'Fishing Poles', 'camper', 'People', and 'Children' as predictors, with 'ZI Poisson' distribution and Elastic Net estimation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Poisson" ),
No Intercept,
Run( Fit( Estimation Method( Elastic Net ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set response variable: "Fish Caught".
- Specify validation column: "Validation".
- Define effects: "live bait", "Fishing Poles", "camper", "People", "Children".
- Choose "Generalized Regression" personality.
- Select "ZI Poisson" distribution.
- Exclude intercept from model.
- Run model with Elastic Net estimation and validation.
- Extract model report, solution path, negative log-likelihood, and parameter estimates.
Example 262
Summary: Fits a generalized regression model with negative binomial distribution to predict 'Fish Caught' using specified effects and validation, excluding intercept.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
No iNtercept,
Run( Fit( Estimation Method( Elastic Net ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit model with specified parameters.
- Set response variable to "Fish Caught".
- Use validation column for validation.
- Include specified effects in the model.
- Choose "Generalized Regression" personality.
- Set distribution to "Negative Binomial".
- Exclude intercept from the model.
- Run fit using Elastic Net method.
- Retrieve solution path, validation negative log-likelihood, and parameter estimates.
Example 263
Summary: Fits and creates reports for a generalized regression model with negative binomial distribution to predict 'Fish Caught' based on various effects, utilizing Lasso estimation method.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Negative Binomial" ),
No Intercept,
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set response variable: "Fish Caught".
- Use validation column: "Validation".
- Include effects: live bait, Fishing Poles, camper, People, Children.
- Choose "Generalized Regression" personality.
- Use "ZI Negative Binomial" distribution.
- Exclude intercept from model.
- Run Lasso estimation method.
- Retrieve solution path, validation negative log-likelihood, and parameter estimates.
Example 264
Summary: Fits a Generalized Regression model to predict 'Fish Caught' using specified effects, with ZI Gamma distribution and Elastic Net estimation method.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Gamma" ),
No Intercept,
Run( Fit( Estimation Method( Elastic Net ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit Generalized Regression model.
- Set response variable: "Fish Caught".
- Use validation column.
- Include specified effects.
- Choose "ZI Gamma" distribution.
- Exclude intercept.
- Use Elastic Net estimation method.
- Validate using validation column.
- Extract solution path, NLL, and parameter estimates.
Example 265
Summary: Fits a generalized regression model to predict continuous outcomes, utilizing an Elastic Net estimation method and normal distribution.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
No Intercept,
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Elastic Net( Alpha( 0.9 ), Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set response variable Y.
- Specify validation column.
- Exclude intercept from model.
- Include multiple predictors.
- Choose Generalized Regression personality.
- Select Normal distribution.
- Run Elastic Net estimation.
- Use validation column method.
- Extract report object.
- Retrieve solution path.
- Obtain validation negative log-likelihood.
- Fetch parameter estimates matrix.
- Get scaling factors matrix.
Example 266
Summary: Fits a generalized regression model to a data table, utilizing Poisson distribution and Elastic Net estimation method with Alpha set to 0.9.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Poisson" ),
No Intercept,
Run( Fit( Estimation Method( Elastic Net( Alpha( 0.9 ), Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit model using Generalized Regression.
- Set response variable to Y.
- Use Validation column for validation.
- Include specified effects in the model.
- Choose Poisson distribution for Generalized Regression.
- Exclude intercept from the model.
- Use Elastic Net estimation method.
- Set Alpha to 0.9 for Elastic Net.
- Retrieve solution path, validation negative log-likelihood, and parameter estimates.
Example 267
Summary: Generalized regression analysis on a data table, using the Fit Model platform to estimate model parameters and validate results.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
No Intercept,
Generalized Distribution( "Exponential" ),
Run( Fit( Estimation Method( Elastic Net( Alpha( 0.9 ), Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set response variable Y.
- Specify validation column.
- Include multiple predictor effects.
- Choose Generalized Regression personality.
- Exclude intercept from model.
- Select Exponential distribution.
- Run Elastic Net estimation with alpha 0.9.
- Use validation column method.
Example 268
Summary: Fits a generalized regression model to a data table, utilizing Elastic Net estimation and Gamma distribution, with interactive features for solution path extraction and parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Gamma" ),
No Intercept,
Run( Fit( Estimation Method( Elastic Net( Alpha( 0.9 ), Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set response variable as Y.
- Use validation column for validation.
- Include specified effects in model.
- Choose Gamma distribution for Generalized Regression.
- Exclude intercept from model.
- Run model using Elastic Net estimation method.
- Use Validation Column for validation method.
- Extract solution path, negative log likelihood, and parameter estimates.
Example 269
Summary: Generalized regression analysis with negative binomial distribution to model the relationship between response variable Y and predictor effects, excluding an intercept term.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
No Intercept,
Run( Fit( Estimation Method( Elastic Net( Alpha( 0.9 ), Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Launch Fit Model platform.
- Set response variable Y.
- Specify validation column.
- Define predictor effects.
- Choose Generalized Regression personality.
- Select Negative Binomial distribution.
- Exclude intercept term.
- Run Elastic Net estimation.
- Use validation column method.
- Retrieve model report.
- Extract solution path.
- Get validation negative log-likelihood.
- Fetch active minimum estimates.
- Collect dispersion estimates.
Example 270
Summary: Generalized regression analysis for 'Fish Caught' response variable, incorporating effects of live bait, Fishing Poles, camper, People, and Children, with validation column 'Validation', using Poisson distribution and Elastic Net estimation method.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
No Intercept,
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Elastic Net( Alpha( 0.9 ), Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data_table data
- Start Fit Model process.
- Set response variable: "Fish Caught".
- Specify validation column: "Validation".
- Include effects: live bait, Fishing Poles, camper, People, Children.
- Choose "Generalized Regression" personality.
- Exclude intercept from model.
- Use Poisson distribution.
- Fit model using Elastic Net with alpha 0.9 and linear grid.
- Validate using validation column method.
Example 271
Summary: Fits a generalized regression model with ZI Poisson distribution to predict Fish Caught, incorporating specified effects and excluding intercept.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Poisson" ),
No Intercept,
Run( Fit( Estimation Method( Elastic Net( Alpha( 0.9 ), Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Launch Fit Model platform.
- Set response variable: Fish Caught.
- Use Validation column for validation.
- Include specified effects: live bait, Fishing Poles, camper, People, Children.
- Choose Generalized Regression personality.
- Select ZI Poisson distribution.
- Exclude intercept from model.
- Run Elastic Net estimation with Alpha = 0.9 and Linear Grid.
- Use Validation Column for validation method.
Example 272
Summary: Fits a generalized regression model with negative binomial distribution to predict 'Fish Caught' based on various predictor effects, excluding an intercept term.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
No iNtercept,
Run( Fit( Estimation Method( Elastic Net( Alpha( 0.9 ), Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data_table data
- Define dataset variable.
- Launch Fit Model platform.
- Set response variable.
- Specify validation column.
- Add predictor effects.
- Choose Generalized Regression personality.
- Select Negative Binomial distribution.
- Exclude intercept term.
- Run model with Elastic Net method.
Example 273
Summary: Fits a generalized regression model with ZI Gamma distribution to predict 'Fish Caught' using specified effects and validation column, excluding intercept.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Gamma" ),
No Intercept,
Run( Fit( Estimation Method( Elastic Net( Alpha( 0.9 ), Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit model with specified parameters.
- Set response variable to "Fish Caught".
- Use validation column for model validation.
- Include specific effects in the model.
- Choose "Generalized Regression" personality.
- Select "ZI Gamma" distribution.
- Exclude intercept from the model.
- Fit model using Elastic Net method.
- Retrieve solution path, validation NLL, and parameter estimates.
Example 274
Summary: Fits a generalized regression model to a data table, utilizing Lasso estimation and normal distribution, and extracts relevant solution path and parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get validation Negative Loglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Specify response variable.
- Set validation method.
- Define predictor effects.
- Choose personality: generalized regression.
- Select normal distribution.
- Run fit with Lasso estimation.
- Extract report object.
- Retrieve solution path.
- Get validation negative loglikelihood.
- Extract parameter estimates matrix.
- Extract scale estimates matrix.
Example 275
Summary: Fits a generalized regression model with Poisson distribution and Lasso estimation method to a data table, including multiple effects and validation column.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set response variable.
- Specify validation column.
- Include multiple effects.
- Choose Poisson distribution.
- Use Lasso estimation method.
- Validate using validation column.
- Retrieve report object.
- Extract solution path.
Example 276
Summary: Fits a generalized regression model to predict continuous outcomes, utilizing Lasso estimation and an Exponential distribution.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Exponential" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set response variable.
- Define validation method.
- Specify predictor effects.
- Choose Generalized Regression personality.
- Select Exponential distribution.
- Run model with Lasso estimation.
- Extract model report.
- Retrieve solution path.
- Obtain validation negative log-likelihood.
- Fetch parameter estimates matrix.
Example 277
Summary: Fits a generalized regression model to a data table, utilizing Lasso estimation and Gamma distribution, and retrieves relevant metrics such as solution path, negative log-likelihood, and parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Gamma" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Launch Fit Model platform.
- Set response variable Y.
- Use validation column.
- Specify predictor variables.
- Choose Generalized Regression personality.
- Select Gamma distribution.
- Run Lasso estimation.
- Retrieve model report.
- Extract solution path.
- Get negative log-likelihood.
- Fetch active minimum estimates.
- Retrieve dispersion estimates.
Example 278
Summary: Generalized regression analysis with negative binomial distribution and Lasso estimation, extracting model report, solution path, and validation metrics.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set response variable.
- Specify validation column.
- Define predictor effects.
- Choose Generalized Regression personality.
- Select Negative Binomial distribution.
- Run model with Lasso estimation.
- Extract model report.
- Retrieve solution path.
- Obtain validation negative log-likelihood.
- Fetch active minimum estimates.
- Extract dispersion estimates.
Example 279
Summary: Generalized regression analysis with Poisson distribution to model the relationship between 'Fish Caught' and specified effects, utilizing Fit Model platform.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Launch Fit Model platform.
- Set response variable to "Fish Caught".
- Use "Validation" column for validation.
- Include specified effects: live bait, Fishing Poles, camper, People, Children.
- Choose "Generalized Regression" personality.
- Specify "Poisson" distribution.
- Run model with Lasso estimation and validation.
- Retrieve model report.
- Extract solution path and validation negative log-likelihood.
Example 280
Summary: Fits a generalized regression model to predict 'Fish Caught' based on various effects, and retrieves relevant metrics from the report.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Poisson" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set response variable.
- Specify validation method.
- Define model effects.
- Choose generalized distribution.
- Run fit with Lasso estimation.
- Retrieve model report.
- Extract solution path.
- Get validation negative log-likelihood.
Example 281
Summary: Fits a Generalized Regression model with Negative Binomial distribution to predict Fish Caught, utilizing specified effects and validation column.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table.
- Start fitting a model.
- Set the response variable to Fish Caught.
- Use the Validation column.
- Include specified effects in the model.
- Choose Generalized Regression personality.
- Specify Negative Binomial distribution.
- Run the model with Lasso estimation and validation.
- Retrieve the report object.
- Extract the solution path and validation negative log-likelihood.
Example 282
Summary: Fits a generalized regression model to predict 'Fish Caught' based on various effects, and retrieves relevant report metrics.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Negative Binomial" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open table.
- Fit generalized regression model.
- Set response variable.
- Specify validation column.
- Define effects.
- Choose personality.
- Select distribution.
- Run fit with Lasso estimation.
- Retrieve report.
- Get solution path.
Example 283
Summary: Fits a generalized regression model to predict 'Fish Caught' using specified effects, validation column, and Lasso estimation method, while retrieving solution path and parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Gamma" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set response variable "Fish Caught".
- Use validation column "Validation".
- Include specified effects.
- Choose "ZI Gamma" distribution.
- Run Lasso estimation method.
- Extract solution path.
- Get validation negative log-likelihood.
- Retrieve parameter estimates matrices.
Example 284
Summary: Fits a generalized regression model to a data table, utilizing Weibull distribution and Lasso estimation with AICc validation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :censor ),
Censor Code( "1" ),
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Weibull" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( AICc ) ) )
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << gettrainingnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set censor variable.
- Define response variable.
- Specify effects variables.
- Choose Weibull distribution.
- Run Lasso estimation.
- Use AICc validation.
- Retrieve model report.
- Extract solution path.
Example 285
Summary: Fits a generalized regression model to a data table, utilizing Lasso estimation and AICc validation, while extracting solution path, negative log-likelihood, and parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :censor ),
Censor Code( "1" ),
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Personality( "Generalized Regression" ),
Generalized Distribution( "LogNormal" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( AICc ) ) )
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << gettrainingnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit model using Fit Model platform.
- Set censor variable.
- Define censor code.
- Specify response variable "Time".
- Include multiple effects in model.
- Choose "Generalized Regression" personality.
- Select "LogNormal" distribution.
- Run fit with Lasso estimation and AICc validation.
- Extract solution path, negative log-likelihood, and parameter estimates.
Example 286
Summary: Fits a generalized regression model to a data table, using Lasso estimation and BIC validation, with solution path summary display.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( BIC ) ) )
);
obj << (Fit[1] << Show Solution Path Summary( 1 ));
rpt = obj << report;
measure1 = rpt[Outline Box( "Model Summary" )][Table Box( 2 )] << get as matrix;
path1 = (rpt[Outline Box( "Solution Path Summary" )][Table Box( 1 )] << get as matrix)[3, 0];
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set response variable.
- Specify model effects.
- Choose Generalized Regression personality.
- Select Normal distribution.
- Run model with Lasso estimation.
- Use BIC for validation.
- Display solution path summary.
- Extract model summary matrix.
Example 287
Summary: Runs the Generalized Regression model fitting process with Lasso estimation method and Normal distribution, extracting solution path and validation negative loglikelihood.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get validation Negative Loglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Start Fit Model process.
- Set response variable Y.
- Use Validation column.
- Include multiple effects.
- Choose Generalized Regression personality.
- Specify Normal distribution.
- Run model with Lasso method.
- Extract report object.
- Retrieve solution path.
Example 288
Summary: Generalized regression analysis on a data table, utilizing the Fit Model platform to estimate parameters and generate a report.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Start Fit Model platform.
- Set response variable Y.
- Specify validation column.
- Define predictor effects.
- Choose Generalized Regression personality.
- Select Poisson distribution.
- Run Lasso linear grid fit.
- Use validation column method.
- Extract report object.
- Retrieve solution path.
- Get validation negative log-likelihood.
- Fetch parameter estimates matrix.
Example 289
Summary: Performs the generalized regression modeling process for a given data table, utilizing Lasso estimation and Exponential distribution to generate parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Exponential" ),
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Start Fit Model process.
- Set response variable.
- Configure validation method.
- Define predictor effects.
- Choose Generalized Regression personality.
- Specify Exponential distribution.
- Run model with Lasso estimation.
- Extract model report.
- Retrieve solution path.
- Get validation negative log-likelihood.
- Extract parameter estimates matrix.
Example 290
Summary: Fits a generalized regression model to a data table, utilizing Lasso linear grid estimation and gamma distribution.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Gamma" ),
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set Y variable.
- Specify validation method.
- Define model effects.
- Choose Generalized Regression personality.
- Select Gamma distribution.
- Run Lasso Linear Grid estimation.
- Extract model report.
- Retrieve solution path.
- Obtain validation negative log-likelihood.
- Get active minimum estimates.
- Fetch dispersion estimates.
Example 291
Summary: Fits a generalized regression model with negative binomial distribution and Lasso estimation method to a specified data table, utilizing validation column and retrieving solution path and validation NLL.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit model with specified parameters.
- Set Y variable to :Y.
- Use validation column :Validation.
- Include multiple effects in model.
- Choose Generalized Regression personality.
- Set distribution to Negative Binomial.
- Run fit with Lasso method.
- Retrieve report object.
- Extract solution path and validation NLL.
Example 292
Summary: Generalized regression analysis with Poisson distribution and Lasso estimation method on the 'Fish Caught' response variable, using validation column and specifying effects of 'live bait', 'Fishing Poles', 'camper', 'People', and 'Children'.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Start Fit Model platform.
- Set response variable.
- Use validation column.
- Define predictor effects.
- Choose Generalized Regression.
- Specify Poisson distribution.
- Run model with Lasso.
- Retrieve report object.
- Extract solution path.
Example 293
Summary: Generalized regression analysis with Lasso estimation and validation, using the Fit Model platform to analyze the relationship between 'Fish Caught' and various effects.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Poisson" ),
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set response variable: Fish Caught.
- Specify validation column: Validation.
- Define effects: live bait, Fishing Poles, camper, People, Children.
- Choose Generalized Regression personality.
- Select ZI Poisson distribution.
- Run model with Lasso estimation and validation.
- Retrieve report object.
- Extract solution path.
- Obtain validation negative log-likelihood.
- Get active minimum estimates.
- Fetch scaling estimates.
Example 294
Summary: Fits a generalized regression model with negative binomial distribution to predict 'Fish Caught' using various effects, and extracts parameter estimates for active and dispensed terms.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table.
- Launch Fit Model platform.
- Set response variable: "Fish Caught".
- Use "Validation" column for validation.
- Include effects: "live bait", "Fishing Poles", "camper", "People", "Children".
- Choose "Generalized Regression" personality.
- Specify "Negative Binomial" distribution.
- Run model with Lasso estimation method.
- Extract solution path from fit.
- Get validation negative log-likelihood.
- Retrieve centered and scaled parameter estimates for active terms.
- Retrieve centered and scaled parameter estimates for dispensed terms.
Example 295
Summary: Fits a generalized regression model with ZI Negative Binomial distribution to predict 'Fish Caught' using specified effects and validation column, generating report and extracting solution path and negative log likelihood.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Negative Binomial" ),
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit model with specified parameters.
- Set response variable as "Fish Caught".
- Use validation column for validation.
- Include specified effects in model.
- Choose "Generalized Regression" personality.
- Set distribution as "ZI Negative Binomial".
- Run fit with Lasso estimation method.
- Retrieve report from model object.
- Extract solution path and negative log likelihood.
- Get estimates for centered and scaled predictors.
- Retrieve additional parameter estimates.
Example 296
Summary: Generalized regression analysis process for a specified data table, utilizing Lasso estimation and validation to generate model reports with solution paths, negative log likelihood, and parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Gamma" ),
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Start Fit Model process.
- Set response variable "Fish Caught".
- Use "Validation" column for validation.
- Include specified effects in model.
- Choose "Generalized Regression" personality.
- Select "ZI Gamma" distribution.
- Run model with Lasso estimation and validation.
- Retrieve model report.
- Extract solution path, validation NLL, and parameter estimates.
Example 297
Summary: Runs a Weibull generalized regression model fit with Lasso estimation and AICc validation, extracting solution path, negative log-likelihood, estimates, and scales from the data table.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :censor ),
Censor Code( "1" ),
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Weibull" ),
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( AICc ) ) )
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << gettrainingnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Set censor variable.
- Define censor code.
- Specify response variable.
- Include multiple effects.
- Choose Generalized Regression personality.
- Select Weibull distribution.
- Run model with Lasso and AICc validation.
- Extract solution path, negative log-likelihood, estimates, and scales.
Example 298
Summary: Generalized regression analysis with Lasso estimation and AICc validation, extracting report, solution path, and negative log-likelihood from the model object.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :censor ),
Censor Code( "1" ),
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Personality( "Generalized Regression" ),
Generalized Distribution( "LogNormal" ),
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( AICc ) ) )
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << gettrainingnegativeloglikelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table.
- Launch Fit Model platform.
- Specify censoring variable and code.
- Set response variable as time.
- Define effects for analysis.
- Choose Generalized Regression personality.
- Select LogNormal distribution.
- Run model with Lasso and AICc validation.
- Extract report from model object.
- Retrieve solution path and negative log-likelihood.
Example 299
Summary: Fits a generalized regression model to predict continuous outcomes, utilizing Lasso estimation and normal distribution.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
No Intercept,
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Launch Fit Model platform.
- Set response variable.
- Specify validation column.
- Exclude intercept term.
- Define predictor effects.
- Choose Generalized Regression personality.
- Select Normal distribution.
- Run Lasso estimation.
- Extract solution path, NLL, estimates, and scales.
Example 300
Summary: Fits a generalized regression model to a data table, utilizing Lasso estimation and validation, and extracts relevant solution path, negative log-likelihood, and parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
No Intercept,
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Initiate Fit Model.
- Set response variable.
- Specify validation column.
- Define predictor effects.
- Choose Generalized Regression personality.
- Exclude intercept.
- Select Poisson distribution.
- Run Lasso estimation with validation.
- Extract solution path, negative log-likelihood, and parameter estimates.
Example 301
Summary: Fits a generalized regression model with specified effects, excluding intercept and using Lasso estimation method, and retrieves relevant reports and estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
No Intercept,
Generalized Distribution( "Exponential" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit model with specified effects.
- Use Generalized Regression personality.
- Exclude intercept from model.
- Set Exponential distribution.
- Apply Lasso estimation method.
- Use validation column for validation.
- Retrieve model report.
- Extract solution path.
- Get validation negative log-likelihood.
- Extract parameter estimates matrix.
Example 302
Summary: Fits a generalized regression model to predict continuous outcomes, utilizing Lasso estimation and Gamma distribution.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Gamma" ),
No Intercept,
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set response variable Y.
- Specify validation column.
- Include multiple predictor effects.
- Choose Gamma distribution.
- Exclude intercept term.
- Run Lasso estimation method.
- Use validation column method.
- Retrieve solution path, NLL, and estimates.
Example 303
Summary: Fits a Generalized Regression model to a data table, specifying multiple effects and excluding an intercept, with Lasso estimation and Negative Binomial distribution.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
No Intercept,
Generalized Distribution( "Negative Binomial" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit Generalized Regression model.
- Specify Y variable.
- Use validation column.
- Include multiple effects.
- Select Generalized Regression personality.
- Exclude intercept.
- Set Negative Binomial distribution.
- Run Lasso estimation.
- Retrieve solution path, NLL, and estimates.
Example 304
Summary: Generalized regression analysis with Poisson distribution to model 'Fish Caught' based on specified effects, excluding intercept and validating the results using the 'Validation' column.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
No Intercept,
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Start Fit Model process.
- Set response variable to "Fish Caught".
- Use "Validation" column for validation.
- Include specified effects in model.
- Choose "Generalized Regression" personality.
- Exclude intercept from model.
- Set distribution to "Poisson".
- Run Lasso estimation with validation.
- Extract solution path and negative log-likelihood.
- Retrieve parameter estimates for centered predictors.
Example 305
Summary: Fits a generalized regression model to predict 'Fish Caught' based on various effects, utilizing Lasso estimation and validation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Poisson" ),
No Intercept,
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open table.
- Fit generalized regression model.
- Set response variable.
- Specify validation method.
- Define effects.
- Choose personality.
- Select distribution.
- Exclude intercept.
- Run Lasso estimation.
- Extract solution path.
Example 306
Summary: Fits a generalized negative binomial model with Lasso estimation and validation, generating report and solution path for analysis.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
No Intercept,
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open table.
- Fit model.
- Specify response variable.
- Set validation method.
- Define effects.
- Choose personality.
- Select distribution.
- Exclude intercept.
- Run fit with Lasso.
- Retrieve report and solution path.
Example 307
Summary: Fits a generalized regression model with ZI Gamma distribution and Lasso estimation method, generating a report and extracting solution path, validation negative log-likelihood, active minimum estimates, and dispersion estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Gamma" ),
No Intercept,
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open table.
- Fit model with specified settings.
- Store fit object.
- Generate report.
- Retrieve solution path.
- Get validation negative log-likelihood.
- Extract active minimum estimates.
- Extract dispersion estimates.
Example 308
Summary: Generalized regression analysis with Lasso estimation and linear grid, using the Fit Model platform in JMP to analyze the relationship between response variable Y and specified effects.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
No Intercept,
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Start Fit Model process.
- Set response variable Y.
- Use validation column.
- Exclude intercept term.
- Include specified effects.
- Choose Generalized Regression personality.
- Specify Normal distribution.
- Run Lasso estimation with Linear Grid.
- Use Validation Column method.
Example 309
Summary: Fits a generalized regression model with Poisson distribution and Lasso linear grid estimation, utilizing specified effects and validation column.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
No Intercept,
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set response variable to Y.
- Use validation column.
- Include specified effects.
- Choose generalized regression personality.
- Exclude intercept term.
- Set Poisson distribution.
- Run Lasso linear grid estimation.
- Use validation column method.
Example 310
Summary: Fits a Generalized Regression model to a data table, utilizing specified effects and excluding an intercept, with interactive features for solution path extraction and parameter estimation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
No Intercept,
Generalized Distribution( "Exponential" ),
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit model using Generalized Regression.
- Set response variable to Y.
- Use Validation column.
- Include specified effects.
- Exclude intercept from model.
- Use Exponential distribution.
- Run Lasso estimation method.
- Use Validation Column method.
- Extract solution path, negative log likelihood, and parameter estimates.
Example 311
Summary: Generalized regression analysis with Lasso estimation, retrieving solution path, validation NLL, and parameter estimates for centered and scaled predictors.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Gamma" ),
No Intercept,
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Launch Fit Model platform.
- Set response variable Y.
- Specify validation column.
- Add multiple predictor effects.
- Choose Generalized Regression personality.
- Select Gamma distribution.
- Exclude intercept term.
- Run model with Lasso estimation.
- Retrieve solution path, validation NLL, and parameter estimates.
Example 312
Summary: Fits a generalized negative binomial regression model to a data table, extracting solution path, validation NLL, and parameter estimates.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Validation( :Validation ),
Effects( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
No Intercept,
Generalized Distribution( "Negative Binomial" ),
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Launch Fit Model platform.
- Set response variable Y.
- Specify validation column.
- Define predictor effects.
- Choose Generalized Regression personality.
- Exclude intercept from model.
- Select Negative Binomial distribution.
- Run Lasso estimation method.
- Extract solution path, validation NLL, and parameter estimates.
Example 313
Summary: Generalized regression analysis with Lasso estimation and Poisson distribution to model the relationship between 'Fish Caught' and various predictors, including live bait, Fishing Poles, camper, People, and Children.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
No Intercept,
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table.
- Launch Fit Model platform.
- Set response variable: "Fish Caught".
- Specify validation column: "Validation".
- Include effects: live bait, Fishing Poles, camper, People, Children.
- Choose "Generalized Regression" personality.
- Exclude intercept from model.
- Set distribution to Poisson.
- Run Lasso regression with linear grid and validation.
- Retrieve report, solution path, and negative log likelihood.
Example 314
Summary: Creates and analyzes a generalized regression model for 'Fish Caught' data, utilizing Lasso estimation and ZI Poisson distribution.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Poisson" ),
No Intercept,
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
scale = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Create Fit Model object.
- Set response variable "Fish Caught".
- Use validation column "Validation".
- Include specified effects.
- Choose Generalized Regression personality.
- Set distribution to ZI Poisson.
- Exclude intercept from model.
- Run fit with Lasso estimation.
- Retrieve solution path, validation NLL, estimates, and scales.
Example 315
Summary: Fits a generalized regression model using Lasso estimation method and negative binomial distribution to predict 'Fish Caught' based on specified effects, with validation and solution path retrieval.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
No Intercept,
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
obj << close window( 1 );
Code Explanation:
- Open data table;
- Launch Fit Model platform.
- Set response variable "Fish Caught".
- Use "Validation" column for validation.
- Include specified effects: live bait, Fishing Poles, camper, People, Children.
- Choose "Generalized Regression" personality.
- Specify "Negative Binomial" distribution.
- Exclude intercept from model.
- Fit model using Lasso method.
- Retrieve solution path, validation negative log likelihood, and parameter estimates.
Example 316
Summary: Generalized regression analysis with Lasso linear grid estimation and validation, using the Fit Model platform to analyze the relationship between 'Fish Caught' and various effects.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Gamma" ),
No Intercept,
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
obj << close window( 1 );
Code Explanation:
- Open data table.
- Initiate Fit Model platform.
- Set response variable to "Fish Caught".
- Specify validation method using "Validation" column.
- Define effects: "live bait", "Fishing Poles", "camper", "People", "Children".
- Choose "Generalized Regression" personality.
- Select "ZI Gamma" distribution.
- Exclude intercept from model.
- Run Lasso linear grid estimation and validation.
- Retrieve model report, solution path, and validation negative log likelihood.
Example 317
Summary: Fits a generalized regression model using negative binomial distribution to predict Fish Caught, with effects from live bait, Fishing Poles, camper, People, and Children, and validates the model using the Validation column.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Negative Binomial" ),
No Intercept,
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
obj << close window( 1 );
Code Explanation:
- Open data table.
- Launch Fit Model platform.
- Set response variable: Fish Caught.
- Specify validation column: Validation.
- Include effects: live bait, Fishing Poles, camper, People, Children.
- Choose Generalized Regression personality.
- Select Negative Binomial distribution.
- Exclude intercept from model.
- Fit model using Lasso method on a linear grid.
- Validate using validation column method.
Example 318
Summary: Fits a generalized regression model with ZI Gamma distribution, excluding intercept, and retrieves solution path, negative log-likelihood, and parameter estimates for 'Fish Caught' response variable.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles, :camper, :People, :Children ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Gamma" ),
No Intercept,
Run( Fit( Estimation Method( Lasso( Linear Grid ) ), Validation Method( Validation Column ) ) ),
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
nll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
disp = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Fit model with specified parameters.
- Set response variable to "Fish Caught".
- Use validation column for model validation.
- Include specified effects in the model.
- Choose "Generalized Regression" personality.
- Select "ZI Gamma" distribution.
- Exclude intercept from the model.
- Run model with Lasso estimation method.
- Retrieve solution path, negative log-likelihood, and parameter estimates.
Example 319
Summary: Fits a generalized linear model with Poisson distribution and log link function to a data table, generating SAS code for further analysis.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :N ),
Effects( :Type ),
Offset( :Service ),
Personality( "Generalized Linear Model" ),
GLM Distribution( "Poisson" ),
Link Function( "Log" )
);
obj << Create SAS Job;
sascode = Window( "Ship DamageModel" )[Script Box( 1 )] << get lines;
Window( "Ship DamageModel" ) << close window;
Close( dt, no save );
b rslt = [4.50017784113505 0.371513276998821 127.701748730643 1.30443525580894e-29 3.76418857523 5.21998107171987,
-0.00851501345000916 0.00609230940334082 2.04007561406821 0.153202030604554 -0.020797176440554 0.00307277597455927,
0.0199001700105465 0.00454161806340972 19.2314314154331 0.0000115791135777285 0.0110057600963956 0.0288156019559727,
-0.000218862612504252 0.0000955880509885524 5.22465704900981 0.0222688372668224 -0.000406211744647699 -0.0000312604056187989];
Code Explanation:
- Open table.
- Fit generalized linear model.
- Set response variable.
- Add effect.
- Include offset.
- Choose Poisson distribution.
- Use log link function.
- Create SAS job.
- Extract SAS code.
- Close windows.
Example 320
Summary: Fits a generalized linear model to predict height based on weight, using a power link function with a parameter of 5 and normal distribution.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :height ),
Effects( :weight ),
Personality( "Generalized Linear Model" ),
Set Alpha Level( 0.05 ),
GLM Distribution( "Normal" ),
Link Function( "Power" ),
Power Link Parameter( 5 ),
Overdispersion Tests and Intervals( 0 ),
Name( "Firth Bias-adjusted Estimates" )(0),
Run()
);
obj << Save Script to Data Table;
test = Char( dt << Get Property( "Generalized Linear Model" ) );
Code Explanation:
- Open data table;
- Fit generalized linear model.
- Set response variable to height.
- Include weight as effect.
- Use normal distribution.
- Apply power link function.
- Set power parameter to 5.
- Disable overdispersion tests.
- Disable Firth bias adjustment.
- Save script to data table.
Example 321
Summary: Fits a generalized linear model with Poisson distribution and log link function to a data table, utilizing the Fit Model platform in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :satell ),
Effects( :color, :spine, :width, :weight ),
Center Polynomials( 0 ),
Personality( "Generalized Linear Model" ),
GLM Distribution( "Poisson" ),
Link Function( "Log" ),
Overdispersion Tests and Intervals( 0 ),
Name( "Firth Bias-Adjusted Estimates" )(0),
Run( "color" << Contrast( [-1 0 0.5 0.5] ) )
);
rpt = obj << report;
b level1 = Arg( dt:color << get value labels );
b level1 = {"Light Med", "Medium", "Dark Med", "Dark"};
level1 = rpt[Outline Box( "Contrast" )][String Col Box( 1 )] << get;
b test1 = [-1, 0, 0.5, 0.5, -0.522282570453379, 0.191426432028984, 7.0941720287118, 0.00773350103815145, 455.988715863628];
b test2 = [455.988715863628, 1, 7.0941720287118, 0.00773350103815145];
test1 = rpt[Outline Box( "Contrast" )][Number Col Box( 2 )] << get as matrix;
test2 = rpt[Outline Box( "Contrast" )][Number Col Box( 3 )] << get as matrix;
Code Explanation:
- Open data table.
- Fit generalized linear model.
- Set response variable.
- Define predictor variables.
- Disable polynomial centering.
- Select GLM personality.
- Use Poisson distribution.
- Apply log link function.
- Disable overdispersion tests.
- Disable Firth bias adjustment.
Example 322
Summary: Fits Generalized Linear Models for height, grouped by age, and calculates mean confidence intervals with 95% CI extraction for a specific age group.
Code:
dt = Open("data_table.jmp");
obj1 = dt << Fit Model(
Y( :height ),
By( :age ),
Effects( :weight ),
Personality( "Generalized Linear Model" ),
GLM Distribution( "Normal" ),
Link Function( "Identity" ),
Overdispersion Tests and Intervals( 0 ),
Name( "Firth Bias-Adjusted Estimates" )(0),
Run
);
obj1 << Mean Confidence Interval( 1 );
lcl1 = (dt:Lower 95% Mean height By age << get values)[Loc( dt:age << get values, 12 )];
ucl1 = (dt:Upper 95% Mean height By age << get values)[Loc( dt:age << get values, 12 )];
dt << Select Where( :age == 12 );
dt2 = dt << Subset( Selected Rows( 1 ) );
obj2 = dt2 << Fit Model(
Y( :height ),
Effects( :weight ),
Personality( "Generalized Linear Model" ),
GLM Distribution( "Normal" ),
Link Function( "Identity" ),
Overdispersion Tests and Intervals( 0 ),
Name( "Firth Bias-Adjusted Estimates" )(0),
Run
);
obj2 << Mean Confidence Interval( 1 );
lcl2 = dt2:Lower 95% Mean height << get values;
ucl2 = dt2:Upper 95% Mean height << get values;
Code Explanation:
- Open data table;
- Fit Generalized Linear Model for height.
- Group by age.
- Include weight as effect.
- Use Normal distribution.
- Use Identity link function.
- Disable overdispersion tests.
- Disable Firth bias adjustment.
- Calculate mean confidence interval.
- Extract 95% CI for age 12.
- Select rows where age is 12.
- Create subset for age 12.
- Fit Generalized Linear Model for subset.
- Include weight as effect.
- Use Normal distribution.
- Use Identity link function.
- Disable overdispersion tests.
- Disable Firth bias adjustment.
- Calculate mean confidence interval.
- Extract lower 95% CI for subset.
- Extract upper 95% CI for subset.
Example 323
Summary: Fits a generalized linear model to a data table, specifying effects and personality, and generates a report with profiler results.
Code:
dt = Open("data_table.jmp");
spec term = [1, 1];
obj = Fit Model(
Y( :Number Popped, :Total Kernels ),
Effects( :Brand, :Time, :Power, :Brand * :Time, :Brand * :Power, :Time * :Power, :Time * :Time, :Power * :Power ),
Personality( "Generalized Linear Model" ),
GLM Distribution( "Binomial" ),
Link Function( "Logit" ),
Overdispersion Tests and Intervals( 0 ),
Name( "Firth Bias-adjusted Estimates" )(0),
Run Model( Profiler( 1, Term Value( Brand( "Wilbur" ), Time( spec term[1] ), Power( spec term[2] ) ) ) )
);
rpt = obj << report;
act time = rpt[Outline Box( "Prediction Profiler" )][Number Edit Box( 1 )] << get;
act power = rpt[Outline Box( "Prediction Profiler" )][Number Edit Box( 2 )] << get;
obj << Save Script to Data Table;
fitmodel script = dt << Get Property( "Generalized Linear Model" );
saved script = Char( Name Expr( fitmodel script ) );
Code Explanation:
- Open data table.
- Define specification terms.
- Fit generalized linear model.
- Set response variables.
- Specify effects for model.
- Choose model personality.
- Select distribution type.
- Choose link function.
- Disable overdispersion tests.
- Disable Firth bias adjustment.
- Run model with profiler.
- Retrieve report object.
- Extract active time value.
- Extract active power value.
- Save script to data table.
- Get saved script property.
- Convert script to character.
Example 324
Summary: Fits a generalized linear model to predict the number of popped kernels based on brand, time, power, and their interactions.
Code:
dt = Open("data_table.jmp");
obj = Fit Model(
Y( :Number Popped, :Total Kernels ),
Effects( :Brand, :Time, :Power, :Brand * :Time, :Brand * :Power, :Time * :Power, :Time * :Time, :Power * :Power ),
Personality( "Generalized Linear Model" ),
GLM Distribution( "Binomial" ),
Link Function( "Logit" ),
Overdispersion Tests and Intervals( 0 ),
Name( "Firth Bias-adjusted Estimates" )(0),
Run Model( Profiler( 1, Desirability Functions( 1 ), Maximize Desirability( 1 ) ) )
);
rpt = obj << report;
act time = rpt[Outline Box( "Prediction Profiler" )][Number Edit Box( 1 )] << get;
act power = rpt[Outline Box( "Prediction Profiler" )][Number Edit Box( 2 )] << get;
act des = rpt[Outline Box( "Prediction Profiler" )][Text Edit Box( 2 )] << get text;
Code Explanation:
- Open data table.
- Define response variables.
- Specify model effects.
- Set model personality to GLM.
- Choose binomial distribution.
- Select logit link function.
- Disable overdispersion tests.
- Disable Firth bias adjustment.
- Run model with profiler.
- Extract prediction profiler values.
Example 325
Summary: Analyze height vs weight data by sex, generating a summary report and extracting key statistics.
Code:
dt = Open("data_table.jmp");
obj1 = dt << (Fit Model( Y( :height ), Effects( weight ), by( :sex ), Personality( Standard Least Squares ), Run(), Where( :sex == "M" ) ));
rpt1 = Report( obj1 );
test1 = (rpt1[Outline Box( "Summary of Fit" )][Table Box( 1 )] << get as matrix)[5];
obj2 = dt << Distribution( Y( :height ), by( :sex ), Where( :sex == "M" ) );
rpt2 = Report( obj2 );
test2 = (rpt2[Outline Box( "Quantiles" )][Table Box( 1 )] << get as matrix)[1];
Close( dt, no save );
b testx = {x( -0.02, 0.98 ), x( -0.02, 0.98 ), x( 0.02, 1.02 ), x( 0.02, 1.02 ), x( -0.02, 0.98 ), x( 0.02, 1.02 )};
b testy = {y( 8.95, 15.5 ), y( 8.95, 15.5 ), y( 9.05, 9.5 ), y( 9.05, 9.5 ), y( 10.6288880396311, 17.1788880396311 ),
y( 7.27111196036886, 13.8211119603689 ), y( 10.7288880396311, 11.1788880396311 ), y( 7.37111196036886, 7.82111196036886 )};
Code Explanation:
- Open data table;
- Fit linear model for height vs weight, by sex.
- Filter model for males.
- Extract summary of fit report.
- Extract R-squared value from report.
- Create distribution analysis for height, by sex.
- Filter distribution for males.
- Extract quantiles report.
- Extract minimum height value from report.
- Close dataset without saving.
Example 326
Summary: Analyze and visualize a dataset by fitting multiple models, generating reports, and extracting specific values.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( Log( :weight ) ),
Effects( :age, :sex, :height ),
Personality( Standard Least Squares ),
Emphasis( Minimal Report ),
Run(
:weight << {Inverse Prediction(
Confidence Level( 0.95 ),
Response( 10, 50, 100, 150 ),
Term Value( age( "14" ), sex( "M" ), height( . ) )
)}
)
);
b y function = {Y Function( Exp( 1.64795562681825 + 0.0457945886355865 * X ), X )};
rpt = Report( obj );
Close( dt, no save );
dt = Open("data_table.jmp");
obj1 = dt << (Fit Model( Y( :height ), Effects( weight ), by( :sex ), Personality( Standard Least Squares ), Run(), Where( :sex == "M" ) ));
rpt1 = Report( obj1 );
test1 = (rpt1[Outline Box( "Summary of Fit" )][Table Box( 1 )] << get as matrix)[5];
obj2 = dt << Distribution( Y( :height ), by( :sex ), Where( :sex == "M" ) );
rpt2 = Report( obj2 );
test2 = (rpt2[Outline Box( "Quantiles" )][Table Box( 1 )] << get as matrix)[1];
Code Explanation:
- Open data table;
- Fit model with log(weight).
- Use age, sex, height as effects.
- Set personality to Standard Least Squares.
- Generate minimal report.
- Perform inverse prediction on weight.
- Define custom Y function.
- Extract report from first model.
- Close dataset without saving.
- Reopen data_table dataset
- Fit model with height by sex.
- Filter data for male sex.
- Extract summary of fit from second model.
- Create distribution report by sex.
- Extract quantiles from third report.
Example 327
Summary: Fits a parametric survival model to a data table, generating estimates and standard errors for the model's parameters.
Code:
dt = Open("data_table.jmp");
SASbeta = [-13.46864893662, 0.6278529427756, 0.9778232716528];
SASstderr = [2.8871951292977, 0.0828387930659, 0.1326468295615];
SASllike = 75.44911;
SASllike = 321.70277802;
obj = dt << Fit Model(
Freq( :Weight ),
Y( :Hours ),
Effects( :x ),
Personality( Parametric Survival ),
Distribution( LogNormal ),
Censor( :Censor ),
Run Model( Likelihood Ratio Tests( 1 ), {Estimate Survival Probability( x = 40.9853, [30000, 10000], Alpha( 0.05 ) )} )
);
rpt = obj << report;
beta = rpt[Outline Box( "Parameter Estimates" )][Number Col Box( "Estimate" )] << get as matrix;
stderr = rpt[Outline Box( "Parameter Estimates" )][Number Col Box( "Std Error" )] << get as matrix;
llike = (rpt[Outline Box( "Parametric Survival Fit" )][Table Box( 2 )] << get as matrix)[3];
Code Explanation:
- Open data table.
- Define SAS beta values.
- Define SAS standard errors.
- Define SAS log-likelihood.
- Fit parametric survival model.
- Set frequency variable.
- Set response variable.
- Add effect variable.
- Specify personality and distribution.
- Set censor variable.
Example 328
Summary: Fits and analyzes parametric survival models, extracting whole model test p-values and likelihood ratio tests, while also creating a new data table for further modeling.
Code:
dt = Open("data_table.jmp");
plat = dt << Fit Model(
Y( :Time ),
Effects( :Age, :Diag Time ),
Personality( "Parametric Survival" ),
Distribution( "Exponential" ),
Censor( :censor ),
Run Model( 1 )
);
rep = Report( plat );
pvalWholeModel = (rep[Outline Box( "Whole Model Test" )][Number Col Box( "Prob>Chisq" )] << get)[1];
pexpect1 = Exp( ChiSquare Log CDistribution( 3.14093946323624, 2 ) );
pvalLR = (rep["Effect Likelihood Ratio Tests"][Table Box( 1 )] << GetAsMatrix)[0, 4];
pexpect2 = Exp( ChiSquare Log CDistribution( 2.03671155620111, 1 ) );
pexpect3 = Exp( ChiSquare Log CDistribution( 1.22639998519867, 1 ) );
Close( dt, NoSave );
exp str = {"Observation Used", "Right Censored Values", "Left Censored Values", "Interval Censored Values"};
dt = New Table( "CarolDixon_7610546310_2",
Add Rows( 13 ),
New Column( "Start", Numeric, Continuous, Set Values( [0.0001, 0.0001, ., 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] ) ),
New Column( "end", Numeric, Continuous, Set Values( [., 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] ) ),
New Column( "MIS2009", Numeric, Continuous, Set Values( [7423, 32, 34, 41, 15, 23, 37, 26, 41, 39, 49, 74, 58] ) )
);
fm = dt << Fit Model(
Freq( :MIS2009 ),
Y( :Start, :end ),
Effects,
Personality( "Parametric Survival" ),
Distribution( "Weibull" ),
Run( Likelihood Ratio Tests( 1 ) )
);
rp = Report( fm );
valsFM = (rp[Outline Box( "Parametric Survival Fit" )][Number Col Box( 2 )] << get as matrix);
act str = rp[String Col Box( 2 )] << get;
Code Explanation:
- Open data table.
- Fit parametric survival model.
- Extract whole model test p-value.
- Calculate expected p-value for Chi-square.
- Extract likelihood ratio test p-value.
- Calculate additional expected p-values.
- Close original data table.
- Create new data table.
- Fit parametric survival model on new data.
- Extract parametric survival fit values.
Example 329
Summary: Fits a parametric survival model to estimate survival probability and time quantile, utilizing Weibull distribution and censoring variable.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Time ),
Effects,
Personality( "Parametric Survival" ),
Distribution( "Weibull" ),
Censor( :Censor ),
Run(
Likelihood Ratio Tests( 1 ),
{Estimate Survival Probability( [500], Alpha( 0.05 ) ), Estimate Survival Probability( [500], Alpha( 0.10 ) ),
Estimate Time Quantile( [0.3], Alpha( 0.05 ) ), Estimate Time Quantile( [0.3], Alpha( 0.10 ) )}
)
);
rpt = obj << report;
b prob = {[500 0.0149697253109157 0.00364780085731786 0.0603528703980317 0.985030274689084], [500 0.0149697253109157 0.00457941546563845
0.0483554390523536 0.985030274689084]};
b quantile1 = {[0.3 31337.8206062375 11701.8882005179 83923.1227918637], [0.3 31337.8206062375 13709.9835049587 71630.9395991269]};
Code Explanation:
- Open data table.
- Fit parametric survival model.
- Set response variable.
- Define effects.
- Choose Weibull distribution.
- Specify censoring variable.
- Run likelihood ratio tests.
- Estimate survival probability at 500.
- Estimate time quantile at 0.3.
- Extract results into variables.
Example 330
Summary: Fits a parametric survival model to analyze the relationship between Age and Diag Time, while controlling for censoring.
Code:
dt = Open("data_table.jmp");
plat = dt << Fit Model(
Y( :Time ),
Effects( :Age, :Diag Time ),
Personality( "Parametric Survival" ),
Distribution( "Exponential" ),
Censor( :censor ),
Run Model( 1 )
);
rep = Report( plat );
pvalWholeModel = (rep[Outline Box( "Whole Model Test" )][Number Col Box( "Prob>Chisq" )] << get)[1];
pexpect1 = Exp( ChiSquare Log CDistribution( 3.14093946323624, 2 ) );
pvalLR = (rep["Effect Likelihood Ratio Tests"][Table Box( 1 )] << GetAsMatrix)[0, 4];
pexpect2 = Exp( ChiSquare Log CDistribution( 2.03671155620111, 1 ) );
pexpect3 = Exp( ChiSquare Log CDistribution( 1.22639998519867, 1 ) );
Code Explanation:
- Open data table;
- Fit parametric survival model.
- Set response variable.
- Include effects variables.
- Choose personality type.
- Specify distribution.
- Define censor variable.
- Run the model.
- Extract report object.
- Retrieve p-value for whole model.
Example 331
Summary: Fits and creates reports for a survival model with censoring, utilizing Fit Model and Report functions in JMP.
Code:
dt = Open("data_table.jmp");
fm = dt << Fit Model(
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Censor( :censor ),
Personality( "Parametric Survival" ),
Distribution( "Weibull" )
);
wn = Report( fm );
lst = {};
For( i = 1, i <= wn[Popup Box( 2 )] << get menu count, i++,
lst[i] = wn[Popup Box( 2 )] << get menu text( i )
);
fps = fm << Run;
rp = Report( fps );
v = rp[Number Col Box( 4 )] << get as matrix;
script = fps << get script;
check = Contains( Char( Name Expr( script ) ), "Censor Code" ) > 0;
rp << close window;
fm2 = dt << Fit Model(
Censor( :censor ),
Censor Code( "Exact" ),
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Personality( "Parametric Survival" ),
Distribution( "Weibull" ),
Run( Likelihood Ratio Tests( 1 ) )
);
v = Report( fm2 )[Number Col Box( 4 )] << get as matrix;
Code Explanation:
- Open table.
- Fit survival model.
- Get report.
- Initialize list.
- Loop through menu items.
- Add menu texts to list.
- Run model.
- Get report.
- Extract matrix.
- Check script for "Censor Code".
- Close window.
- Refit model with censor code.
- Get updated report.
- Extract new matrix.
Example 332
Summary: Fits a parametric survival model to data, generating a distribution plot and capturing log output.
Code:
dt = Open("data_table.jmp");
fm = dt << Fit Model( Personality( "Parametric Survival" ), Y( :Time ), Censor( :censor ), Distribution( "Weibull" ), Run );
lc = Log Capture( fm << Distribution Plot by Level Combinations( 1 ) );
Code Explanation:
- Open data table.
- Fit parametric survival model.
- Set response variable.
- Specify censor variable.
- Choose Weibull distribution.
- Run the model.
- Capture log output.
- Generate distribution plot.
Example 333
Summary: Performs a parametric survival analysis with lognormal distribution and likelihood ratio tests, generating a residual probability plot for visual inspection.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :Censor ),
Censor Code( "1" ),
Freq( :Weight ),
Y( :Hours ),
Effects( :x ),
Personality( Parametric Survival ),
Distribution( LogNormal ),
Run( Likelihood Ratio Tests( 1 ), Residual Plot( 1 ), )
);
rpt = obj << report;
yLbl = rpt[Outline Box( "Residual Probability Plot" )][Text Box( 1 )] << get text;
xLbl = rpt[Outline Box( "Residual Probability Plot" )][Text Box( 2 )] << get text;
Code Explanation:
- Open data table.
- Launch Fit Model platform.
- Specify censor variable.
- Set censor code.
- Include frequency variable.
- Define response variable.
- Add effect variable.
- Choose parametric survival personality.
- Select lognormal distribution.
- Run likelihood ratio tests and residual plot.
Example 334
Summary: Performs a parametric survival analysis to identify failure causes and estimate Weibull distribution, utilizing Fit Model platform with specified censor variable, response variable, effect variable, and Likelihood Ratio Tests.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :Censor ),
Censor Code( "1" ),
Y( :Time Cycles ),
Effects( :Group ),
Personality( "Parametric Survival" ),
Distribution( "Weibull" ),
Cause( :Causes ),
Run(
Set Scriptables( "bearing seal", {Likelihood Ratio Tests( 1 )} ),
Set Scriptables( "belt", {Likelihood Ratio Tests( 1 )} ),
Set Scriptables( "circuitry", {Likelihood Ratio Tests( 1 )} ),
Set Scriptables( "container throw", {Likelihood Ratio Tests( 1 )} ),
Set Scriptables( "cord short", {Likelihood Ratio Tests( 1 )} ),
Set Scriptables( "engine fan", {Likelihood Ratio Tests( 1 )} ),
Set Scriptables( "none", {Likelihood Ratio Tests( 1 )} ),
Set Scriptables( "power switch", {Likelihood Ratio Tests( 1 )} ),
Set Scriptables( "stripped gear", {Likelihood Ratio Tests( 1 )} ),
Set Scriptables( "switch, other", {Likelihood Ratio Tests( 1 )} )
)
);
rpt = Current Report();
rptAll = obj << report;
jrn = rpt << get journal;
parCompCause = rpt[Outline Box( 1 )] << get title;
summByCause = rpt[Outline Box( 2 )] << get title;
causeLst = rpt[Outline Box( summByCause )][String Col Box( "Causes" )] << get;
For( i = 1, i <= N Items( causeLst ), i++,
title = rptAll[i] << get title
);
parCompCauseScptObj = rpt[Outline Box( parCompCause )] << get scriptable object;
obj1 = parCompCauseScptObj << Redo Analysis;
rpt1 = Current Report();
jrn1 = rpt1 << get journal;
Code Explanation:
- Open data table;
- Initiate Fit Model platform.
- Specify censor variable.
- Define censor code.
- Set response variable.
- Include effect variable.
- Choose Parametric Survival personality.
- Select Weibull distribution.
- Identify failure causes.
- Configure Likelihood Ratio Tests for each cause.
Example 335
Summary: Fits a parametric survival model to a data table, specifying censoring and response variables, and retrieving titles and distribution lists.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :Censor ),
Censor Code( "1" ),
Y( :Time Cycles ),
Effects( :Group ),
Personality( "Parametric Survival" ),
Distribution( "All Distributions" ),
Run()
);
rpt = Current Report();
rptAll = obj << report;
parSurvAllDist = rpt[Outline Box( 1 )] << get title;
modelComp = rpt[Outline Box( 2 )] << get title;
distLst = rpt[Outline Box( modelComp )][String Col Box( "Distribution" )] << get;
For( i = 1, i <= N Items( distLst ), i++,
title = rptAll[i] << get title
);
Code Explanation:
- Open data table.
- Fit parametric survival model.
- Set censor variable.
- Define censor code.
- Specify response variable.
- Include group effect.
- Choose parametric survival personality.
- Select all distributions.
- Run the model.
- Retrieve and print titles and distribution list.
Example 336
Summary: Fits and creates reports for a parametric survival model, extracting summary statistics by cause and distribution.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :Censor ),
Censor Code( "1" ),
Y( :Time Cycles ),
Effects( :Group ),
Personality( "Parametric Survival" ),
Distribution( "All Distributions" ),
Cause( :Causes ),
Run()
);
rpt = Current Report();
rptAll = obj << report;
parSurvAllDist = rpt[Outline Box( 1 )] << get title;
summByCause = rpt[Outline Box( 2 )] << get title;
causeLst = rpt[Outline Box( summByCause )][String Col Box( "Causes" )] << get;
summByCauseDistLst = rpt[Outline Box( summByCause )][String Col Box( "Distribution" )] << get;
modelComp = rpt[Outline Box( 3 )] << get title;
modelCompDistLst = rpt[Outline Box( modelComp )][String Col Box( "Distribution" )] << get;
tmp = {};
For( i = 1, i <= N Items( modelCompDistLst ), i++,
tmp = tmp || Repeat( {modelCompDistLst[i]}, N Items( causeLst ) / N Items( modelCompDistLst ) )
);
For( i = 1, i <= N Items( modelCompDistLst ), i++,
For( j = 1, j <= N Items( causeLst[1 :: 10] ), j++,
title = rpt[Outline Box( modelCompDistLst[i] )][ContainerBox( j )][Outline Box( 1 )] << get title
)
);
Code Explanation:
- Open data table.
- Fit parametric survival model.
- Set censor variable.
- Define censor code.
- Specify response variable.
- Include group effect.
- Choose all distributions.
- Assign cause variable.
- Run the model.
- Extract and process report data.
Example 337
Summary: Fits a parametric survival model with Weibull distribution and likelihood ratio tests, generating reports and residual plots for analysis.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :Censor ),
Censor Code( "1" ),
Y( :Time Cycles ),
Effects( :Group ),
Personality( "Parametric Survival" ),
Distribution( "Weibull" ),
Cause( :Causes ),
Run(
Set Scriptables( "bearing seal", {Likelihood Ratio Tests( 1 )} ),
Set Scriptables( "belt", {Likelihood Ratio Tests( 1 )} ),
Set Scriptables( "circuitry", {Likelihood Ratio Tests( 1 )} ),
Set Scriptables( "container throw", {Likelihood Ratio Tests( 1 )} ),
Set Scriptables( "cord short", {Likelihood Ratio Tests( 1 )} ),
Set Scriptables( "engine fan", {Likelihood Ratio Tests( 1 )} ),
Set Scriptables( "none", {Likelihood Ratio Tests( 1 )} ),
Set Scriptables( "power switch", {Likelihood Ratio Tests( 1 )} ),
Set Scriptables( "stripped gear", {Likelihood Ratio Tests( 1 )} ),
Set Scriptables( "switch, other", {Likelihood Ratio Tests( 1 )} )
)
);
rpt = obj << report;
For( i = 1, i <= N Items( rpt ), i++,
topScptObj = rpt[i][Outline Box( 1 )] << get scriptable object;
topScptObj << Residual Plot( 1 );
obj[i] << Save Residuals;
jrn = rpt[i][Outline Box( "Residual Probability Plot" )][Frame Box( 1 )] << get journal;
dt << Delete Column( :Residual );
);
Code Explanation:
- Open data table;
- Fit parametric survival model.
- Use Weibull distribution.
- Include Group effect.
- Set censoring conditions.
- Configure likelihood ratio tests.
- Generate report.
- Loop through report items.
- Create residual plots.
- Save residuals and clean up.
Example 338
Summary: Fits parametric survival models to data, generating residual plots and extracting distribution overlay information.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :censor ),
Censor Code( "1" ),
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Personality( "Parametric Survival" ),
Distribution( "Weibull" ),
Run( Likelihood Ratio Tests( 1 ), Residual Plot( 1 ) )
);
obj << Save Residuals;
rpt = obj << report;
jrn = rpt[Outline Box( "Residual Probability Plot" )][Frame Box( 1 )] << get journal;
Close( dt, No Save );
dt = New Table( "Test",
New Column( "X1", Values( 1 :: 9 ) ),
New Column( "X2", Values( Repeat( 1, 9 ) ) ),
New Column( "X3", Values( 1 :: 9 ) ),
New Column( "Y", Nominal, Values( [4, 1, 2, 3, 1, 5, 4, 2, 8] ) )
);
obj = dt << Fit Model(
Y( :Y ),
Effects( :X1, :X2, :X3 ),
Personality( "Parametric Survival" ),
Distribution( "All Distributions" ),
Run(
Distribution Overlay( Show Shading( 0 ) ),
Quantile Function Overlay( Show Shading( 0 ) ),
Set Scriptables( "Weibull", {Quantile Profiler( 1 ), Distribution Profiler( 1 )} ),
Set Scriptables( "Lognormal", {Quantile Profiler( 1 ), Distribution Profiler( 1 )} ),
Set Scriptables( "Exponential", {Quantile Profiler( 1 ), Distribution Profiler( 1 )} ),
Set Scriptables( "Frechet", {Quantile Profiler( 1 ), Distribution Profiler( 1 )} ),
Set Scriptables( "Loglogistic", {Quantile Profiler( 1 ), Distribution Profiler( 1 )} )
)
);
rpt = Current Report();
distOverlayX = rpt[Outline Box( "Distribution Overlay" )][Text Edit Box( 2 )] << get text;
quantOverlayY = rpt[Outline Box( "Distribution Overlay" )][Text Edit Box( 2 )] << get text;
Code Explanation:
- Open table "VA Lung Cancer".
- Fit parametric survival model.
- Use Weibull distribution.
- Perform likelihood ratio tests.
- Generate residual plot.
- Save residuals.
- Extract residual probability plot.
- Close table without saving.
- Create new table "Test".
- Fit parametric survival model on new data.
Example 339
Summary: Fits a parametric survival model to a data table, utilizing Time Cycles as response and Group as effect, with all distributions enabled and local data filtering.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :Censor ),
Censor Code( "1" ),
Y( :Time Cycles ),
Effects( :Group ),
Personality( "Parametric Survival" ),
Distribution( "All Distributions" ),
Cause( :Causes ),
Run( Local Data Filter )
);
rpt = Current Report();
scptObj = rpt[Outline Box( 1 )] << get scriptable object;
scptObj << Remove Local Data Filter;
Close( dt, No Save );
Preferences( Fit Parametric Survival( Wald Tests( 1 ) ) );
Random Reset( 12345 );
Code Explanation:
- Open data table;
- Fit parametric survival model.
- Set censor code to "1".
- Use Time Cycles as response.
- Include Group as effect.
- Use all distributions.
- Specify Causes for analysis.
- Enable local data filter.
- Remove local data filter from report.
- Close dataset without saving.
- Enable Wald tests for parametric survival.
- Reset random seed to 12345.
Example 340
Summary: Fits a parametric survival model to analyze time-to-event data, incorporating censoring and residual plots.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :censor ),
Censor Code( "1" ),
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Personality( "Parametric Survival" ),
Distribution( "Weibull" ),
Run( Likelihood Ratio Tests( 1 ), Residual Plot( 1 ) )
);
obj << Save Residuals;
rpt = obj << report;
jrn = rpt[Outline Box( "Residual Probability Plot" )][Frame Box( 1 )] << get journal;
Code Explanation:
- Open table.
- Fit parametric survival model.
- Specify censor variable.
- Set censor code.
- Define response variable.
- Add effects to model.
- Choose Weibull distribution.
- Run likelihood ratio tests.
- Generate residual plot.
- Save residuals.
Example 341
Summary: Fits a parametric survival model to a data table, specifying censor variable, response variable, group effect, and cause variable.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :Censor ),
Censor Code( "1" ),
Y( :Time Cycles ),
Effects( :Group ),
Personality( "Parametric Survival" ),
Distribution( "All Distributions" ),
Cause( :Causes ),
Run( Local Data Filter )
);
rpt = Current Report();
scptObj = rpt[Outline Box( 1 )] << get scriptable object;
scptObj << Remove Local Data Filter;
Code Explanation:
- Open data table.
- Fit parametric survival model.
- Specify censor variable.
- Set censor code.
- Define response variable.
- Include group effect.
- Choose personality type.
- Select all distributions.
- Identify cause variable.
- Remove local data filter.
Example 342
Summary: Fits a parametric survival model to analyze censored data, extracting estimates and generating a survival plot.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :Censor ),
Censor Code( "1" ),
Y( :Hours ),
Effects( :Temp ),
Personality( "Parametric Survival" ),
Distribution( "LEV" ),
Run
);
rpt = obj << report;
est = rpt[Number Col Box( "Estimate" )] << get as matrix;
jrn = rpt[Outline Box( "Plot Survival Quantiles" )][Frame Box( 1 )] << get journal;
Code Explanation:
- Open data table.
- Fit parametric survival model.
- Specify censor variable.
- Set censor code.
- Define response variable.
- Add effect variable.
- Choose personality type.
- Select distribution.
- Run the model.
- Extract estimates matrix.
- Retrieve survival plot.
Example 343
Summary: Fits a parametric survival model to a data table, extracting text and numeric summary data from the report.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Current ),
Effects( :Hours ),
Personality( "Parametric Survival" ),
Distribution( "Normal" ),
Run( Likelihood Ratio Tests( 1 ) )
);
rpt = obj << report;
txt3 = rpt[Outline Box( "Parametric Survival Fit" )][Text Box( 4 )] << get text;
summ = Matrix( rpt[Outline Box( "Parametric Survival Fit" )][Number Col Box( 4 )] << get );
Code Explanation:
- Open data table.
- Fit parametric survival model.
- Set response variable.
- Add effect variable.
- Choose personality type.
- Select distribution.
- Run likelihood ratio tests.
- Retrieve model report.
- Extract text from outline box.
- Get numeric summary data.
Example 344
Summary: Fits a parametric survival model with lognormal distribution to a data table, utilizing frequency and censoring columns.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Freq( :Weight ),
Y( :Hours ),
Effects( :x ),
Personality( "Parametric Survival" ),
Distribution( "Lognormal" ),
Censor( :Censor ),
Run( Likelihood Ratio Tests( 1 ) )
);
Code Explanation:
- Open data table.
- Fit model with specified parameters.
- Set frequency column.
- Define response variable.
- Add effect variable.
- Choose parametric survival personality.
- Select lognormal distribution.
- Specify censoring column.
- Run likelihood ratio tests.
- Execute model fitting.
Example 345
Summary: Fits and creates reports for two parametric survival models with different alpha levels, generating distribution plots and journals.
Code:
dt = Open("data_table.jmp");
obj1 = dt << Fit Model(
Y( :weight ),
Effects( :sex ),
Personality( "Parametric Survival" ),
Set Alpha Level( 0.0001 ),
Distribution( "Normal" ),
Run( Likelihood Ratio Tests( 1 ), Distribution Plot by Level Combinations( 1 ) )
);
rpt1 = obj1 << report;
scptObj1 = rpt1[Outline Box( "Distribution Plot by Level Combinations" )] << get scriptable object;
scptObj1 << Show Shade( 1 );
jrn1 = rpt1[Frame Box( 1 )] << get journal;
obj2 = dt << Fit Model(
Y( :weight ),
Effects( :sex ),
Personality( "Parametric Survival" ),
Set Alpha Level( 0.8 ),
Distribution( "Normal" ),
Run( Likelihood Ratio Tests( 1 ), Distribution Plot by Level Combinations( 1 ) )
);
rpt2 = obj2 << report;
scptObj2 = rpt2[Outline Box( "Distribution Plot by Level Combinations" )] << get scriptable object;
scptObj2 << Show Shade( 1 );
jrn2 = rpt2[Frame Box( 1 )] << get journal;
Code Explanation:
- Open data table;
- Fit parametric survival model.
- Set alpha level to 0.0001.
- Use normal distribution.
- Run likelihood ratio tests.
- Generate distribution plot.
- Retrieve report object.
- Get scriptable object for plot.
- Show shaded plot.
- Save plot as journal.
Example 346
Summary: Fits and creates reports for a parametric survival model to analyze data, including extracting matrices from the report and inverting row selection.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Current ),
Effects( :Hours ),
Scale Effects( :Hours ),
Personality( "Parametric Survival" ),
Distribution( "Normal" ),
Run( Likelihood Ratio Tests( 1 ), Wald Tests( 1 ) )
);
dt << Clear Row States;
dt << Select where( :Current == 0 );
dt << Hide and Exclude;
obj1 = dt << Fit Model(
Y( :Current ),
Effects( :Hours ),
Scale Effects( :Hours ),
Personality( "Parametric Survival" ),
Distribution( "Normal" ),
Run( Likelihood Ratio Tests( 1 ), Wald Tests( 1 ) )
);
rpt1 = obj1 << report;
mod1 = rpt1[Outline Box( "Parametric Survival Fit" )][Table Box( 1 )] << get as matrix;
ob1 = rpt1[Outline Box( "Parametric Survival Fit" )][Table Box( 2 )] << get as matrix;
test1 = rpt1[Outline Box( "Whole Model Test" )][Table Box( 1 )] << get as matrix;
est1 = rpt1[Outline Box( "Parameter Estimates" )][Table Box( 1 )] << get as matrix;
wald1 = rpt1[Outline Box( "Wald Tests" )][Table Box( 1 )] << get as matrix;
eff1 = rpt1[Outline Box( "Effect Likelihood Ratio Tests" )][Table Box( 1 )] << get as matrix;
dt << Invert row selection;
dt2 = dt << subset( selected rows );
obj2 = dt2 << Fit Model(
Y( :Current ),
Effects( :Hours ),
Scale Effects( :Hours ),
Personality( "Parametric Survival" ),
Distribution( "Normal" ),
Run( Likelihood Ratio Tests( 1 ), Wald Tests( 1 ) )
);
rpt2 = obj2 << report;
mod2 = rpt2[Outline Box( "Parametric Survival Fit" )][Table Box( 1 )] << get as matrix;
ob2 = rpt2[Outline Box( "Parametric Survival Fit" )][Table Box( 2 )] << get as matrix;
test2 = rpt2[Outline Box( "Whole Model Test" )][Table Box( 1 )] << get as matrix;
est2 = rpt2[Outline Box( "Parameter Estimates" )][Table Box( 1 )] << get as matrix;
wald2 = rpt2[Outline Box( "Wald Tests" )][Table Box( 1 )] << get as matrix;
eff2 = rpt2[Outline Box( "Effect Likelihood Ratio Tests" )][Table Box( 1 )] << get as matrix;
Code Explanation:
- Open data table;
- Fit parametric survival model.
- Clear row states.
- Select zero current rows.
- Hide and exclude selected rows.
- Fit parametric survival model again.
- Extract report from first model.
- Extract matrices from first model report.
- Invert row selection.
- Subset data for non-zero current rows.
Example 347
Summary: Performs a parametric survival model fit with distribution overlay and likelihood ratio tests for Weibull, Lognormal, Exponential, Frechet, and Loglogistic distributions.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :censor ),
Censor Code( "Censored" ),
Y( :Time ),
Effects( :Age, :Diag Time ),
Personality( "Parametric Survival" ),
Distribution( "All Distributions" ),
Run(
Distribution Overlay( Show Display( 1 ) ),
Set Scriptables( "Weibull", {Likelihood Ratio Tests( 1 )} ),
Set Scriptables( "Lognormal", {Likelihood Ratio Tests( 1 )} ),
Set Scriptables( "Exponential", {Likelihood Ratio Tests( 1 )} ),
Set Scriptables( "Frechet", {Likelihood Ratio Tests( 1 )} ),
Set Scriptables( "Loglogistic", {Likelihood Ratio Tests( 1 )} )
)
);
rpt = obj << report;
lp = Words(
Log Capture( rpt[1][Outline Box( "Parametric Survival Fit - Weibull" )][Outline Box( "Effect Summary" )][Button Box( 2 )] << Click ),
"\!N"
);
Code Explanation:
- Open table.
- Fit parametric survival model.
- Specify censor column.
- Define censor code.
- Set response variable.
- Add effects: Age, Diag Time.
- Choose personality: Parametric Survival.
- Select all distributions.
- Run model with distribution overlay.
- Enable likelihood ratio tests for each distribution.
Example 348
Summary: Runs the estimation and calculation of survival probability and time quantile using a parametric survival model in JMP, incorporating Weibull distribution and censoring variable.
Code:
dt = Open("data_table.jmp");
plat = dt << Fit Model(
Y( :Time ),
Effects,
Personality( Parametric Survival ),
Distribution( Weibull ),
Censor( :Censor ),
Run(
Likelihood Ratio Tests( 1 ),
Covariance of Estimates( 1 ),
{Estimate Survival Probability( [500], Alpha( 0.01 ) ), Estimate Time Quantile( [0.1], Alpha( 0.01 ) )}
)
);
r = Report( plat );
est = r[Number Col Box( "Estimate" )] << GetAsMatrix;
m = est[1];
s = est[2];
cov = r["Covariance of Estimates"][Matrix Box( 1 )] << Get;
t = 500;
z = (Log( t ) - m) / s;
der = (-1 / s) |/ (-(Log( t ) - m) / s ^ 2);
se = Sqrt( der` * Cov * der );
zz = Normal Quantile( 1 - 0.01 / 2 );
lowz = z - zz * se;
upz = z + zz * se;
F = 1 - Exp( -Exp( z ) );
Surv = 1 - F;
Flow = 1 - Exp( -Exp( lowz ) );
Fup = 1 - Exp( -Exp( upz ) );
expected1 = t || F || Flow || Fup || Surv;
actual1 = r["Estimates of Survival"][Table Box( 1 )] << GetAsMatrix;
sprob = 0.1;
phiinv = Log( -Log( sprob ) );
der = [1] |/ phiinv;
se = Sqrt( der` * Cov * der );
zz = Normal Quantile( 1 - 0.01 / 2 );
log = m + phiinv * s;
lowlog = log - zz * se;
uplog = log + zz * se;
q = Exp( log );
lowq = Exp( lowlog );
upq = Exp( uplog );
expected2 = sprob || q || lowq || upq;
actual2 = r["Estimates of Time Quantile"][Table Box( 1 )] << GetAsMatrix;
Close( dt, No Save );
Expected = [10.264768536611 0.288675134246794 9.60299419500239 11.1130892953214];
Code Explanation:
- Open data table;
- Fit parametric survival model.
- Specify time as response.
- Use Weibull distribution.
- Set censoring variable.
- Run model with tests.
- Extract report from model.
- Retrieve estimate values.
- Calculate survival probability.
- Close data table without saving.
Example 349
Summary: Fits a parametric survival model to analyze time-to-event data, extracting parameter estimates and providing likelihood ratio tests and confidence intervals.
Code:
dt = Open("data_table.jmp");
plat = dt << Fit Model(
Y( :Time ),
Censor( :Censor ),
Effects,
Personality( "Parametric Survival" ),
Set Alpha Level( 0.01 ),
Distribution( "Exponential" ),
Run Model( Likelihood Ratio Tests( 1 ), Confidence Intervals( 1 ) )
);
r = Report( plat );
Actual = r[Outline Box( "Parameter Estimates" )][Table Box( 1 )] << GetAsMatrix;
Code Explanation:
- Open table.
- Fit parametric survival model.
- Set response variable.
- Set censor variable.
- Specify effects.
- Choose personality.
- Set alpha level.
- Select distribution.
- Run model with tests.
- Extract parameter estimates.
Example 350
Summary: Runs the estimation and confidence interval calculation for survival probability and time quantile using a parametric Weibull model with censoring, leveraging Fit Model and Report platforms in JMP.
Code:
dt = Open("data_table.jmp");
plat = dt << Fit Model(
Y( :Time ),
Effects,
Personality( Parametric Survival ),
Distribution( Weibull ),
Censor( :Censor ),
Run(
Likelihood Ratio Tests( 1 ),
Covariance of Estimates( 1 ),
{Estimate Survival Probability( [500], Alpha( 0.01 ) ), Estimate Time Quantile( [0.1], Alpha( 0.01 ) )}
)
);
r = Report( plat );
est = r[Number Col Box( "Estimate" )] << GetAsMatrix;
m = est[1];
s = est[2];
cov = r["Covariance of Estimates"][Matrix Box( 1 )] << Get;
t = 500;
z = (Log( t ) - m) / s;
der = (-1 / s) |/ (-(Log( t ) - m) / s ^ 2);
se = Sqrt( der` * Cov * der );
zz = Normal Quantile( 1 - 0.01 / 2 );
lowz = z - zz * se;
upz = z + zz * se;
F = 1 - Exp( -Exp( z ) );
Surv = 1 - F;
Flow = 1 - Exp( -Exp( lowz ) );
Fup = 1 - Exp( -Exp( upz ) );
expected1 = t || F || Flow || Fup || Surv;
actual1 = r["Estimates of Survival"][Table Box( 1 )] << GetAsMatrix;
sprob = 0.1;
phiinv = Log( -Log( sprob ) );
der = [1] |/ phiinv;
se = Sqrt( der` * Cov * der );
zz = Normal Quantile( 1 - 0.01 / 2 );
log = m + phiinv * s;
lowlog = log - zz * se;
uplog = log + zz * se;
q = Exp( log );
lowq = Exp( lowlog );
upq = Exp( uplog );
expected2 = sprob || q || lowq || upq;
actual2 = r["Estimates of Time Quantile"][Table Box( 1 )] << GetAsMatrix;
Code Explanation:
- Open data table.
- Fit parametric survival model.
- Set distribution to Weibull.
- Include censor variable.
- Run likelihood ratio tests.
- Enable covariance estimates.
- Estimate survival probability at 500.
- Estimate time quantile at 0.1.
- Extract parameter estimates.
- Calculate survival probability confidence interval.
Example 351
Summary: Fits a parametric survival model to analyze the relationship between 'Time' and specified effects, generating parameter estimates and confidence intervals.
Code:
dt = Open("data_table.jmp");
plat = dt << Fit Model(
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Personality( Parametric Survival ),
Distribution( Weibull ),
Censor( :censor ),
Run( Likelihood Ratio Tests( 1 ), Confidence Intervals( 1 ) )
);
r = Report( plat );
parm = r["Parameter Estimates"][Table Box( 1 )] << GetAsMatrix;
NCol = N Col( parm );
Code Explanation:
- Open data table;
- Fit parametric survival model.
- Set response variable to "Time".
- Include specified effects.
- Choose Weibull distribution.
- Define censor column.
- Run likelihood ratio tests.
- Generate confidence intervals.
- Retrieve report object.
- Extract parameter estimates matrix.
Example 352
Summary: Fits a parametric survival model to analyze the relationship between 'Time', 'Age', and 'Diag Time' in a data table, while accounting for censoring.
Code:
dt = Open("data_table.jmp");
plat = dt << Fit Model(
Y( :Time ),
Effects( :Age, :Diag Time ),
Personality( Parametric Survival ),
Distribution( Exponential ),
Censor( :censor ),
Run Model( 1 )
);
rep = Report( plat );
result1 = (rep["Whole Model Test"][Table Box( 1 )] << GetAsMatrix)[1, 2 :: 4];
result2 = rep["Effect Likelihood Ratio Tests"][Table Box( 1 )] << GetAsMatrix;
Code Explanation:
- Open data table;
- Fit parametric survival model.
- Set response variable to "Time".
- Include "Age" and "Diag Time" as effects.
- Use exponential distribution.
- Specify censoring column "censor".
- Run the model.
- Retrieve report object.
- Extract whole model test results.
- Extract effect likelihood ratio tests.
Example 353
Summary: Fits a parametric survival model to a data table, generating a residual probability plot and performing likelihood ratio tests.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :censor ),
Censor Code( "Censored" ),
Y( :Time ),
Effects( :Age, :Diag Time ),
Personality( "Parametric Survival" ),
Distribution( "Weibull" ),
Run( Likelihood Ratio Tests( 1 ), Residual Probability Plot( 1 ) )
);
rpt = obj << report;
jrn = rpt[Outline Box( "Residual Probability Plot" )][FrameBox( 1 )] << get journal;
Close( dt, No Save );
Preferences( Profiler( Prediction Profiler( 1 ), Confidence Intervals( 1 ) ) );
Code Explanation:
- Open data table;
- Fit parametric survival model.
- Set censor variable.
- Define censor code.
- Specify response variable.
- Include age and diag time effects.
- Choose Weibull distribution.
- Run likelihood ratio tests.
- Generate residual probability plot.
- Close table without saving.
Example 354
Summary: Creates and creates a report for a parametric survival model using Fit Model, specifying response variable, effect variables, personality, distribution, censor variable, and running the model to generate a report.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Time ),
Effects( :Age, :Diag Time ),
Personality( Parametric Survival ),
Distribution( Exponential ),
Censor( :censor ),
Run Model( 1 )
);
rpt = obj << report;
Code Explanation:
- Open data table.
- Create Fit Model object.
- Set response variable.
- Add effect variables.
- Choose parametric survival personality.
- Select exponential distribution.
- Specify censor variable.
- Run the model.
- Generate model report.
- Assign report to variable.
Example 355
Summary: Fits a parametric survival model to analyze censored data, generating a residual probability plot and extracting journal information.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :censor ),
Censor Code( "Censored" ),
Y( :Time ),
Effects( :Age, :Diag Time ),
Personality( "Parametric Survival" ),
Distribution( "Weibull" ),
Run( Likelihood Ratio Tests( 1 ), Residual Probability Plot( 1 ) )
);
rpt = obj << report;
jrn = rpt[Outline Box( "Residual Probability Plot" )][FrameBox( 1 )] << get journal;
Code Explanation:
- Open data table;
- Fit parametric survival model.
- Specify censor variable.
- Set censor code.
- Define response variable.
- Include age and diag time effects.
- Choose Weibull distribution.
- Run likelihood ratio tests.
- Generate residual probability plot.
- Extract journal from plot.
Example 356
Summary: Runs the stepwise binary logistic regression model fitting process, extracting key statistics and metrics for each step.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y Binary ),
Effects( :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Stepwise" ),
Run( Finish )
);
rpt = obj << report;
nsteps = Max( rpt[Outline Box( "Step History" )][Number Col Box( "Step" )] << get as matrix ) - 1;
history = rpt[Outline Box( "Step History" )][Table Box( 1 )] << get as matrix;
obj << Remove All( 1 );
obj << Clear History( 1 );
b history = J( nsteps, 9, . );
tmploc = [];
For( i = 1, i <= nsteps, i++,
chi2 = rpt[Outline Box( "Current Estimates" )][Number Col Box( "Wald/Score ChiSq" )] << get as matrix;
pval = rpt[Outline Box( "Current Estimates" )][Number Col Box( "\!"Sig Prob\!"" )] << get as matrix;
neg2LL1 = rpt[Outline Box( "Stepwise Fit for Y Binary" )][Number Col Box( "-LogLikelihood" )] << get as matrix;
tmpmin = Min( Remove( As List( pval ), As List( tmploc ) ) );
minloc = Loc( As List( pval ), tmpmin );
tmploc |/= minloc;
b history[i, 4] = chi2[minloc];
b history[i, 5] = pval[minloc];
obj << Step( 1 );
neg2ll2 = rpt[Outline Box( "Stepwise Fit for Y Binary" )][Number Col Box( "-LogLikelihood" )] << get as matrix;
pval2 = rpt[Outline Box( "Current Estimates" )][Number Col Box( "\!"Sig Prob\!"" )] << get as matrix;
b history[i, 1] = i;
b history[i, 2] = (neg2LL1 - neg2LL2) * 2;
b history[i, 3] = 1 - ChiSquare Distribution( b history[i, 2], 1 );
b history[i, 6] = (rpt[Outline Box( "Stepwise Fit for Y Binary" )][Number Col Box( "RSquare" )] << get as matrix);
b history[i, 7] = (rpt[Outline Box( "Stepwise Fit for Y Binary" )][Number Col Box( "p" )] << get as matrix);
b history[i, 8] = (rpt[Outline Box( "Stepwise Fit for Y Binary" )][Number Col Box( "AICc" )] << get as matrix);
b history[i, 9] = (rpt[Outline Box( "Stepwise Fit for Y Binary" )][Number Col Box( "BIC" )] << get as matrix);
);
minloc2 = Loc( As List( b history[0, 8] ), Min( b history[0, 8] ) );
Code Explanation:
- Open data table;
- Fit binary logistic regression model.
- Use stepwise personality.
- Run model.
- Extract step history report.
- Determine number of steps.
- Initialize history matrix.
- Loop through each step.
- Calculate chi-square and p-values.
- Find minimum p-value location.
Example 357
Summary: Runs a generalized linear model (GLM) analysis to predict the 'satell' variable, utilizing a Poisson distribution and log link function.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :satell ),
Effects( :color, :spine, :width, :weight ),
Center Polynomials( 0 ),
Personality( "Generalized Linear Model" ),
GLM Distribution( "Poisson" ),
Link Function( "Log" ),
Run
);
obj << Prediction Formula( 1 );
prop1 = dt:Pred Formula satell << Get Property( "Predicting" );
Code Explanation:
- Open data table.
- Define response variable.
- Specify effect variables.
- Disable polynomial centering.
- Choose model personality.
- Set GLM distribution.
- Select link function.
- Run the model.
- Add prediction formula.
- Retrieve predicting property.
Example 358
Summary: Fits a Cox Proportional Hazards model to data, utilizing censoring and specifying effects for prediction.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :Censor ),
Censor Code( "1" ),
Y( :Usage Hours ),
Effects( :Avg Load, :Avg Moisture, :Avg Vibration, :Avg Solar Exposure, :Location X, :Location Y ),
No Intercept,
Personality( "Generalized Regression" ),
Generalized Distribution( "Cox Proportional Hazards" ),
Run( Fit( Estimation Method( Maximum Likelihood ), Distribution Profiler( Save Bagged Predictions( 2, Random Seed( 12345 ) ) ) ) )
);
latest = Column( 11 ) << getasmatrix;
Code Explanation:
- Open table.
- Fit model with censor.
- Specify censor code.
- Set response variable.
- Define effects.
- Exclude intercept.
- Choose generalized regression.
- Select Cox proportional hazards.
- Run fit with MLE.
- Save bagged predictions.
Example 359
Summary: Fits a generalized linear model with normal distribution and log link function, followed by bagged predictions and profiler analysis.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Effects( :X ),
Personality( "Generalized Linear Model" ),
GLM Distribution( "Normal" ),
Link Function( "Log" ),
Overdispersion Tests and Intervals( 0 ),
Name( "Firth Bias-Adjusted Estimates" )(0),
Run( Profiler( 1 ) )
);
rpt = obj << report;
scptObj = rpt[Outline Box( "Prediction Profiler" )] << get scriptable object;
scptObj << Save Bagged Predictions( 2, Random Seed( 12345 ) );
latest = Column( 6 ) << getasmatrix;
Close( dt, nosave );
previous = [41.1450327517101, 7.10258721721694, 20.1186278955231, 19.9523084765608, 39.5819293704474, 23.6007941920471, 18.6471755295361,
30.5904762057678, 13.9146808340038, 5.31325293767326];
Code Explanation:
- Open data table.
- Fit a generalized linear model.
- Set distribution to Normal.
- Use Log link function.
- Disable overdispersion tests.
- Disable Firth bias adjustment.
- Run the profiler.
- Retrieve the report object.
- Access the Prediction Profiler outline box.
- Get the scriptable object.
- Save bagged predictions with 2 bags.
- Set random seed for reproducibility.
- Extract the latest predictions matrix.
- Close the data table without saving.
Example 360
Summary: Fits a Generalized Linear Model with Normal distribution and Log link function to a data table, generating bagged predictions.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Effects( :X ),
Personality( "Generalized Linear Model" ),
GLM Distribution( "Normal" ),
Link Function( "Log" ),
Overdispersion Tests and Intervals( 0 ),
Name( "Firth Bias-Adjusted Estimates" )(0),
Run( Profiler( 1 ) )
);
rpt = obj << report;
scptObj = rpt[Outline Box( "Prediction Profiler" )] << get scriptable object;
scptObj << Save Bagged Predictions( 2, Random Seed( 12345 ) );
latest = Column( 6 ) << getasmatrix;
Code Explanation:
- Open data table;
- Fit Generalized Linear Model.
- Set response variable Y.
- Set predictor variable X.
- Use Normal distribution.
- Apply Log link function.
- Disable overdispersion tests.
- Disable Firth bias adjustment.
- Run Prediction Profiler.
- Save bagged predictions.
Example 361
Summary: Fits a generalized linear model with binomial distribution and logit link function to a data table, utilizing a surface profiler for visualization.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Number Popped, :Total Kernels ),
Effects( :Brand, :Time, :Power, :Brand * :Time, :Brand * :Power, :Time * :Power, :Time * :Time, :Power * :Power ),
Personality( "Generalized Linear Model" ),
GLM Distribution( "Binomial" ),
Link Function( "Logit" ),
Overdispersion Tests and Intervals( 0 ),
Run(
Surface Profiler(
1,
Surface Color Theme( "Green to Black to Red" ),
Surface Color Theme2( "Green to White to Red" ),
Surface Color Theme3( "White to Black" ),
Surface Color Theme4( "Blue to Gray to Red" ),
Response Column Color Theme( "Blue to Green to Red" ),
Response Column Color Theme2( "Spectral" ),
Response Column Color Theme3( "Jet" ),
Response Column Color Theme4( "White to Blue" ),
Surface Color Method( "Solid", "Solid", "Solid", "Solid" ),
)
)
);
Code Explanation:
- Open data table.
- Fit generalized linear model.
- Specify response variables.
- Define effects for model.
- Set model personality.
- Choose binomial distribution.
- Select logit link function.
- Disable overdispersion tests.
- Run surface profiler.
- Customize surface colors.
Example 362
Summary: Fits a generalized linear model with Poisson distribution and log link function to predict outcomes, utilizing a profiler for confidence intervals and desirability functions.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :N ),
Effects( :Type B, :Type C, :Type D, :Type E, :Yr 65, :Yr 70, :Yr 75, :Op 75, :Service ),
Personality( "Generalized Linear Model" ),
GLM Distribution( "Poisson" ),
Link Function( "Log" ),
Overdispersion Tests and Intervals( 0 ),
Name( "Firth Bias-Adjusted Estimates" )(0),
Run(
1,
Profiler(
1,
Confidence Intervals( 1 ),
Desirability Functions( 1 ),
N << Response Limits( {Lower( -10, 0.066 ), Middle( 25, 0.5 ), Upper( 60, 0.9819 ), Goal( "Maximize" ), Importance( 1 )} ),
Term Value(
Type B( 0, Lock( 1 ), Show( 1 ) ),
Type C( 0, Lock( 1 ), Show( 1 ) ),
Type D( 0, Lock( 0 ), Show( 1 ) ),
Type E( 1, Lock( 0 ), Show( 1 ) ),
Yr 65( 1, Lock( 0 ), Show( 1 ) ),
Yr 70( 1, Lock( 0 ), Show( 1 ) ),
Yr 75( 1, Lock( 0 ), Show( 1 ) ),
Op 75( 1, Lock( 0 ), Show( 1 ) )
)
)
)
);
rpt = obj << report;
scpt = rpt[Outline Box( "Prediction Profiler" )] << get scriptable object;
scpt << Maximize For Each Grid Point;
Code Explanation:
- Open data table;
- Fit generalized linear model.
- Set Poisson distribution.
- Use log link function.
- Disable overdispersion tests.
- Disable Firth bias adjustment.
- Run profiler.
- Enable confidence intervals.
- Enable desirability functions.
- Set response limits and goals.
- Configure term values and locks.
- Retrieve prediction profiler report.
- Get scriptable object from report.
- Maximize for each grid point.
Example 363
Summary: Fits a generalized linear model to analyze the relationship between response variables and effects, utilizing a binomial distribution and logit link function.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Number Popped, :Total Kernels ),
Effects( :Brand, :Time, :Power, :Brand * :Time, :Brand * :Power, :Time * :Power, :Time * :Time, :Power * :Power ),
Personality( "Generalized Linear Model" ),
GLM Distribution( "Binomial" ),
Link Function( "Logit" ),
Overdispersion Tests and Intervals( 0 ),
Run
);
obj << Surface Profiler( 1 );
Code Explanation:
- Open data table.
- Fit generalized linear model.
- Specify response variables.
- Define model effects.
- Set personality to GLM.
- Choose binomial distribution.
- Select logit link function.
- Disable overdispersion tests.
- Run the model.
- Create surface profiler.
Example 364
Summary: Fits a generalized regression model to predict binary outcomes, utilizing ridge estimation and holdback validation.
Code:
dt8b = Open("data_table.jmp");
obj8b = dt8b << Fit Model(
Y( :Y Binary ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Target Level( "High" ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Binomial" ),
Run( Fit( Estimation Method( Ridge ), Validation Method( Holdback, 0.3 ), Profiler( 1 ) ) )
);
dt8b << Clear Row States << Select Rows( Index( 100, N Row( dt8b ) ) ) << Exclude;
profiler[1] << Profiler( 1, Desirability Functions( 1 ), Shapley Set Random Seed( 1000 ) );
profiler[1] << Save Shapley Values;
dt8b:SHAP Intercept << Exclude( 0 );
dt8b << New Column( "Sum of SHAP (Y Binary=High)",
Formula(
Sum(
:SHAP Intercept,
:SHAP Age,
:SHAP Gender,
:SHAP BMI,
:SHAP BP,
:SHAP Total Cholesterol,
:SHAP LDL,
:SHAP HDL,
:SHAP TCH,
:SHAP LTG,
:SHAP Glucose
)
)
);
obj8b << (Fit[1] << Save Prediction Formula);
dt8b << New Column( "Absolute Deviation (Y Binary=High)",
Formula( Abs( :"Sum of SHAP (Y Binary=High)"n - :"Probability(Y Binary=High)"n ) )
);
dt8b << New Column( "Max Deviation (Y Binary=High)", Formula( Col Max( :"Absolute Deviation (Y Binary=High)"n ) ), hide );
Window( "data_table - Generalized Regression" ) << close window;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Specify binary response variable.
- Define predictor effects.
- Set target level to "High".
- Use binomial distribution.
- Apply ridge estimation method.
- Use holdback validation with 30%.
- Generate profiler.
- Exclude last 100 rows.
- Configure profiler settings.
- Save Shapley values.
- Include SHAP intercept.
- Create sum of SHAP column.
- Save prediction formula.
- Create absolute deviation column.
- Create max deviation column (hidden).
- Close results window.
Example 365
Summary: Performs a parametric survival analysis with lognormal distribution to estimate time quantiles, utilizing the Fit Model platform in JMP.
Code:
dt = Open("data_table.jmp");
fit = Fit Model(
Y( :ExecTime ),
Effects( :Load ),
Personality( Parametric Survival ),
Distribution( LogNormal ),
Run Model( Likelihood Ratio Tests( 1 ), {Estimate Time Quantile( Load = 5, [0.1], Alpha( 0.05 ) )} )
);
Code Explanation:
- Open data table;
- Define response variable.
- Specify effect variable.
- Choose parametric survival personality.
- Select lognormal distribution.
- Run model with options.
- Perform likelihood ratio tests.
- Estimate time quantiles.
- Set load value to 5.
- Specify quantile probability and alpha level.
Example 366
Summary: Performs a parametric survival analysis with lognormal distribution and likelihood ratio tests to estimate the survival probability at a specific time point (40.9853) for a given dataset.
Code:
dt = Open("data_table.jmp");
fit = Fit Model(
Freq( :Weight ),
Y( :Hours ),
Effects( :x ),
Personality( Parametric Survival ),
Distribution( LogNormal ),
Censor( :Censor ),
Run Model( Likelihood Ratio Tests( 1 ), {Estimate Survival Probability( x = 40.9853, [30000, 10000], Alpha( 0.05 ) )} )
);
Code Explanation:
- Open data table.
- Define frequency variable.
- Set response variable.
- Specify effect variable.
- Choose parametric survival personality.
- Select lognormal distribution.
- Identify censoring variable.
- Run model with options.
- Perform likelihood ratio tests.
- Estimate survival probability.
Example 367
Summary: Fits a parametric survival model to analyze the relationship between hours worked and weight, while accounting for censoring and generating a residual quantile plot.
Code:
dt = Open("data_table.jmp");
obj = Fit Model(
Freq( :Weight ),
Y( :Hours ),
Effects( :x ),
Personality( Parametric Survival ),
Distribution( Weibull ),
Censor( :Censor ),
Run( Residual Quantile Plot( 1 ) )
);
Code Explanation:
- Open data table;
- Define dataset variable.
- Fit parametric survival model.
- Specify frequency column.
- Set response variable.
- Add effect variable.
- Choose Weibull distribution.
- Identify censoring column.
- Run residual analysis.
- Generate quantile plot.
Example 368
Summary: Fits a generalized regression model to predict Job Satisfaction, incorporating Salary, School Age Children, and I have vast interests outside of work as predictors, using maximum likelihood estimation with a Poisson distribution.
Code:
dt = Open("data_table.jmp");
gr = dt << Fit Model(
Y( :Job Satisfaction ),
Effects( :Salary, :School Age Children, :I have vast interests outside of work ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Poisson" ),
Run( Fit( Estimation Method( Maximum Likelihood ), Validation Method( None ) ) )
);
dt << Delete Columns( 14 );
code_table = gr << Save Coding Table;
gr << close window;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set response variable: Job Satisfaction.
- Add predictors: Salary, School Age Children, I have vast interests outside of work.
- Choose Poisson distribution.
- Use maximum likelihood estimation.
- Do not validate model.
- Delete column 14.
- Save coding table to code_table.
- Close fit model window.
Example 369
Summary: Fits a generalized regression model with Lasso adaptive estimation method and simulating Y using a saved simulation formula, generating a report and extracting results.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ) ) )
);
obj << (fit[1] << savesimulationformula);
rpt = obj << report;
Random Reset( 468651 );
dtr = (rpt["Parameter Estimates for Original Predictors"][Number Col Box( "Estimate" )] << Simulate(
10,
Out( :Y ),
In( :Y Simulation Formula )
))[2];
rr = dtr << getasmatrix;
dtr2 = (rpt["Parameter Estimates for Original Predictors"][Number Col Box( "Estimate" )] << Simulate(
10,
Out( :Y ),
In( :Y Simulation Formula ),
Random Seed( 468651 )
))[2];
ss = dtr2 << getasmatrix;
obj << close window;
Close( dtr, nosave );
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Use Lasso adaptive estimation method.
- Save simulation formula.
- Generate report.
- Reset random seed.
- Simulate Y using formula.
- Extract simulation results.
- Simulate Y with fixed seed.
- Extract second set of results.
Example 370
Summary: Fits a generalized regression model to predict continuous outcomes, utilizing Lasso adaptive estimation and normal distribution assumptions.
Code:
dt = Open("data_table.jmp");
obj = Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ) ) )
);
rpt = Report( obj );
cname = "Prob > Chisquare";
csim = rpt["Parameter Estimates for Original Predictors"][Number Col Box( cname )];
obj << (fit[1] << save simulation formula);
dtr = (csim << Simulate( 10, Out( :Y ), In( :Y Simulation Formula ) ))[2];
obj2 = dtr << Distribution(
Column( :Intercept, :Age, :Name( "Gender[1-2]" ), :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Quantiles( 0 ),
Summary Statistics( 0 ),
Frequencies( 0 )
);
rpt2 = obj2 << report;
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Specify validation column.
- Define response variable.
- Include multiple predictor effects.
- Choose normal distribution.
- Run Lasso adaptive estimation.
- Extract parameter estimates report.
- Save simulation formula.
- Simulate 10 Y values.
- Create distribution report for simulated data.
Distribution using New Column
Example 1
Summary: Calculates a loss function template for LogNormal distribution, incorporating parameters Mu and sigma, with an IfMZ condition for censored data.
Code:
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////
// JSL to create a loss function template of LogNormal //
///////////////////////////////////////////////////////////////////////////////////////////////////////////
dt= new table ("LogNormal");
dt<<New Column("Time", Numeric,continuous);
dt<<New Column("Censor", Numeric,continuous);
dt<<New Column("LogNormal", Numeric,continuous);
column( "LogNormal") << formula( Parameter({Mu=2.2222521390893, sigma=0.306392085240603}, IfMZ( :Censor!=0, -Log(1-Normal Distribution((Log( :Time, 10)-Mu)/sigma)), (Log( :Time*sigma)+0.5*Log(2*Pi())+0.5*((Log( :Time, 10)-Mu)/sigma)^2)-Log(0.4343))) );
Code Explanation:
- Create new table "LogNormal".
- Add "Time" column.
- Add "Censor" column.
- Add "LogNormal" column.
- Define formula for "LogNormal" column.
- Use parameters Mu and sigma.
- Apply IfMZ condition for censored data.
- Calculate log-normal distribution formula.
- Handle uncensored data case.
- Include constant term in formula.
Example 2
Summary: Creates a loss function template for normal distribution, defining parameters Mu and sigma, and using conditional logic to calculate log probabilities for censored data.
Code:
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////
// JSL to create a loss function template of Normal //
///////////////////////////////////////////////////////////////////////////////////////////////////////////
dt= new table ("Normal");
dt<<New Column("Time", Numeric,continuous);
dt<<New Column("Censor", Numeric,continuous);
dt<<New Column("Normal", Numeric,continuous);
column( "Normal") << formula( Parameter({Mu=2.22225216957577, sigma=0.306392163933592}, IfMZ( :Censor!=0, -Log(1-Normal Distribution(( :Time-Mu)/sigma)), Log(sigma)+(0.5*Log(2*Pi())+0.5*(( :Time-Mu)/sigma)^2))) );
Code Explanation:
- Create new table "Normal".
- Add column "Time" (numeric, continuous).
- Add column "Censor" (numeric, continuous).
- Add column "Normal" (numeric, continuous).
- Set formula for "Normal" column.
- Define parameters Mu and sigma.
- Use IfMZ function for conditional logic.
- Calculate log probability for censored data.
- Calculate log likelihood for uncensored data.
- Combine results using normal distribution formula.
Example 3
Summary: Calculates the Tobit loss function for a given model, using parameters b0, b1, and b2 to define the model formula, and parameter Sigma for loss calculation.
Code:
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////
// JSL to create a loss function template of Tobit1 //
///////////////////////////////////////////////////////////////////////////////////////////////////////////
dt= new table ("Tobit1");
dt<<New Column("Y", Numeric,continuous);
dt<<New Column("Model", Numeric,continuous);
dt<<New Column("Tobit Loss", Numeric,continuous);
column( "Model") << formula( Parameter({b0=0, b1=0, b2=0}, :y-(b0+b1*Empty()+b2*Empty())) );
column( "Tobit Loss") << formula( Parameter({Sigma=1}, -IfMZ( :y==0, Log(1-Normal Distribution(- :Model/Sigma)), (-Log(Sigma))-0.5*( :Model/Sigma)^2-0.5*Log(2*Pi()))) );
Code Explanation:
- Create new table "Tobit1".
- Add column "Y" (numeric, continuous).
- Add column "Model" (numeric, continuous).
- Add column "Tobit Loss" (numeric, continuous).
- Define formula for "Model" column.
- Define formula for "Tobit Loss" column.
- Use parameters b0, b1, b2 for model.
- Use parameter Sigma for loss calculation.
- Apply IfMZ condition for Tobit loss formula.
- Calculate log and normal distribution for loss.
Example 4
Summary: Creates and manipulates a data table, including setting column properties, generating a distribution report, and selecting specific columns.
Code:
dt = Open("data_table.jmp");
New Column( "example", "Numeric", "Continuous", Width( 5 ), <<Set Each Value( 100 ) );
dt << Distribution(
Continuous Distribution( Column( :height ), Always use column
properties( 1 ) ),
Column Switcher( :height, {:name, :age, :sex, :height, :weight, :example} )
);
dt:example << set selected;
dt << Delete Columns();
dt << Select Columns( :Height );
dt << Move Selected Columns( To first );
cnames = dt << Get Column Names;
Code Explanation:
- Open data table.
- Create new numeric column.
- Set each value to 100.
- Generate distribution report.
- Include height in distribution.
- Enable column properties.
- Add column switcher for multiple columns.
- Select example column.
- Delete all columns.
- Select height column.
- Move height to first position.
- Get column names.
Example 5
Summary: Fits a generalized regression model with multiple effects and generates a profiler plot to analyze the relationship between predictor variables and response probabilities.
Code:
dt = Open("data_table.jmp");
dt << New Column( "Y Nominal", nominal, character, formula( If( :Y > 200, "High", :Y > 150 & :Y <= 200, "Medium", :Y <= 150, "Low" ) ) );
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y Nominal ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Multinomial" ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ) ) )
);
rpt = obj << report;
obj << (Fit[1] << Parameter Estimates for Centered and Scaled Predictors( 1 ));
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
b actmin 2 = [1.37955224563164, 0, -9.49459731991732, -20.9646081168289, -17.3654913469597, 35.3713350402518, -26.5656511866495, 0, 0,
-40.8257288707835, 0, 0.412839066139869, 0, 0, -16.0545060938333, -8.60234967697212, 2.47204742983661, 0, 0, -5.5216996784394,
-13.3472463104537, 0];
obj << Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( "AICc" ) );
obj << (Fit[1] << Parameter Estimates for Centered and Scaled Predictors( 1 ));
actmin 2 = rpt[Outline Box( "Multinomial Adaptive Elastic Net with AICc Validation" )][Outline Box(
"Parameter Estimates for Centered and Scaled Predictors"
)][Table Box( 1 )][Number Col Box( "Estimate" )] << get as matrix;
If( Host is( Windows ), , );
fd0 = Formula Depot();
obj << (Fit[1] << Publish Prediction Formula( 1 ));
obj << (Fit[2] << Publish Prediction Formula( 1 ));
fd0 << Run Scripts( 1 );
prop1 = dt:Name( "Prob[Low]" ) << get property( "Response Probability" );
prop2 = dt:Name( "Prob[Low]_1" ) << get property( "Response Probability" );
fd0 << close window( 1 );
Code Explanation:
- Open data table;
- Create "Y Nominal" column.
- Fit generalized regression model.
- Set multinomial distribution.
- Use Lasso estimation method.
- Validate using validation column.
- Get parameter estimates.
- Compare with predefined estimates.
- Fit model with Elastic Net.
- Publish prediction formulas.
Example 6
Summary: Fits and validates a generalized regression model with multiple effects, generating reports and extracting active parameter estimates.
Code:
dt = Open("data_table.jmp");
dt << New Column( "Y Nominal", character, formula( If( :Y > 200, "High", :Y > 150 & :Y <= 200, "Medium", :Y <= 150, "Low" ) ) );
obj1 = dt << Fit Model(
Validation( :Validation ),
Y( :Y Nominal ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Multinomial" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( Validation Column ) ) )
);
rpt1 = obj1 << report;
dlg1 = obj1 << (fit[1] << Relaunch with Active Effects( 1 ));
obj2 = dlg1 << Run( Fit( Estimation Method( Lasso( Min Ratio( 0 ) ) ), Validation Method( Validation Column ) ) );
obj2 << (Fit[1] << Active Parameter Estimates( 1 ));
rpt2 = obj2 << report;
res = rpt2[Outline Box( "Multinomial Lasso with Validation Column" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
obj1 << Fit( Estimation Method( Double Lasso ), Validation Method( Validation Column ) );
obj1 << (fit[2] << Active Parameter Estimates( 1 ));
aRes = rpt1[Outline Box( "Multinomial Double Lasso with Validation Column" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Create "Y Nominal" column.
- Fit generalized regression model.
- Set validation method.
- Specify response variable.
- Define effects for model.
- Choose personality and distribution.
- Run model with Lasso estimation.
- Generate report for first model.
- Relaunch model with active effects.
- Run model with adjusted Lasso.
- Display active parameter estimates.
- Generate report for second model.
- Extract estimate values from report.
- Fit model with Double Lasso.
- Display active parameter estimates.
- Extract estimate values from report.
Example 7
Summary: Fits a generalized regression model with Lasso estimation and BIC validation, generating reports and extracting active parameter estimates.
Code:
dt = Open("data_table.jmp");
dt << New Column( "Y Nominal", character, formula( If( :Y > 200, "High", :Y > 150 & :Y <= 200, "Medium", :Y <= 150, "Low" ) ) );
obj1 = dt << Fit Model(
Validation( :Validation ),
Y( :Y Nominal ),
Effects( :Age, :Gender, :BMI, :BP ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Multinomial" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( "BIC" ) ) )
);
rpt1 = obj1 << report;
dlg1 = obj1 << (fit[1] << Relaunch with Active Effects( 1 ));
obj2 = dlg1 << Run( Fit( Estimation Method( Lasso( Min Ratio( 0 ) ) ), Validation Method( "BIC" ) ) );
obj2 << (Fit[1] << Active Parameter Estimates( 1 ));
rpt2 = obj2 << report;
res = rpt2[Outline Box( "Multinomial Lasso with BIC Validation" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
obj1 << Fit( Estimation Method( Double Lasso ), Validation Method( "BIC" ) );
obj1 << (fit[2] << Active Parameter Estimates( 1 ));
aRes = rpt1[Outline Box( "Multinomial Double Lasso with BIC Validation" )][Outline Box( "Active Parameter Estimates" )][
Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Create "Y Nominal" column.
- Fit Multinomial model.
- Generate report.
- Relaunch with active effects.
- Run Lasso estimation.
- Get active parameter estimates.
- Generate second report.
- Extract estimate matrix.
- Fit Double Lasso estimation.
Example 8
Summary: Fits a Generalized Regression model with Ordinal Logistic distribution to predict Y Nominal, utilizing multiple effects and Lasso (Adaptive) estimation method.
Code:
dt = Open("data_table.jmp");
dt << New Column( "Y Nominal", nominal, character, formula( If( :Y > 200, "High", :Y > 150 & :Y <= 200, "Medium", :Y <= 150, "Low" ) ) );
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y Ordinal ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Ordinal Logistic" ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ) ) )
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
tnll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
Close( dt, no save );
b actmin = [0.263966157449194, 0, -8.16480793350535, -15.2632172269389, -12.1793484564848, 26.9952597983493, -18.5857735518044, 0, 0,
-30.8290859040609, 0, 1.29070553973775];
Code Explanation:
- Open data table;
- Create new column "Y Nominal".
- Fit model using Generalized Regression.
- Set distribution to Ordinal Logistic.
- Use Lasso (Adaptive) estimation method.
- Validate using Validation Column.
- Extract model report.
- Get solution path.
- Get validation negative log likelihood.
- Close dataset without saving.
Example 9
Summary: Fits a generalized regression model with ordinal logistic distribution to predict 'Y Nominal' based on multiple effects, and generates a report with solution path and validation metrics.
Code:
dt = Open("data_table.jmp");
dt << New Column( "Y Nominal", nominal, character, formula( If( :Y > 200, "High", :Y > 150 & :Y <= 200, "Medium", :Y <= 150, "Low" ) ) );
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y Ordinal ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Ordinal Logistic" ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ) ) )
);
rpt = obj << report;
path = obj << (fit[1] << Get Solution Path);
tnll = obj << (fit[1] << Get Validation Negative Log Likelihood);
actmin = rpt[Outline Box( "Parameter Estimates for Centered and Scaled Predictors" )][Table Box( 1 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Create "Y Nominal" column.
- Launch Fit Model platform.
- Set validation method.
- Specify ordinal logistic distribution.
- Define model effects.
- Use generalized regression personality.
- Fit model with adaptive lasso.
- Extract model report.
- Retrieve solution path and validation metrics.
Example 10
Summary: Fits a parametric survival model with Weibull distribution and likelihood ratio tests to analyze censored data, generating a profiler plot for further analysis.
Code:
dt = Open("data_table.jmp");
dt << New Column( "ZCensor", Set Formula( 1 - :Censor ) );
fm = dt << Fit Model(
Censor( :ZCensor ),
Censor Code( 0 ),
Y( :days ),
Effects( :Group ),
Personality( "Parametric Survival" ),
Distribution( "Weibull" ),
Run( Likelihood Ratio Tests( 1 ) )
);
v = Report( fm )[Number Col Box( 4 )] << get as matrix;
Close( dt, No Save );
Preferences( Fit Parametric Survival( Wald Tests( 1 ) ) );
Code Explanation:
- Open data table;
- Create new column "ZCensor".
- Set formula for "ZCensor".
- Launch Fit Model platform.
- Specify censor variable.
- Set censor code to 0.
- Define response variable "days".
- Add effect "Group".
- Choose Parametric Survival personality.
- Select Weibull distribution.
- Run model with likelihood ratio tests.
- Extract results from report.
- Close dataset without saving.
- Set default preference for Wald tests.
Example 11
Summary: Fits a parametric survival model with Weibull distribution to analyze censored data, incorporating group effects and censoring variables.
Code:
dt = Open("data_table.jmp");
dt << New Column( "ZCensor", Set Formula( 1 - :Censor ) );
fm = dt << Fit Model(
Censor( :ZCensor ),
Censor Code( 0 ),
Y( :days ),
Effects( :Group ),
Personality( "Parametric Survival" ),
Distribution( "Weibull" ),
Run( Likelihood Ratio Tests( 1 ) )
);
v = Report( fm )[Number Col Box( 4 )] << get as matrix;
Code Explanation:
- Open data table.
- Create new column "ZCensor".
- Set "ZCensor" formula to 1 - Censor.
- Launch Fit Model platform.
- Specify "ZCensor" as censor variable.
- Set censor code to 0.
- Define "days" as response variable.
- Include "Group" as effect.
- Choose "Parametric Survival" personality.
- Select "Weibull" distribution.
Example 12
Summary: Fits a life by X model with logit relationship, loglogistic distribution, and frequency weights to analyze the relationship between temperature and hours, while accounting for censoring.
Code:
dt = Open("data_table.jmp");
dt << New Column( "TempBy100", Formula( :Temp / 100 ) );
obj = dt << Fit Life by X(
Relationship( Logit ),
Distribution( Loglogistic ),
Y( :Hours ),
X( :TempBy100 ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
);
dt << New Column( "lossformula",
Formula(
Parameter(
{b0 = 9, b1 = -1.4, sigma = 0.5},
mu = b0 + b1 * Log( :TempBy100 / (1 - :TempBy100) );
zz = (Log( :Hours ) - mu) / sigma;
:weight * If( :Censor == 1,
Log( 1 + Exp( zz ) ),
Log( sigma ) + Log( :Hours ) - zz + 2 * Log( 1 + Exp( zz ) )
);
)
)
);
Code Explanation:
- Open data table.
- Create new column "TempBy100".
- Fit life by X using logit relationship.
- Specify loglogistic distribution.
- Set Y variable to "Hours".
- Set X variable to "TempBy100".
- Define censoring variable "Censor".
- Set censor code to 1.
- Use frequency weights from "Weight".
- Create new column "lossformula".
Example 13
Summary: Fits a generalized regression model with multiple effects and generates a profiler plot to analyze the data.
Code:
dt = Open("data_table.jmp");
New Column( "N", Numeric, Continuous, Width( 5 ), <<Set Each Value( N Rows( dt ) ) );
New Column( "BMI2", Numeric, Continuous, Width( 5 ), <<Formula( Floor( :BMI ) ) );
obj = dt << Fit Model(
Y( :BMI2, :N ),
Effects( :Severity, :Age, :Time, :Markers ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Beta Binomial" ),
Run(
Fit(
Estimation Method( Maximum Likelihood ),
Validation Method( None ),
Profiler( Save Bagged Predictions( 2, Random Seed( 12345 ) ) )
)
)
);
latest = Column( 12 ) << getasmatrix;
Close( dt, nosave );
previous = [0.775749675443894, 0.900065414736571, 0.872545245296738, 0.736808711736175, 0.945942668933135, 0.466293607576884,
0.928830343719808, 0.989386522692855, 0.874577627301113, 0.733224851552163, 0.699366311452847, 0.130449814285087, 0.435974270013703,
0.858290909069434, 0.513537082099023, 0.285431869395926, 0.323888433903806, 0.796895400056745, 0.139995186799028, 0.234863725723807,
0.240910229597308, 0.220508418203626, 0.416010097107032, 0.1440591718111, 0.0731862654026702, 0.220508418203626, 0.0463240305993132,
0.340340456705053, 0.425962013110601, 0.311795263918432, 0.282392088163472, 0.125887963683496, 0.556853464575166, 0.134279967813886,
0.297664277393728, 0.897025120122287, 0.205569804080598, 0.75372534846515, 0.287665357522687, 0.68825000590857];
Code Explanation:
- Open table.
- Create new column "N".
- Create new column "BMI2".
- Fit model using Generalized Regression.
- Set distribution to Beta Binomial.
- Use Maximum Likelihood estimation.
- Save bagged predictions.
- Extract latest predictions.
- Close table without saving.
- Assign previous predictions.
Example 14
Summary: Fits a parametric survival model with multiple effects and generates a profiler plot to analyze the data.
Code:
dt = Open("data_table.jmp");
New Column( "Time", Numeric, Continuous, Width( 5 ), <<Formula( :Hours ) );
obj = dt << Fit Model(
Censor( :Censor ),
Censor Code( "1" ),
Freq( :Weight ),
Y( :Time ),
Effects( :x ),
Personality( "Parametric Survival" ),
Distribution( "Lognormal" ),
Run( Likelihood Ratio Tests( 1 ), Distribution Profiler( Save Bagged Predictions( 2, Random Seed( 12345 ) ) ) )
);
latest = Column( "Pred Formula Failure Probability Bagged Mean" ) << getasmatrix;
Close( dt, nosave );
previous = [5.18877091042706, 5.18877091042706, 5.18877091042706, 7.51588459852329, 7.51588459852329, 7.51588459852329, 10.8900939861481,
10.8900939861481, 15.7840843029963, 15.7840843029963, 15.7840843029963, 22.8846160835679, 22.8846160835679, 33.1897893619543,
33.1897893619543, 33.1897893619543];
Code Explanation:
- Open data table.
- Create new column "Time".
- Fit parametric survival model.
- Set censoring and codes.
- Apply frequency weights.
- Specify response variable "Time".
- Include effect "x".
- Use Lognormal distribution.
- Run likelihood ratio tests.
- Save bagged predictions.
Example 15
Summary: Fits a generalized regression model with multiple effects and generates a profiler plot to analyze the relationship between BMI, severity, age, time, and markers.
Code:
dt = Open("data_table.jmp");
New Column( "N", Numeric, Continuous, Width( 5 ), <<Set Each Value( N Rows( dt ) ) );
New Column( "BMI2", Numeric, Continuous, Width( 5 ), <<Formula( Floor( :BMI ) ) );
obj = dt << Fit Model(
Y( :BMI2, :N ),
Effects( :Severity, :Age, :Time, :Markers ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Beta Binomial" ),
Run(
Fit(
Estimation Method( Maximum Likelihood ),
Validation Method( None ),
Profiler( Save Bagged Predictions( 2, Random Seed( 12345 ) ) )
)
)
);
latest = Column( 12 ) << getasmatrix;
Code Explanation:
- Open data table;
- Create new column "N".
- Set "N" values to row count.
- Create new column "BMI2".
- Set "BMI2" using BMI floor.
- Start Fit Model.
- Set response variables: BMI2, N.
- Add effects: Severity, Age, Time, Markers.
- Use Generalized Regression personality.
- Set Beta Binomial distribution.
Example 16
Summary: Fits a parametric survival model with multiple effects and generates a profiler plot to analyze the data.
Code:
dt = Open("data_table.jmp");
New Column( "Time", Numeric, Continuous, Width( 5 ), <<Formula( :Hours ) );
obj = dt << Fit Model(
Censor( :Censor ),
Censor Code( "1" ),
Freq( :Weight ),
Y( :Time ),
Effects( :x ),
Personality( "Parametric Survival" ),
Distribution( "Lognormal" ),
Run( Likelihood Ratio Tests( 1 ), Distribution Profiler( Save Bagged Predictions( 2, Random Seed( 12345 ) ) ) )
);
latest = Column( "Pred Formula Failure Probability Bagged Mean" ) << getasmatrix;
Code Explanation:
- Open data table.
- Create new column "Time".
- Fit parametric survival model.
- Specify censor variable.
- Set censor code.
- Use frequency weights.
- Define response variable.
- Include effect variable.
- Choose Lognormal distribution.
- Run likelihood ratio tests.
- Save bagged predictions.
- Retrieve prediction matrix.
Example 17
Summary: Fits a standard least squares model with multiple effects and generating a profiler plot using JMP's Fit Curve platform.
Code:
dt = Open("data_table.jmp");
dt << New Column( "Fractional Frequencies", Set Values( 1 ) );
fc = dt << Fit Curve( Y( :Y ), X( :X ), Fit Probit 2p );
rfc = fc << report;
est1 = Matrix( rfc[Number Col Box( "Estimate" )] << get );
std1 = Matrix( rfc[Number Col Box( "Std Error" )] << get );
corr1 = rfc[Outline Box( "Correlation of Estimates" )][Matrix Box( 1 )] << get;
modComp1 = Matrix( rfc[Outline Box( "Model Comparison" )][Table Box( 1 )] << get )[3 :: 8];
nlin = dt << Nonlinear(
Y( :Y ),
Model( Parameter( {a = 0.025, b = 8.21}, Normal Distribution( a * (:X - b) ) ) ),
Freq( :Fractional Frequencies ),
Newton,
Finish
);
rpt = nlin << report;
est2 = Matrix( rpt[Number Col Box( "Estimate" )] << get );
Code Explanation:
- Open data table.
- Add new column.
- Fit curve using Probit 2p.
- Extract report from fit curve.
- Get estimates from report.
- Get standard errors from report.
- Get correlation matrix from report.
- Get model comparison statistics.
- Fit nonlinear model.
- Extract estimates from nonlinear report.
Example 18
Summary: Creates a data table with multiple columns and formulas, including a profiler plot for a hypergeometric distribution.
Code:
dt2 = Open("data_table.jmp");
dt2 << New Column( "temp, sex", nominal, values( J( 15, 1, 0 ) |/ J( 25, 1, 1 ) ) );
dt2 << New Column( "Formula1",
formula( (-100) + Match( :Name( "temp, sex" ), 0, 10, 1, 20, . ) + Match( :sex, "F", 2, "M", -2, . ) + 5 * :height )
);
obj = dt2 << Profiler( Y( :Formula1 ), Surface Profiler( 1 ) );
Close( dt2, No Save );
dt2 = New Table( "NvSn",
New Column( "N", Values( [1, 100] ) ),
New Column( "m", Values( [1, 100] ) ),
New Column( "k", Values( [0, 100] ) ),
New Column( "n", Values( [1, 100] ) ),
New Column( "HypergeoPr(<=k)", Formula( Hypergeometric Distribution( N, m, n, k ) ) )
);
obj = dt2 << Profiler( Y( "HypergeoPr(<=k)" ), Profiler( 1 ) );
Code Explanation:
- Open data table;
- Add "temp, sex" column.
- Set "temp, sex" values.
- Add "Formula1" column.
- Define "Formula1" formula.
- Create profiler for "Formula1".
- Close "data_table.jmp" without saving.
- Create new table "NvSn".
- Add columns N, m, k, n.
- Add "HypergeoPr(<=k)" column with formula.
- Create profiler for "HypergeoPr(<=k)".
Example 19
Summary: Fits a standard least squares model with multiple effects and generating a profiler plot for data analysis, utilizing Life Distribution to compare groups.
Code:
dt = Open("data_table.jmp");
dt << New Column( "group", Numeric, Nominal, Set Values( J( N Rows( dt ), 1, 1 ) ) );
dt:group[2] = 2;
dt << New Column( "freq", Numeric, Continuous, Set Values( J( N Rows( dt ), 1, 1 ) ) );
dt:freq[2] = 10;
Preference( LifeDistribution( Weibayes Only for Zero Failure Data( 1 ) ) );
ld = Life Distribution(
Perspective( Compare Groups ),
Y( :Time ),
Censor( :Censor ),
Censor Coding( "Censored" ),
Grouping( :group ),
Freq( :freq )
);
Code Explanation:
- Open table.
- Add group column.
- Set group values.
- Add freq column.
- Set freq values.
- Set preference.
- Run Life Distribution.
- Compare groups.
- Set Y variable.
- Set censor variable.
Example 20
Summary: Fits a standard least squares model with multiple effects and generates a profiler plot using Life Distribution platform in JMP.
Code:
dt = Open("data_table.jmp");
dt << New Column( "group", Numeric, Nominal, Set Values( J( N Rows( dt ), 1, 1 ) ) );
dt << New Column( "freq", Numeric, Continuous, Set Values( J( N Rows( dt ), 1, 1 ) ) );
dt:freq[2] = 10;
Preference( LifeDistribution( Weibayes Only for Zero Failure Data( 1 ) ) );
ld = dt << Life Distribution(
Perspective( Compare Groups ),
Y( :Time ),
Censor( :Censor ),
Censor Code( 1 ),
Grouping( :group ),
Freq( :freq )
);
Code Explanation:
- Open data table;
- Create new column "group".
- Set "group" values to 1.
- Create new column "freq".
- Set "freq" values to 1.
- Modify second row's "freq" to 10.
- Set Weibayes preference for zero failures.
- Launch Life Distribution platform.
- Select Compare Groups perspective.
- Specify Time as Y variable.
- Specify Censor as Censor variable.
- Set Censor Code to 1.
- Use "group" for grouping.
- Use "freq" for frequency.
Example 21
Summary: Visualizes RTY (Relative Total Yield) as a function of average Cpk and number of processes, utilizing Graph Builder and Slider Box.
Code:
Names Default To Here( 1 );
//interactive way to show impact of Cpk on RTY, based on nProcesses
dt = New Table( "Data", invisible );
dt << New Column( "nProcesses", set formula( Row() ) );
dt << add rows( 100 );
sval = 1.33;
z = 3 * sval;
sql = 1000000 * (1 - Normal Distribution( z - 1.5 ));
dt << New Column( "RTY", set formula( (1 - sql / 1000000) ^ :nProcesses ) );
nw = New Window( "RTY as a Function of average Cpk and Number of Processes",
H List Box(
V List Box(
tb = Text Box( "Average Cpk: " || Char( Round( sval, 2 ) ) ),
sb = Slider Box(
0,
2,
sval,
tb << set text( "Average Cpk: " || Char( Round( sval, 2 ) ) );
z = 3 * sval;
sql = 1000000 * (1 - Normal Distribution( z - 1.5 ));
dt << Rerun Formulas;
)
),
dt << Graph Builder(
Size( 528, 454 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables( X( :nProcesses ), Y( :RTY ) ),
Elements( Line( X, Y, Legend( 13 ) ) ),
SendToReport(
Dispatch(
{},
"nProcesses",
ScaleBox,
{Label Row( {Show Major Grid( 1 ), Show Minor Grid( 1 )} )}
),
Dispatch(
{},
"RTY",
ScaleBox,
{Format( "Percent", 12, 0 ), Min( 0 ), Max( 1 ), Inc( 0.1 ),
Minor Ticks( 1 ), Label Row(
{Show Major Grid( 1 ), Show Minor Grid( 1 )}
)}
)
)
)
)
);
Code Explanation:
- Create new invisible table.
- Add "nProcesses" column.
- Set "nProcesses" formula.
- Add 100 rows.
- Define sval, z, sql.
- Add "RTY" column.
- Set "RTY" formula.
- Create new window.
- Add slider box for Cpk.
- Update graph builder with new data.
Distribution using Fit Life by X
Example 1
Summary: Opens a data table, fits a Lognormal distribution to the response variable 'Time Cycles', and performs nested model tests for location and scale. The analysis is conditioned on the factor variable 'Group' and accounts for censoring.
Code:
// Fit Life by X
// Open data table
dt = Open("data_table.jmp");
// Fit Life by X
Fit Life by X(
Distribution( Lognormal ),
Nested Model Tests(
Location and Scale
),
Y( :Time Cycles ),
X( :Group ),
Censor( :Censor ),
Censor Code( 1 )
);
Code Explanation:
- Open data table.
- Define distribution type.
- Specify nested model tests.
- Set response variable.
- Set factor variable.
- Identify censoring variable.
- Define censor code.
- Execute Fit Life by X analysis.
Example 2
Summary: Performs a Fit Life by X analysis using the Lognormal distribution, conducts nested model tests for location and scale, and sets variables for Time Cycles, Group, and Censor with a code of 1.
Code:
// Fit Life by X
Fit Life by X(
Distribution( Lognormal ),
Nested Model Tests(
Location and Scale
),
Y( :Time Cycles ),
X( :Group ),
Censor( :Censor ),
Censor Code( 1 )
);
Code Explanation:
- Fit Life by X analysis.
- Use Lognormal distribution.
- Perform Nested Model Tests.
- Test Location and Scale.
- Set Y variable: Time Cycles.
- Set X variable: Group.
- Define Censor variable.
- Set Censor Code to 1.
Example 3
Summary: Fits a Lognormal distribution to data in a JMP data table, performing nested model tests for location and scale, and sending the results to a report with a pin annotation.
Code:
dt = Open("data_table.jmp");
dt << Fit Life by X(
Distribution( Lognormal ),
Nested Model Tests( Location and Scale ),
Y( :Time Cycles ),
X( :Group ),
Censor( :Censor ),
Censor Code( 1 ),
SendToReport(
Dispatch( {"Results", "Lognormal Results", "Statistics", "Diagnostics - Location and Scale", "Cox-Snell Residual P-P Plot"},
"Fit Life by X", FrameBox,
Add Pin Annotation(
Seg( Marker Seg( 1 ) ),
Index( 26 ),
Index Row( 26 ),
UniqueID( 1200225770 ),
FoundPt( {199, 623} ),
Origin( {0.395, 0.245} ),
Tag Line( 1 )
)
)
)
);
Code Explanation:
- Open data table;
- Fit life by X using Lognormal distribution.
- Perform nested model tests for location and scale.
- Set Y variable as "Time Cycles".
- Set X variable as "Group".
- Use "Censor" column for censoring data.
- Specify censor code as 1.
- Send report to dispatch.
- Add pin annotation to Cox-Snell residual P-P plot.
- Position annotation at specific coordinates.
Example 4
Summary: Performs a life by X analysis to model the relationship between temperature and hours, utilizing a lognormal distribution with censoring and frequency variables.
Code:
Names Default To Here( 1 );
dt = Open("data_table.jmp");
obj = Fit Life by X(
Y( :Hours ),
X( :Temp ),
Distribution( Lognormal ),
Censor( :Censor ),
Freq( :Weight ),
Relationship( Arrhenius Celsius )
);
Code Explanation:
- Set default names.
- Open data table.
- Fit life by X analysis.
- Specify Y variable.
- Specify X variable.
- Choose distribution.
- Define censoring variable.
- Include frequency variable.
- Set relationship type.
Example 5
Summary: Performs a life by X analysis using lognormal distribution, nested model tests, and censoring to analyze time cycles grouped by categorical variables.
Code:
dt under test = Open("data_table.jmp");
obj = Fit Life by X(
Distribution( Lognormal ),
Nested Model Tests( Location and Scale ),
Y( :Time Cycles ),
X( :Group ),
Censor( :Censor ),
Censor Code( 1 )
);
Code Explanation:
- Open data table;
- Assign data table to variable.
- Fit life by X analysis.
- Use lognormal distribution.
- Include nested model tests.
- Specify Y variable: Time Cycles.
- Specify X variable: Group.
- Identify censor variable.
- Set censor code to 1.
Example 6
Summary: Performs a life by X analysis with Weibull distribution, Arrhenius Celsius relationship, and nested model tests to analyze the impact of temperature on hours, while filtering data based on weight and excluding censored rows.
Code:
dt = Open("data_table.jmp");
obj = Fit Life by X(
Distribution( Weibull ),
Relationship( Arrhenius Celsius ),
Nested Model Tests( Regression ),
Y( :Hours ),
X( :Temp ),
Freq( :Weight ),
<<Fit Weibull,
<<Time Acceleration Baseline( 10 ),
Show Surface Plot( 0 ),
<<Set Scale( Weibull, Simultaneous ),
Confidence Interval Method( Wald ),
);
obj << Local Data Filter(
Location( {0, 0} ),
Add Filter( columns( :Hours ), Where( :Hours >= 3000 & :Hours <= 5000 ) ),
Mode( Select( 0 ), Show( 1 ), Include( 1 ) )
);
obj << Automatic Recalc( 0 );
dt << Select Where( :Status == "Censored" );
dt << Exclude();
rpt = obj << Report;
actN = rpt[Outline Box( "Summary of Data" )][Table Box( 1 )] << get as matrix;
Code Explanation:
- Open data table.
- Fit life by X analysis.
- Use Weibull distribution.
- Apply Arrhenius Celsius relationship.
- Perform nested model tests.
- Set Y variable as Hours.
- Set X variable as Temp.
- Use Weight for frequency.
- Fit Weibull model.
- Set time acceleration baseline to 10.
- Disable surface plot display.
- Set scale to Weibull simultaneously.
- Use Wald confidence interval method.
- Add local data filter.
- Filter Hours between 3000 and 5000.
- Set filter mode to select.
- Disable automatic recalculation.
- Select rows where Status is Censored.
- Exclude selected rows.
- Generate report from analysis.
- Extract summary data table as matrix.
Example 7
Summary: Fits a life model with Weibull distribution, Arrhenius relationship, and nested regression tests to analyze data, while filtering hours between 3000 and 5000 and excluding censored status.
Code:
dt = Open("data_table.jmp");
obj = Fit Life by X(
Distribution( Weibull ),
Relationship( Arrhenius Celsius ),
Nested Model Tests( Regression ),
Y( :Hours ),
X( :Temp ),
Freq( :Weight ),
<<Fit Weibull,
<<Time Acceleration Baseline( 10 ),
Show Surface Plot( 0 ),
<<Set Scale( Weibull, Simultaneous ),
Confidence Interval Method( Wald ),
);
obj << Local Data Filter(
Location( {0, 0} ),
Add Filter( columns( :Hours ), Where( :Hours >= 3000 & :Hours <= 5000 ) ),
Mode( Select( 0 ), Show( 1 ), Include( 1 ) )
);
dt << Select Where( :Status == "Censored" );
dt << Exclude();
rpt = obj << Report;
actN = rpt[Outline Box( "Summary of Data" )][Table Box( 1 )] << get as matrix;
Close( dt, NoSave );
dt = Open("data_table.jmp");
obj = Fit Life by X(
Distribution( Weibull ),
Relationship( Arrhenius Celsius ),
Nested Model Tests( Regression ),
Y( :Hours ),
X( :Temp ),
Freq( :Weight ),
<<Fit Weibull,
<<Time Acceleration Baseline( 10 ),
Show Surface Plot( 0 ),
<<Set Scale( Weibull, Simultaneous ),
Confidence Interval Method( Wald ),
);
obj << Local Data Filter(
Location( {0, 0} ),
Add Filter( columns( :Hours ), Where( :Hours >= 3000 & :Hours <= 5000 ) ),
Mode( Select( 0 ), Show( 1 ), Include( 1 ) )
);
obj << Automatic Recalc( 0 );
dt << Select Where( :Status == "Censored" );
dt << Exclude();
rpt = obj << Report;
actN = rpt[Outline Box( "Summary of Data" )][Table Box( 1 )] << get as matrix;
Code Explanation:
- Open table.
- Fit life model.
- Set distribution to Weibull.
- Use Arrhenius relationship.
- Apply nested regression tests.
- Define Y variable.
- Define X variable.
- Set frequency variable.
- Fit Weibull distribution.
- Set time acceleration baseline.
- Disable surface plot.
- Set scale to simultaneous.
- Use Wald confidence intervals.
- Add local data filter.
- Filter hours between 3000 and 5000.
- Select censored status.
- Exclude selected rows.
- Generate report.
- Extract summary data.
- Close table without saving.
- Reopen table.
- Repeat fit life model.
- Repeat adding local data filter.
- Disable automatic recalculation.
- Repeat selecting censored status.
- Repeat excluding selected rows.
- Repeat generating report.
- Repeat extracting summary data.
Example 8
Summary: Fits a life model to analyze the relationship between temperature and hours, utilizing a Lognormal distribution with censoring and frequency considerations.
Code:
dt = Open("data_table.jmp");
obj = Fit Life by X(
Y( :Hours ),
X( :Temp ),
Distribution( Lognormal ),
Censor( :Censor ),
Freq( :Weight ),
Relationship( Arrhenius Celsius )
);
obj << Save Journal( "$temp/jrn1.jrn" );
Code Explanation:
- Open table.
- Fit life model.
- Set Y variable.
- Set X variable.
- Choose distribution.
- Specify censoring.
- Define frequency.
- Select relationship.
- Save journal.
Example 9
Summary: Fits a life by X model with Arrhenius relationship, nested model tests, and Weibull distribution to analyze survival data, including censoring and frequency variables.
Code:
dt = Open("data_table.jmp");
obj1 = dt << Fit Life by X(
Relationship( Arrhenius Celsius ),
Nested Model Tests( Regression ),
Distribution( "Weibull" ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight )
);
rpt1 = obj1 << report;
ob1Txt1 = Trim( Words( rpt1[Outline Box( "Statistics" )][Outline Box( 8 )] << get title, "-" )[2] );
ob1Txt2 = Trim( Words( rpt1[Outline Box( "Statistics" )][Outline Box( 13 )] << get title, "-" )[2] );
ob1Txt3 = Trim( Words( rpt1[Outline Box( "Statistics" )][Outline Box( 18 )] << get title, "-" )[2] );
dt << Select Rows( 1 );
dt << Exclude;
obj2 = dt << Fit Model(
Censor( :Censor ),
Censor Code( "1" ),
Freq( :Weight ),
Y( :Hours ),
Effects( :x ),
Personality( "Parametric Survival" ),
Distribution( "Weibull" ),
Run( Likelihood Ratio Tests( 1 ), Distribution Plot by Level Combinations( 1 ) )
);
rpt2 = obj2 << report;
ob2Txt1 = rpt2[Outline Box( "Distribution Plot by Level Combinations" )][Outline Box( ob1Txt1 )] << get title;
ob2Txt2 = rpt2[Outline Box( "Distribution Plot by Level Combinations" )][Outline Box( ob1Txt2 )] << get title;
ob2Txt3 = rpt2[Outline Box( "Distribution Plot by Level Combinations" )][Outline Box( ob1Txt3 )] << get title;
Code Explanation:
- Open data table.
- Fit life by X model.
- Specify Arrhenius relationship.
- Use nested model tests.
- Set Weibull distribution.
- Define Y variable (Hours).
- Define X variable (Temp).
- Set censor variable (Censor).
- Set censor code to 1.
- Include frequency variable (Weight).
Example 10
Summary: Fits life by X models using SEV and LEV distributions, with Arrhenius Celsius relationship, to estimate hazard rates and generate reports.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Life by X(
Distribution( SEV ),
Relationship( Arrhenius Celsius ),
Y( :Hours ),
X( :Temperature ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Freq ),
<<Fit SEV,
<<Time Acceleration Baseline( 85 ),
<<Fit LEV,
Show Surface Plot( 0 ),
Confidence Interval Method( Wald )
);
rpt = obj << report;
obj[{"Comparisons", "Hazard Profiler"}] << Confidence Intervals( 0 );
obj[{"Comparisons", "Hazard Profiler"}] << Link Profilers( 1 );
est_SEV = Num( rpt[Outline Box( "Comparisons" )][Outline Box( "Hazard Profiler" )][Picture Box( 1 )][Text Box( 2 )] << get text );
est_LEV = Num( rpt[Outline Box( "Comparisons" )][Outline Box( "Hazard Profiler" )][Picture Box( 1 )][Text Box( 4 )] << get text );
obj[{"Results", "SEV Results", "Statistics"}] << Save Hazard Estimates;
obj[{"Results", "LEV Results", "Statistics"}] << Save Hazard Estimates;
obj2 = dt << Profiler(
Y( :SEV Hazard, :LEV Hazard ),
Profiler( 1, Term Value( :Hours( 750.5, Lock( 0 ), Show( 1 ) ), :Temperature( 105, Lock( 0 ), Show( 1 ) ) ) )
);
rpt2 = obj2 << report;
est2_SEV = Num( rpt2[Outline Box( "Prediction Profiler" )][Picture Box( 1 )][Text Box( 2 )] << get text );
est2_LEV = Num( rpt2[Outline Box( "Prediction Profiler" )][Picture Box( 1 )][Text Box( 4 )] << get text );
Code Explanation:
- Open data table.
- Fit life by X using SEV distribution.
- Set relationship to Arrhenius Celsius.
- Define Y as Hours.
- Define X as Temperature.
- Specify censor variable.
- Set censor code to 1.
- Use frequency variable.
- Fit SEV model.
- Set time acceleration baseline to 85.
- Fit LEV model.
- Hide surface plot.
- Use Wald confidence interval method.
- Retrieve report.
- Disable confidence intervals for hazard profiler.
- Link profilers.
- Extract SEV estimate from report.
- Extract LEV estimate from report.
- Save SEV hazard estimates.
- Save LEV hazard estimates.
- Create profiler for SEV and LEV hazards.
- Retrieve profiler report.
- Extract SEV estimate from profiler report.
- Extract LEV estimate from profiler report.
Example 11
Summary: Fits a Loglogistic distribution to data using an Arrhenius Celsius relationship, with nested model tests and censoring.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Life by X(
Distribution( Loglogistic ),
Relationship( Arrhenius Celsius ),
Nested Model Tests( Regression ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
<<Fit Loglogistic,
<<Set Scriptables(
{Bayesian Estimates(
Loglogistic,
Model(
Quantile and Parameter Priors,
Quantile( Uniform, Probability( 0.1 ), X( 10 ), Low( 0.0237161461352981 ), High( 3259967098576.83 ) ),
Beta1( Uniform, Low( 0.414474353906951 ), High( 0.841231556060738 ) ),
Shape or Scale( Uniform, Low( 0.3 ), High( 1.31949891980623 ) ),
Number of Monte Carlo Iterations( 5000 ),
Seed( 1 )
)
)}
)
);
Code Explanation:
- Open data table;
- Fit life by X.
- Set distribution to Loglogistic.
- Use Arrhenius Celsius relationship.
- Perform nested model tests.
- Specify Y variable.
- Specify X variable.
- Define censor variable.
- Set censor code.
- Include frequency variable.
Example 12
Summary: Fits a life by X model with Lognormal distribution and Logit relationship to analyze Hours data, transforming Temp variable and incorporating censoring and frequency information.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Life by X(
Distribution( Lognormal ),
Relationship( Logit ),
Y( :Hours ),
X( Transform Column( "Transform[Temp]", Formula( :Temp / 100 ) ) ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
<<Fit Lognormal
);
obj << Confidence Level( 0.99 );
rpt = obj << report;
Code Explanation:
- Open data table.
- Fit life by X model.
- Use Lognormal distribution.
- Apply Logit relationship.
- Set Y variable: Hours.
- Transform X variable: Temp.
- Define censor variable: Censor.
- Set censor code: 1.
- Include frequency: Weight.
- Fit Lognormal model.
- Set confidence level: 0.99.
- Generate report.
Example 13
Summary: Performs a life by X analysis using the Lognormal distribution and Arrhenius Celsius relationship, with censoring and frequency considerations, to generate a report.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Life by X(
Distribution( Lognormal ),
Relationship( Arrhenius Celsius ),
Y( :HoursL, :HoursU ),
X( :DegreesC ),
Censor( :Status ),
Censor Code( "Right" ),
Freq( :Count ),
<<Fit Lognormal,
<<Set Scriptables(
{Bayesian Estimates(
Lognormal,
Model(
Quantile and Parameter Priors,
Quantile( lognormal, Probability( 0.2 ), X( 250 ), Low( 450 ), High( 10800 ) ),
Beta1( lognormal, Low( 0.175 ), High( 4 ) ),
Shape or Scale( lognormal, Low( 0.1 ), High( 2.6 ) ),
Number of Monte Carlo Iterations( 2000 ),
Seed( 137031724 )
)
)}
)
);
rpt = obj << report;
Code Explanation:
- Open data table.
- Fit life by X analysis.
- Use Lognormal distribution.
- Apply Arrhenius Celsius relationship.
- Set Y variables: HoursL, HoursU.
- Set X variable: DegreesC.
- Define censor variable: Status.
- Specify censor code: Right.
- Use Count as frequency.
- Generate report.
Example 14
Summary: Performs a life by X analysis using an exponential distribution, Arrhenius Celsius relationship, and nested model tests to estimate parameters and generate a report.
Code:
dt = Open("data_table.jmp");
flbx = dt << Fit Life by X(
Distribution( Exponential ),
Relationship( Arrhenius Celsius ),
Nested Model Tests( Regression ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
<<Fit Exponential,
<<Time Acceleration Baseline( 10 ),
Show Surface Plot( 1 ),
<<Set Scale( Exponential, Simultaneous ),
Confidence Interval Method( Wald )
);
rpt = Report( flbx );
sel = (rpt[Radio Box( 1 )] << get items)[rpt[Radio Box( 1 )] << get];
expvals = [-19.3808944087009 3.37679069173294 -25.9992825478276 -12.7625062695743,
0.815147487065611 0.0972686759815388 0.624504385317899 1.00579058881332];
actvals = (rpt[Outline Box( "Estimates" )][Table Box( 1 )] << get as matrix);
Code Explanation:
- Open data table.
- Fit life by X analysis.
- Use exponential distribution.
- Apply Arrhenius Celsius relationship.
- Perform nested model tests.
- Set Y variable: Hours.
- Set X variable: Temp.
- Define censor variable: Censor.
- Set censor code to 1.
- Use frequency variable: Weight.
Example 15
Summary: Fits a life model using X to analyze the relationship between Hours and Temp, with Lognormal distribution, censoring, and frequency considerations.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Life by X(
Y( :Hours ),
X( :Temp ),
Distribution( Lognormal ),
Censor( :Censor ),
Freq( :Weight ),
Relationship( Arrhenius Celsius )
);
obj << Transposed Axes( 1 );
script = obj << get script;
Code Explanation:
- Open data table.
- Fit life model using X.
- Specify Y variable: Hours.
- Specify X variable: Temp.
- Choose Lognormal distribution.
- Define censor variable: Censor.
- Use frequency variable: Weight.
- Set relationship: Arrhenius Celsius.
- Enable transposed axes.
- Retrieve script from object.
Example 16
Summary: Runs a Weibull life by X analysis to estimate quantile and probability distributions based on temperature data, utilizing nested model tests and Arrhenius Celsius relationship.
Code:
dt = Open("data_table.jmp");
flbx = dt << Fit Life by X(
Distribution( Weibull ),
Relationship( Arrhenius Celsius ),
Nested Model Tests( Regression ),
Y( :Hours ),
X( :Temperature ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Freq ),
<<Fit Weibull,
<<Time Acceleration Baseline( 85 ),
Show Surface Plot( 1 ),
<<Set Scale( Weibull, Simultaneous ),
<<Set Scriptables(
{Weibull Estimate Quantile( Wald, {0.85, 0.85, .75}, {85, 100, 85} ), Weibull Estimate Probability(
Wald,
{250, 500, 500},
{85, 85}
)}
)
);
eq = Report( flbx )["Weibull Results"]["Estimate Quantile"];
ep = Report( flbx )["Weibull Results"]["Estimate Probability"];
Code Explanation:
- Open table.
- Fit Life by X analysis.
- Set distribution to Weibull.
- Use Arrhenius Celsius relationship.
- Apply nested model tests.
- Specify Y variable: Hours.
- Specify X variable: Temperature.
- Define censor variable: Censor.
- Set censor code to 1.
- Use frequency variable: Freq.
Example 17
Summary: Fits life by X models with Arrhenius and Exponential distributions, generating probability estimates and quantile estimates for a given data table.
Code:
dt = Open("data_table.jmp");
flbx = dt << Fit Life by X(
Relationship( Arrhenius Celsius ),
Distribution( Lognormal ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Freq( :Weight ),
<<Set Scriptables( {Distribution Comparisons( Profiler( 1, Term Value( Temp( 80 ), Hours( 5000 ) ) ) )} )
);
(Report( flbx )["Statistics"] << Get Scriptable Object) << Save Probability Estimates;
l95 = (dt:"Lognormal Failure Probability Lower 95%" << get values)[N Rows( dt )];
u95 = (dt:"Lognormal Failure Probability Upper 95%" << get values)[N Rows( dt )];
profiler values = [0.790108, 0.975122];
flbx << close window;
fx = dt << Fit Life by X(
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Freq( :Weight ),
Distribution( Exponential ),
Relationship( Arrhenius Celsius )
);
ob = Report( fx )["Statistics"] << Get Scriptable Object;
ob << Save Probability Estimates;
ob << Save Quantile Estimates;
row37 = (dt << get as matrix)[N Rows( dt ), 0];
Code Explanation:
- Open data table.
- Fit life by X with Arrhenius relationship.
- Use Lognormal distribution.
- Set Y variable to Hours.
- Set X variable to Temp.
- Specify censoring variable.
- Include frequency weights.
- Configure profiler settings.
- Save probability estimates.
- Retrieve lower and upper 95% failure probabilities.
- Define profiler values.
- Close first Fit Life by X window.
- Fit life by X with Exponential distribution.
- Save probability estimates.
- Save quantile estimates.
- Retrieve last row of data table.
Example 18
Summary: Runs the Fit Life by X analysis with specific settings, including confidence interval method and nested model tests, while also looping through open windows to find the relevant window title.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Life by X();
For( i = N Items( Window() ), i >= 1, i--,
lnchWin = (Window()[i]);
winTtl = lnchWin << get window title;
If( winTtl == "Fit Life by X",
confIntMeth = lnchWin[Combo Box( 3 )] << get text;
Break();
);
);
Set Preferences( Fit Life by X( Confidence Interval Method( "Wald", <<Off ) ) );
Close( dt, No Save );
_mat = [0 1 0.9 3,
0.5 . 0.9 222,
1 10 0.9 5,
5.5 . 0.9 511,
10 . 0.9 277,
10 50 0.9 9,
30 . 0.9 399,
50 . 0.9 3111,
0 0.08333333 1.15 40,
0.04166667 . 1.15 322,
0.08333333 1 1.15 37,
0.54166667 . 1.15 217,
1 10 1.15 35,
5.5 . 1.15 777,
10 . 1.15 3069];
dt = As Table( _mat, <<Column Names( {"Start", "Stop", "Voltage", "N Rows"} ) );
obj = dt << Fit Life by X(
Distribution( Lognormal ),
Relationship( Location and Scale ),
Nested Model Tests( Separate Location and Scale ),
Y( :Start, :Stop ),
X( :Voltage ),
Freq( :N Rows ),
Maximum Iterations( 1500 ),
<<Fit Lognormal,
<<Time Acceleration Baseline( 0.9 ),
Use Transformation Scale( 0 ),
Show Overlay by Levels( 1 ),
<<Set Scale( Lognormal, Simultaneous ),
Confidence Interval Method( Likelihood )
);
rpt = obj << report;
Code Explanation:
- Open data table.
- Fit life by X analysis.
- Loop through open windows.
- Find "Fit Life by X" window.
- Get confidence interval method.
- Set platform preferences.
- Close data table.
- Create new matrix.
- Convert matrix to table.
- Fit life by X with specific settings.
Example 19
Summary: Performs a life by X analysis using the Arrhenius Celsius relationship, Weibull distribution, and Bayesian estimates to model the relationship between temperature (Temp) and hours (Hours), with censoring and frequency considerations.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Life by X(
Relationship( Arrhenius Celsius ),
Distribution( Weibull ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
<<Set Scriptables(
{Bayesian Estimates(
Weibull,
Model(
Quantile and Parameter Priors,
Quantile( Normal, Probability( 0.5 ), X( 10 ), Low( 16391.21 ), High( 250892.21 ) ),
Beta1( Normal, Low( 0.38 ), High( 0.886 ) ),
Shape or Scale( Normal, Low( 1.02 ), High( 2.26 ) ),
Number of Monte Carlo Iterations( 5000 ),
Seed( 1568426397 )
)
)}
)
);
Code Explanation:
- Open data table.
- Fit life by X analysis.
- Use Arrhenius Celsius relationship.
- Select Weibull distribution.
- Set Y variable as Hours.
- Set X variable as Temp.
- Define censor variable as Censor.
- Set censor code as 1.
- Use Weight as frequency.
- Configure Bayesian estimates script.
Example 20
Summary: Process of performing Fit Life by X analysis with Arrhenius Celsius relationship, Lognormal distribution, and nonparametric overlay scale configuration.
Code:
dt = Open("data_table.jmp");
plat = dt << Fit Life by X(
Relationship( Arrhenius Celsius ),
Distribution( Lognormal ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight )
);
rep = Report( plat );
rep["Scatterplot"][AxisBox( 1 )] << Scale( "Linear" );
rep["Scatterplot"][AxisBox( 1 )] << Min( 200 );
rep["Scatterplot"][AxisBox( 1 )] << Max( 7000 );
rep["Scatterplot"][AxisBox( 1 )] << Reshow;
axisscale = Arg( (rep["Scatterplot"][AxisBox( 1 )] << GetScript)[1] );
rep["Scatterplot"][AxisBox( 2 )] << Scale( "Log" );
rep["Scatterplot"][AxisBox( 2 )] << Reshow;
axisscale = Arg( (rep["Scatterplot"][AxisBox( 2 )] << GetScript)[1] );
Close( dt, No Save );
dt = New Table( "Test",
New Column( "X", Values( [1, 1, 1, 1, 2, 2, 2, 2] ) ),
New Column( "Cause", Values( [1, 1, 1, 1, 2, 2, 2, 2] ) ),
New Column( "Y", Values( [1, 2, 3, 4, 5, 6, 7, 8] ) )
);
obj = dt << Fit Life by X(
Relationship( Linear ),
Nested Model Tests( Regression ),
Distribution( Lognormal ),
Y( :Y ),
X( :X ),
<<Fit Lognormal,
<<Set Scale( Lognormal ),
SendToReport( Dispatch( {"Nonparametric Overlay"}, "2", ScaleBox, {Min( 0.1 ), Max( 0.9 ), Show Major Grid( 1 )} ) )
);
rpt = obj << report;
Code Explanation:
- Open data table.
- Perform Fit Life by X analysis.
- Set relationship to Arrhenius Celsius.
- Choose Lognormal distribution.
- Define Y variable as Hours.
- Define X variable as Temp.
- Specify censor variable as Censor.
- Set censor code to 1.
- Apply frequency weights from Weight column.
- Close original data table without saving.
- Create new test data table.
- Add X, Cause, and Y columns with specified values.
- Perform another Fit Life by X analysis.
- Set relationship to Linear.
- Enable nested model tests for regression.
- Choose Lognormal distribution again.
- Define Y variable as Y.
- Define X variable as X.
- Fit Lognormal model.
- Set scale to Lognormal.
- Configure nonparametric overlay scale.
- Retrieve report object.
Example 21
Summary: Fits a life by X model to analyze the relationship between temperature and hours, with censoring and frequency considerations, and configures scatterplot axis scales for visualization.
Code:
dt = Open("data_table.jmp");
plat = dt << Fit Life by X(
Relationship( Arrhenius Celsius ),
Distribution( Lognormal ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight )
);
rep = Report( plat );
rep["Scatterplot"][AxisBox( 1 )] << Scale( "Linear" );
rep["Scatterplot"][AxisBox( 1 )] << Min( 200 );
rep["Scatterplot"][AxisBox( 1 )] << Max( 7000 );
rep["Scatterplot"][AxisBox( 1 )] << Reshow;
axisscale = Arg( (rep["Scatterplot"][AxisBox( 1 )] << GetScript)[1] );
rep["Scatterplot"][AxisBox( 2 )] << Scale( "Log" );
rep["Scatterplot"][AxisBox( 2 )] << Reshow;
axisscale = Arg( (rep["Scatterplot"][AxisBox( 2 )] << GetScript)[1] );
Code Explanation:
- Open data table.
- Fit life by X model.
- Set relationship to Arrhenius Celsius.
- Use Lognormal distribution.
- Specify Y variable: Hours.
- Specify X variable: Temp.
- Define censor variable: Censor.
- Set censor code to 1.
- Include frequency variable: Weight.
- Adjust scatterplot axis scales.
Example 22
Summary: Performs a life by X analysis to fit multiple distributions (Lognormal, Loglogistic, Weibull, Frechet) to the Hours response variable with Temp as the predictor and Censor as the censoring variable.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Life by X(
Relationship( Arrhenius Celsius ),
Distribution( Lognormal ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
<<Fit Lognormal,
<<Fit LogLogistic,
<<Fit Weibull,
<<Fit Frechet,
<<Time Acceleration Baseline( 10 ),
Tabbed Individual Report( 1 )
);
rpt = obj << report;
expect AICc = [649.554624366609, 650.32868499206, 653.386488878794, 653.715830313484];
expect model = {"Lognormal", "Loglogistic", "Weibull", "Frechet"};
Code Explanation:
- Open data table.
- Fit life by X analysis.
- Set relationship to Arrhenius Celsius.
- Use Lognormal distribution.
- Specify Y variable: Hours.
- Specify X variable: Temp.
- Define censor variable: Censor.
- Set censor code to 1.
- Include frequency variable: Weight.
- Fit multiple distributions: Lognormal, LogLogistic, Weibull, Frechet.
Example 23
Summary: Fits multiple distributions to a life data table, utilizing the Fit Life by X platform in JMP.
Code:
dt = Open("data_table.jmp");
model = dt << Fit Life by X(
Relationship( Arrhenius Celsius ),
Distribution( Lognormal ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
<<Fit Lognormal,
<<Fit Weibull,
<<Fit Loglogistic,
<<Fit Frechet,
<<Time Acceleration Baseline( 10 ),
Tabbed Individual Report( 1 ),
Show Surface Plot( 1 )
);
results = model << get results;
namelist0 = {"Weibull", "Lognormal", "Loglogistic", "Frechet"};
Code Explanation:
- Open table.
- Fit life by X.
- Set relationship.
- Choose distribution.
- Define Y variable.
- Define X variable.
- Define censor variable.
- Set censor code.
- Define frequency variable.
- Fit multiple distributions.
Example 24
Summary: Performs a life by X analysis with Weibull distribution to estimate loss, utilizing the Fit Life by X platform in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Life by X(
Relationship( No Effect ),
Distribution( Weibull ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
);
dt << New Column( "lossformula",
Formula(
Parameter(
{mu = 10, sigma = 0.9},
zz = (Log( :Hours ) - mu) / sigma;
:weight * If( :Censor == 1,
Exp( zz ),
Log( sigma ) + Log( :Hours ) + Exp( zz ) - zz
);
)
)
);
Code Explanation:
- Open data table.
- Fit life by X analysis.
- Set relationship to no effect.
- Use Weibull distribution.
- Specify Y variable: Hours.
- Specify X variable: Temp.
- Define censor variable: Censor.
- Set censor code to 1.
- Use frequency variable: Weight.
- Create new column: lossformula.
Example 25
Summary: Fits a life model using X to analyze the relationship between Hours and Temp, with censoring and frequency considerations, and generates a new column for loss formula calculation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Life by X(
Relationship( Location and Scale ),
Distribution( Lognormal ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
);
dt << New Column( "lossformula",
Formula(
Parameter(
{mu0 = 10, sigma0 = 1, mu1 = 8, sigma1 = 1, mu2 = 7, sigma2 = 0.8},
mu = Match( :Temp, 40, mu0, 60, mu1, 80, mu2, . );
sigma = Match( :Temp, 40, sigma0, 60, sigma1, 80, sigma2, . );
zz = (Log( :Hours ) - mu) / sigma;
:weight * If( :Censor == 1,
-Log( 1 - Normal Distribution( zz ) ),
Log( sigma ) + Log( :Hours ) + (zz ^ 2) / 2 + 0.5 * Log( 2 * Pi() )
);
)
)
);
Code Explanation:
- Open data table.
- Fit life model using X.
- Specify location and scale relationship.
- Choose lognormal distribution.
- Set Y variable as Hours.
- Set X variable as Temp.
- Define censoring variable.
- Set censor code to 1.
- Use frequency variable Weight.
- Create new column for loss formula.
Example 26
Summary: Fits a life model using logistic distribution to predict Hours based on Temp, with censoring and frequency weights, and generates a new column for loss formula calculation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Life by X(
Relationship( Linear ),
Distribution( Logistic ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
);
dt << New Column( "lossformula",
Formula(
Parameter(
{b0 = 14010, b1 = -156, sigma = 1234},
mu = b0 + b1 * :Temp;
zz = (:Hours - mu) / sigma;
:weight * If( :Censor == 1,
Log( 1 + Exp( zz ) ),
Log( sigma ) - zz + 2 * Log( 1 + Exp( zz ) )
);
)
)
);
Code Explanation:
- Open data table.
- Fit life model using X.
- Specify linear relationship.
- Use logistic distribution.
- Set Y variable as Hours.
- Set X variable as Temp.
- Define censor variable.
- Set censor code to 1.
- Include frequency weight.
- Create new column for loss formula.
Example 27
Summary: Performs a life by X analysis to estimate the Frechet distribution of Hours based on Temp, with censoring and weighting considerations.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Life by X(
Relationship( Location ),
Distribution( Frechet ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
);
dt << New Column( "lossformula",
Formula(
Parameter(
{mu0 = 10, mu1 = 8, mu2 = 7, sigma = 1},
mu = Match( :Temp, 40, mu0, 60, mu1, 80, mu2, . );
zz = -(Log( :Hours ) - mu) / sigma;
:weight * If( :Censor == 1,
-Log( 1 - Exp( -Exp( zz ) ) ),
Log( sigma ) + Log( :Hours ) + Exp( zz ) - zz
);
)
)
);
Code Explanation:
- Open data table.
- Fit life by X analysis.
- Set relationship to location.
- Choose Frechet distribution.
- Specify Y variable: Hours.
- Specify X variable: Temp.
- Define censor variable: Censor.
- Set censor code to 1.
- Use frequency variable: Weight.
- Create new column "lossformula".
- Define formula with parameters.
- Match Temp to corresponding mu values.
- Calculate zz value.
- Apply loss formula based on censor status.
Example 28
Summary: Fits a life distribution model using reciprocal relationship, SEV distribution, and censoring to estimate loss formula with parameters.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Life by X(
Relationship( Reciprocal ),
Distribution( SEV ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
);
dt << New Column( "lossformula",
Formula(
Parameter(
{b0 = -4182, b1 = 549171, sigma = 1864},
mu = b0 + (b1 / :Temp);
zz = (:Hours - mu) / sigma;
:weight * If( :Censor == 1,
Exp( zz ),
Log( sigma ) - zz + Exp( zz )
);
)
)
);
Code Explanation:
- Open data_table data
- Fit life by X using reciprocal relationship.
- Specify SEV distribution.
- Set Y variable as Hours.
- Set X variable as Temp.
- Define censoring with Censor column.
- Set censor code to 1.
- Use Weight as frequency.
- Create new column "lossformula".
- Define formula with parameters and conditions.
Example 29
Summary: Fits an Arrhenius model to a dataset, incorporating censoring and frequency weights, using JMP's Fit Life by X analysis.
Code:
ArrheniusConstant = 1.5;
dt = Open("data_table.jmp");
obj = dt << Fit Life by X(
Relationship( Arrhenius Celsius ),
Distribution( Normal ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
);
dt << New Column( "lossformula",
Formula(
Parameter(
{b0 = -47169, b1 = 1487, sigma = 2358},
mu = b0 + (ArrheniusConstant * b1 / (:Temp + 273.15));
zz = (:Hours - mu) / sigma;
:weight * If( :Censor == 1,
-Log( 1 - Normal Distribution( zz ) ),
Log( sigma ) + (zz ^ 2) / 2 + 0.5 * Log( 2 * Pi() )
);
)
)
);
Code Explanation:
- Define ArrheniusConstant.
- Open data table.
- Fit life by X analysis.
- Specify Arrhenius relationship.
- Use normal distribution.
- Set Y variable as Hours.
- Set X variable as Temp.
- Define censoring with Censor variable.
- Set censor code to 1.
- Include frequency weights.
Example 30
Summary: Fits a life by X model with square root relationship, logistic distribution, and censoring to analyze the relationship between Hours and Temp in a data table.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Life by X(
Relationship( Square Root ),
Distribution( Logistic ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
);
dt << New Column( "lossformula",
Formula(
Parameter(
{b0 = 22930, b1 = -2385, sigma = 1260},
mu = b0 + b1 * Sqrt( :Temp );
zz = (:Hours - mu) / sigma;
:weight * If( :Censor == 1,
Log( 1 + Exp( zz ) ),
Log( sigma ) - zz + 2 * Log( 1 + Exp( zz ) )
);
)
)
);
Code Explanation:
- Open data table.
- Fit life by X model.
- Use square root relationship.
- Assume logistic distribution.
- Set Hours as response variable.
- Set Temp as predictor variable.
- Identify censored data.
- Define censor code as 1.
- Include frequency weights.
- Create new column for loss formula.
Example 31
Summary: Runs a life table analysis to estimate loss using the LEV distribution and log relationship, incorporating censoring and frequency weights.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Life by X(
Relationship( Log ),
Distribution( LEV ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
);
dt << New Column( "lossformula",
Formula(
Parameter(
{b0 = 37293, b1 = -8178, sigma = 2972},
mu = b0 + b1 * Log( :Temp );
zz = (:Hours - mu) / sigma;
:weight * If( :Censor == 1,
-Log( 1 - Exp( -Exp( -zz ) ) ),
Log( sigma ) + zz + Exp( -zz )
);
)
)
);
Code Explanation:
- Open data table.
- Fit life by X analysis.
- Use log relationship.
- Use LEV distribution.
- Set Y variable.
- Set X variable.
- Define censoring.
- Set censor code.
- Include frequency weights.
- Create new column.
- Define formula for loss.
- Set parameters in formula.
- Calculate mean.
- Calculate z-score.
- Apply conditional logic based on censoring.
- Multiply by weight.
Example 32
Summary: Fits a life distribution model to data, utilizing a Box-Cox transformation and exponential distribution.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Life by X(
Relationship( Name( "Box-Cox" )(-0.5) ),
Distribution( Exponential ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
);
dt << New Column( "lossformula",
Formula(
Parameter(
{b0 = 72, b1 = -36},
lambda = -0.5;
mu = b0 + b1 * (:Temp ^ (lambda) - 1) / (lambda);
zz = (Log( :Hours ) - mu);
:weight * If(
:Censor == 1, Exp( zz ),
-zz + Exp( zz ) + Log( :Hours ),
);
)
)
);
Code Explanation:
- Open table.
- Fit life by X.
- Use Box-Cox relationship.
- Set distribution to exponential.
- Define Y variable as Hours.
- Define X variable as Temp.
- Specify censor variable.
- Set censor code to 1.
- Include frequency variable.
- Create new column for loss formula.
Example 33
Summary: Fits a life model by temperature (Temp) to predict hours worked, incorporating censoring and frequency weights, and generates a new column for loss calculation.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Life by X(
Distribution( Lognormal ),
Relationship( Custom, "1, log( :Temp ), ( log( :Temp ) ) ^ 2", "1, log( :Temp )", Exponential Link ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
);
dt << New Column( "lossformula",
Formula(
Parameter(
{b0 = 15, b1 = 1, b2 = -0.6, l0 = 1.5, l1 = -0.3},
mu = b0 + b1 * Log( :Temp ) + b2 * (Log( :Temp )) ^ 2;
sigma = Exp( l0 + l1 * Log( :Temp ) );
zz = (Log( :Hours ) - mu) / sigma;
:weight * If( :Censor == 1,
-Log( 1 - Normal Distribution( zz ) ),
Log( sigma ) + Log( :Hours ) + (zz ^ 2) / 2 + 0.5 * Log( 2 * Pi() )
);
)
)
);
Code Explanation:
- Open data table.
- Fit life model by X.
- Use lognormal distribution.
- Define custom relationship formula.
- Specify Y variable as Hours.
- Set X variable as Temp.
- Identify censor column.
- Set censor code to 1.
- Include frequency column.
- Create new column for loss formula.
Example 34
Summary: Performs a life by X analysis with custom relationship and censoring, generating a new column 'lossformula' with calculated values.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Life by X(
Distribution( Loglogistic ),
Relationship( Custom, "1, log( :Temp ), ( log( :Temp ) ) ^ 2", "1, log( :Temp )" ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
);
dt << New Column( "lossformula",
Formula(
Parameter(
{b0 = 15, b1 = 1, b2 = -0.6, l0 = 1.5, l1 = -0.3},
mu = b0 + b1 * Log( :Temp ) + b2 * (Log( :Temp )) ^ 2;
sigma = l0 + l1 * Log( :Temp );
zz = (Log( :Hours ) - mu) / sigma;
:weight * If( :Censor == 1,
Log( 1 + Exp( zz ) ),
Log( sigma ) + Log( :Hours ) - zz + 2 * Log( 1 + Exp( zz ) )
);
)
)
);
Code Explanation:
- Open data table.
- Fit life by X analysis.
- Use Loglogistic distribution.
- Define custom relationship.
- Set Y variable: Hours.
- Set X variable: Temp.
- Specify censor column.
- Set censor code.
- Include frequency column.
- Create new column: lossformula.
- Define formula with parameters.
- Calculate mu using parameters.
- Calculate sigma using parameters.
- Compute zz value.
- Apply conditional logic for censoring.
- Multiply result by weight.
Example 35
Summary: Fits an Arrhenius relationship to model life data, incorporating censoring and frequency variables.
Code:
dt = Open("data_table.jmp");
ArrheniusConstant = 1.2;
obj = dt << Fit Life by X(
Relationship( Arrhenius Fahrenheit ),
Distribution( SEV ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
);
dt << New Column( "lossformula",
Formula(
Parameter(
{b0 = -82850, b1 = 2199, sigma = 1752},
mu = b0 + b1 * ArrheniusConstant * 1.8 / (:Temp + 459.67);
zz = (:Hours - mu) / sigma;
:weight * If( :Censor == 1,
Exp( zz ),
Log( sigma ) - zz + Exp( zz )
);
)
)
);
Code Explanation:
- Open data table.
- Define Arrhenius constant.
- Fit life by X analysis.
- Specify Arrhenius relationship.
- Use SEV distribution.
- Set Y variable as Hours.
- Set X variable as Temp.
- Define censor variable.
- Set censor code.
- Include frequency variable.
Example 36
Summary: Estimates loss formula using Arrhenius model and LEV distribution, incorporating censoring and frequency variables in a JMP data table.
Code:
ArrheniusConstant = 1.2;
dt = Open("data_table.jmp");
obj = dt << Fit Life by X(
Relationship( Arrhenius Kelvin ),
Distribution( LEV ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
);
dt << New Column( "lossformula",
Formula(
Parameter(
{b0 = -3776, b1 = 38, sigma = 2984},
mu = b0 + b1 * ArrheniusConstant / :Temp;
zz = (:Hours - mu) / sigma;
:weight * If( :Censor == 1,
-Log( 1 - Exp( -Exp( -zz ) ) ),
Log( sigma ) + zz + Exp( -zz )
);
)
)
);
Code Explanation:
- Set Arrhenius constant.
- Open data table.
- Fit life by X using Arrhenius model.
- Specify distribution as LEV.
- Set Y variable as Hours.
- Set X variable as Temp.
- Define censor variable.
- Set censor code.
- Use frequency variable.
- Create new column for loss formula.
Example 37
Summary: Runs a life table analysis to estimate loss using the inverse power relationship, Frechet distribution, and censoring data.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Life by X(
Relationship( Inverse Power ),
Distribution( Frechet ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
);
dt << New Column( "lossformula",
Formula(
Parameter(
{b0 = 23, b1 = -3.5, sigma = 1},
mu = b0 + b1 * Log( :Temp );
zz = -(Log( :Hours ) - mu) / sigma;
:weight * If( :Censor == 1,
-Log( 1 - Exp( -Exp( zz ) ) ),
Log( sigma ) + Log( :Hours ) + Exp( zz ) - zz
);
)
)
);
Code Explanation:
- Open data table.
- Fit life by X analysis.
- Set relationship to inverse power.
- Choose Frechet distribution.
- Specify Y variable: Hours.
- Specify X variable: Temp.
- Define censor variable: Censor.
- Set censor code to 1.
- Use frequency variable: Weight.
- Create new column "lossformula".
- Define formula with parameters.
- Calculate mu using b0, b1, and Log(Temp).
- Compute zz based on Log(Hours), mu, and sigma.
- Apply formula for censored and uncensored data.
Example 38
Summary: Calculates a loss formula in JMP, utilizing an Arrhenius constant and fitting life by X analysis with SEV distribution.
Code:
ArrheniusConstant = 1.5;
dt = Open("data_table.jmp");
obj = dt << Fit Life by X(
Relationship( Arrhenius Fahrenheit ),
Distribution( SEV ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
);
dt << New Column( "lossformula",
Formula(
Parameter(
{b0 = -82850, b1 = 2199, sigma = 1752},
mu = b0 + b1 * ArrheniusConstant * 1.8 / (:Temp + 459.67);
zz = (:Hours - mu) / sigma;
:weight * If( :Censor == 1,
Exp( zz ),
Log( sigma ) - zz + Exp( zz )
);
)
)
);
Code Explanation:
- Define ArrheniusConstant.
- Open data table;
- Fit Life by X analysis.
- Set relationship to Arrhenius Fahrenheit.
- Use SEV distribution.
- Set Y variable to Hours.
- Set X variable to Temp.
- Define censor variable as Censor.
- Set censor code to 1.
- Include frequency variable Weight.
- Create new column "lossformula".
- Define formula with parameters b0, b1, sigma.
- Calculate mu using Arrhenius equation.
- Calculate zz using Hours and sigma.
- Apply conditional formula based on Censor status.
Example 39
Summary: Fits an Arrhenius model to a dataset, using the Life by X analysis and specifying the LEV distribution.
Code:
ArrheniusConstant = 1.5;
dt = Open("data_table.jmp");
obj = dt << Fit Life by X(
Relationship( Arrhenius Kelvin ),
Distribution( LEV ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
);
dt << New Column( "lossformula",
Formula(
Parameter(
{b0 = -3776, b1 = 38, sigma = 2984},
mu = b0 + b1 * ArrheniusConstant / :Temp;
zz = (:Hours - mu) / sigma;
:weight * If( :Censor == 1,
-Log( 1 - Exp( -Exp( -zz ) ) ),
Log( sigma ) + zz + Exp( -zz )
);
)
)
);
Code Explanation:
- Set ArrheniusConstant to 1.5.
- Open data table.
- Fit Life by X analysis.
- Use Arrhenius Kelvin relationship.
- Select LEV distribution.
- Set Y variable to Hours.
- Set X variable to Temp.
- Define Censor variable.
- Set Censor Code to 1.
- Use Weight as frequency.
Example 40
Summary: Performs a life by X analysis to model the relationship between Hours and Temp, accounting for censoring and frequency, using Weibull distribution and Arrhenius Celsius relationship.
Code:
dt = Open("data_table.jmp");
obj = Fit Life by X(
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Freq( :Weight ),
Distribution( Weibull ),
Relationship( Arrhenius Celsius )
);
rpt = Report( obj );
Code Explanation:
- Open data table.
- Fit life by X analysis.
- Set Y variable: Hours.
- Set X variable: Temp.
- Define censor variable: Censor.
- Use frequency variable: Weight.
- Choose Weibull distribution.
- Specify Arrhenius Celsius relationship.
- Generate report object.
- Assign report to variable.
Distribution using Reliability Forecast
Example 1
Summary: Generates a reliability forecast by opening a data table, defining production and failure data tables, and specifying forecasting options.
Code:
// Reliability Forecast
// Open data table
dt = Open("data_table.jmp");
// Reliability Forecast
Open("data_table.jmp");
Reliability Forecast(
Input Format( Dates ),
Production Data Table(
Small Production part1,
Production Count(
:Sold Quantity
),
Timestamp( :Sold Month )
),
Failure Data Table(
Small Production part2,
Failure Time( :Return Month ),
Timestamp( :Sold Month ),
Failure Count( :Return Quantity )
),
Life Time Unit( Month ),
Show Legend( 1 ),
Show Graph Filter( 0 ),
Forecast(
Group( "" ),
Risk Set(
[2550, 2600, 2650, 2700, 2750,
2800, 2850]
),
Future Risk Set(
[3082.5, 3052.5, 3367.5,
3952.5, 3667, 3667],
[3347740800, 3350160000,
3352579200, 3355257600,
3357849600, 3360528000]
),
Forecast To( "02/2011" ),
Distribution( Weibull ),
Contract( 6, Month ),
Forecast Type( Sequential ),
Interval Type(
Prediction Interval
),
Set Interval Level( 0.9 )
),
Forecast Options(
Animation( 1 ),
Interactive Configuration of Risk Sets(
1
),
Spreadsheet Configuration of Risk Sets(
0
),
Show Interval( 1 ),
Forecasting Interval Type(
Prediction Interval
),
Use Contract Length( 1 ),
Use Failure Cost( 0 ),
Set Failure Cost( . ),
Monte Carlo Sample Size( 10000 ),
Random Seed( -1 ),
Use Approximate Distribution( 1 )
)
);
Code Explanation:
- Open data table.
- Open data table.
- Initiate reliability forecast.
- Set input format to dates.
- Define production data table.
- Specify sold quantity for production count.
- Set sold month as timestamp.
- Define failure data table.
- Specify return month for failure time.
- Set sold month as timestamp for failure.
Example 2
Summary: Generates a reliability forecast by opening a data table, defining the input format and time to event, including frequency, life time unit, and forecasting start date. It then configures forecast parameters and options.
Code:
// Reliability Forecast
// Open data table
dt = Open("data_table.jmp");
// Reliability Forecast
Reliability Forecast(
Input Format( Time to Event ),
Time to Event(
:"Time (Month)"n, :Time Right
),
Freq( :Freq ),
Life Time Unit( Month ),
Forecast Start(
Informat(
"03/01/2010",
"Locale Date"
)
),
Forecast Start( 3350246400 ),
Life Time Unit( Month ),
Forecast(
Group( "" ),
Forecast To( "09/01/2010" ),
Distribution( Weibull ),
Contract( 5, Month ),
Forecast Type( Incremental ),
Interval Type( No Interval ),
Set Interval Level( 0.9 )
),
Forecast Options(
Animation( 1 ),
Interactive Configuration of Risk Sets(
1
),
Spreadsheet Configuration of Risk Sets(
0
),
Show Interval( 0 ),
Forecasting Interval Type(
Prediction Interval
),
Use Contract Length( 1 ),
Use Failure Cost( 0 ),
Set Failure Cost( [1] ),
Monte Carlo Sample Size( 10000 ),
Random Seed( 0 ),
Use Approximate Distribution( 1 )
),
SendToReport(
Dispatch(
{"Reliability Forecast",
"Forecast"}, "9", ScaleBox,
{Min( 0 ), Max( 1 ),
Inc( 0.2 ), Minor Ticks( 1 )}
)
)
);
Code Explanation:
- Open data table.
- Define reliability forecast.
- Set input format.
- Specify time to event.
- Include frequency.
- Define life time unit.
- Set forecast start date.
- Repeat forecast start setting.
- Configure forecast parameters.
- Adjust forecast options.
Example 3
Summary: Generates a reliability forecast using the Nevada format, with production count, timestamp, and failure counts defined. It also configures legend visibility, disables graph filtering, and enables interval censored failure.
Code:
// Nevada Format
// Open data table
dt = Open("data_table.jmp");
// Nevada Format
Reliability Forecast(
Input Format( Nevada ),
Production Count( :Sold Quantity ),
Timestamp( :Sold Month ),
Failure Count(
:"08/2009"n, :"09/2009"n,
:"10/2009"n, :"11/2009"n,
:"12/2009"n, :"01/2010"n,
:"02/2010"n
),
Life Time Unit( Month ),
Interval Censored Failure( 1 ),
Show Legend( 1 ),
Show Graph Filter( 0 ),
Forecast(
Group( "" ),
Risk Set(
[2550, 2600, 2650, 2700, 2750,
2800, 2850]
),
Future Risk Set(
[3022.5, 3307.5, 3502, 3502,
3502, 3502],
[3347827200, 3350246400,
3352924800, 3355516800,
3358195200, 3360787200]
),
Forecast To( "02/2011" ),
Distribution( Weibull ),
Contract( 12, Month ),
Forecast Type( Sequential ),
Interval Type( No Interval ),
Set Interval Level( 0.9 )
),
Forecast Options(
Animation( 1 ),
Interactive Configuration of Risk Sets(
1
),
Spreadsheet Configuration of Risk Sets(
0
),
Show Interval( 0 ),
Forecasting Interval Type(
Prediction Interval
),
Use Contract Length( 1 ),
Use Failure Cost( 0 ),
Set Failure Cost( . ),
Monte Carlo Sample Size( 10000 ),
Random Seed( -1 ),
Use Approximate Distribution( 1 )
)
);
Code Explanation:
- Open table.
- Set input format.
- Define production count.
- Define timestamp.
- Define failure counts.
- Set life time unit.
- Enable interval censored failure.
- Configure legend visibility.
- Disable graph filter.
- Perform reliability forecast.
Example 4
Summary: Generates a reliability forecast by defining parameters, specifying production count and timestamp columns, listing failure counts by month, setting life time unit to months, configuring forecast settings, and defining risk set values.
Code:
// Reliability Forecast
// Open data table
dt = Open("data_table.jmp");
// Reliability Forecast
Reliability Forecast(
Input Format( Nevada ),
Production Count( :Volume ),
Timestamp( :Time ),
Failure Count(
:"08/2000"n, :"09/2000"n,
:"10/2000"n, :"11/2000"n,
:"12/2000"n, :"01/2001"n,
:"02/2001"n, :"03/2001"n,
:"04/2001"n, :"05/2001"n,
:"06/2001"n, :"07/2001"n,
:"08/2001"n, :"09/2001"n,
:"10/2001"n, :"11/2001"n,
:"12/2001"n, :"01/2002"n,
:"02/2002"n, :"03/2002"n,
:"04/2002"n, :"05/2002"n,
:"06/2002"n, :"07/2002"n,
:"08/2002"n, :"09/2002"n,
:"10/2002"n, :"11/2002"n,
:"12/2002"n, :"01/2003"n,
:"02/2003"n, :"03/2003"n,
:"04/2003"n, :"05/2003"n,
:"06/2003"n, :"07/2003"n
),
Life Time Unit( Month ),
Forecast(
Group( "" ),
Risk Set(
[1991, 2000, 1999, 2024, 1959,
1958, 2000, 2001, 1986, 1966,
1983, 2011, 2026, 1950, 1989,
1963, 1954, 2030, 1981, 2006,
1991, 1950, 2025, 1996, 1987,
1957, 1988, 1966, 2038, 2014,
1962, 1965, 1952, 2045, 2018,
2036]
),
Forecast To( "01/2004" ),
Distribution( Weibull ),
Contract( 5, Month ),
Forecast Type( Sequential ),
Interval Type( No Interval ),
Set Interval Level( 0.9 )
)
);
Code Explanation:
- Open data table.
- Define reliability forecast parameters.
- Set input format to Nevada.
- Specify production count column.
- Define timestamp column.
- List failure counts by month.
- Set life time unit to month.
- Configure forecast settings.
- Define risk set values.
- Set forecast end date.
Example 5
Summary: Runs reliability forecast analysis using the Reliability Forecast platform in JMP, configuring input format, production count, timestamp, and failure count columns.
Code:
Open("data_table.jmp");
rf = Reliability Forecast(
Input Format( Nevada ),
Production Count( :Volume ),
Timestamp( :Time ),
Failure Count(
:Name( "08/2000" ), :Name( "09/2000" ), :Name( "10/2000" ), :Name( "11/2000" ), :Name( "12/2000" ), :Name( "01/2001" ),
:Name( "02/2001" ), :Name( "03/2001" ), :Name( "04/2001" ), :Name( "05/2001" ), :Name( "06/2001" ), :Name( "07/2001" ),
:Name( "08/2001" ), :Name( "09/2001" ), :Name( "10/2001" ), :Name( "11/2001" ), :Name( "12/2001" ), :Name( "01/2002" ),
:Name( "02/2002" ), :Name( "03/2002" ), :Name( "04/2002" ), :Name( "05/2002" ), :Name( "06/2002" ), :Name( "07/2002" ),
:Name( "08/2002" ), :Name( "09/2002" ), :Name( "10/2002" ), :Name( "11/2002" ), :Name( "12/2002" ), :Name( "01/2003" ),
:Name( "02/2003" ), :Name( "03/2003" ), :Name( "04/2003" ), :Name( "05/2003" ), :Name( "06/2003" ), :Name( "07/2003" )
),
Life Time Unit( Month ),
Interval Censored Failure( 1 ),
Show Legend( 1 ),
Show Graph Filter( 1 ),
Forecast(
Group( "" ),
Risk Set(
[1991, 2000, 1999, 2024, 1959, 1958, 2000, 2001, 1986, 1966, 1983, 2011, 2026, 1950, 1989, 1963, 1954, 2030, 1981, 2006, 1991,
1950, 2025, 1996, 1987, 1957, 1988, 1966, 2038, 2014, 1962, 1965, 1952, 2045, 2018, 2036]
),
Forecast To( "01/2004" ),
Distribution( Weibull ),
Contract( 5, Month ),
Forecast Type( Incremental ),
Interval Type( No Interval ),
Alpha( 0.05 )
),
Forecast Options(
Animation( 0 ),
Interactive Configuration of Risk Sets( 1 ),
Spreadsheet Configuration of Risk Sets( 0 ),
Show Interval( 0 ),
Forecasting Interval Type( Prediction Interval ),
Use Contract Length( 1 ),
Use Failure Cost( 0 ),
Set Failure Cost( [1] ),
Monte Carlo Sample Size( 10000 ),
Random Seed( 0 ),
Use Approximate Distribution( 1 )
)
);
Code Explanation:
- Open data table;
- Perform reliability forecast analysis.
- Set input format to Nevada.
- Define production count column.
- Specify timestamp column.
- List failure count columns.
- Set lifetime unit to month.
- Configure interval censored failure.
- Enable legend display.
- Enable graph filter display.
Example 6
Summary: Creates a reliability forecast object using Weibull distribution and prediction intervals, with interactive configuration options for risk sets and interval display.
Code:
dt under test = Open("data_table.jmp");
dt2 = Open("data_table.jmp");
obj = Reliability Forecast(
Input Format( Dates ),
Production Data Table( Small Production part1.jmp, Production Count( :Sold Quantity ), Timestamp( :Sold Month ) ),
Failure Data Table(
Small Production part2.jmp,
Failure Time( :Return Month ),
Timestamp( :Sold Month ),
Failure Count( :Return Quantity )
),
Life Time Unit( Month ),
Show Legend( 1 ),
Show Graph Filter( 1 ),
Forecast(
Group( "" ),
Risk Set( [2550, 2600, 2650, 2700, 2750, 2800, 2850] ),
Future Risk Set( [3082, 3052, 3367, 3952, 3667, 3667], [3347740800, 3350160000, 3352579200, 3355257600, 3357849600, 3360528000] ),
Forecast To( "02/2011" ),
Distribution( Weibull ),
Contract( 6, Month ),
Forecast Type( Incremental ),
Interval Type( Prediction Interval ),
Alpha( 0.05 )
),
Forecast Options(
Animation( 0 ),
Interactive Configuration of Risk Sets( 1 ),
Spreadsheet Configuration of Risk Sets( 0 ),
Show Interval( 1 ),
Forecasting Interval Type( Prediction Interval ),
Use Contract Length( 1 ),
Use Failure Cost( 0 ),
Set Failure Cost( [1] ),
Monte Carlo Sample Size( 10000 ),
Random Seed( 0 ),
Use Approximate Distribution( 1 )
),
SendToReport(
Dispatch( {"Reliability Forecast"}, "Observed Data", OutlineBox, {Close( 1 )} ),
Dispatch( {"Reliability Forecast", "Forecast"}, "9", ScaleBox, {Min( -12 ), Max( 252 ), Inc( 50 ), Minor Ticks( 1 )} )
)
);
Code Explanation:
- Open data table.
- Open data table.
- Create reliability forecast object.
- Set input format to dates.
- Specify production data table.
- Specify failure data table.
- Define life time unit as months.
- Enable legend and graph filter.
- Configure forecast settings.
- Adjust forecast options and send report.
Example 7
Summary: Runs a reliability forecast analysis by opening a data table, defining production count and failure counts, and configuring interval censored failure, life time unit, and forecasting parameters.
Code:
dt under test = Open("data_table.jmp");
obj = Reliability Forecast(
Input Format( Nevada ),
Production Count( :Sold Quantity ),
Timestamp( :Sold Month ),
Failure Count(
:Name( "08/2009" ), :Name( "09/2009" ), :Name( "10/2009" ), :Name( "11/2009" ), :Name( "12/2009" ), :Name( "01/2010" ),
:Name( "02/2010" )
),
Life Time Unit( Month ),
Interval Censored Failure( 1 ),
Show Legend( 1 ),
Show Graph Filter( 0 ),
Forecast(
Group( "" ),
Risk Set( [2550, 2600, 2650, 2700, 2750, 2800, 2850] ),
Future Risk Set( [3022, 3307, 3502, 3502, 3502, 3502], [3347827200, 3350246400, 3352924800, 3355516800, 3358195200, 3360787200] ),
Forecast To( "02/2011" ),
Distribution( Weibull ),
Contract( 12, Month ),
Forecast Type( Sequential ),
Interval Type( No Interval ),
Alpha( 0.05 )
),
Forecast Options(
Animation( 1 ),
Interactive Configuration of Risk Sets( 1 ),
Spreadsheet Configuration of Risk Sets( 0 ),
Show Interval( 0 ),
Forecasting Interval Type( Prediction Interval ),
Use Contract Length( 1 ),
Use Failure Cost( 0 ),
Set Failure Cost( . ),
Monte Carlo Sample Size( 10000 ),
Random Seed( 0 ),
Use Approximate Distribution( 1 )
),
SendToReport(
Dispatch( {}, "Reliability Forecast", OutlineBox, {Set Title( "Show Life Distribution" )} ),
Dispatch( {"Reliability Forecast"}, "Observed Data", OutlineBox, {Close( 1 )} ),
Dispatch( {"Reliability Forecast"}, "Life Distribution", OutlineBox, {Close( 0 )} ),
Dispatch( {"Reliability Forecast"}, "Forecast", OutlineBox, {Close( 1 )} ),
Dispatch( {"Reliability Forecast", "Forecast"}, "9", ScaleBox,
{Min( -22.4251052951373 ), Max( 470.927211197882 ), Inc( 50 ), Minor Ticks( 0 )}
)
)
);
Code Explanation:
- Open table.
- Set input format.
- Define production count.
- Specify timestamp.
- Set failure counts.
- Define life time unit.
- Configure interval censored failure.
- Show legend.
- Disable graph filter.
- Perform reliability forecast.
Example 8
Summary: Creates a reliability forecast object in JMP, specifying input format, production count, timestamp, and failure count columns, as well as configuring life time unit, interval censored failure, and forecast settings.
Code:
dt under test = Open("data_table.jmp");
obj = Reliability Forecast(
Input Format( Nevada ),
Production Count( :Sold Quantity ),
Timestamp( :Sold Month ),
Failure Count(
:Name( "08/2009" ), :Name( "09/2009" ), :Name( "10/2009" ), :Name( "11/2009" ), :Name( "12/2009" ), :Name( "01/2010" ),
:Name( "02/2010" )
),
Life Time Unit( Month ),
Interval Censored Failure( 1 ),
Show Legend( 1 ),
Show Graph Filter( 0 ),
Forecast(
Group( "" ),
Risk Set( [2550, 2600, 2650, 2700, 2750, 2800, 2850] ),
Future Risk Set(
[3022.5, 3307.5, 3502, 3502, 3502, 3502],
[3347827200, 3350246400, 3352924800, 3355516800, 3358195200, 3360787200]
),
Forecast To( "02/2011" ),
Distribution( Weibull ),
Contract( 12, Month ),
Forecast Type( Sequential ),
Interval Type( No Interval ),
Alpha( 0.05 )
),
Forecast Options(
Animation( 1 ),
Interactive Configuration of Risk Sets( 1 ),
Spreadsheet Configuration of Risk Sets( 0 ),
Show Interval( 0 ),
Forecasting Interval Type( Prediction Interval ),
Use Contract Length( 1 ),
Use Failure Cost( 0 ),
Set Failure Cost( . ),
Monte Carlo Sample Size( 10000 ),
Random Seed( -1 ),
Use Approximate Distribution( 1 )
)
);
Code Explanation:
- Open data table;
- Create reliability forecast object.
- Set input format to Nevada.
- Specify production count column.
- Define timestamp column.
- List failure count columns.
- Set life time unit to month.
- Enable interval censored failure.
- Configure forecast settings.
- Apply forecast options.
Example 9
Summary: Runs a reliability forecast using the Reliability Forecast platform in JMP, generating predictions for future risk sets and saving the forecast data table.
Code:
dt = Open("data_table.jmp");
rf = Reliability Forecast(
Input Format( Nevada ),
Production Count( :Volume ),
Timestamp( :Time ),
Failure Count( 3 :: 38 ),
Life Time Unit( Month ),
Interval Censored Failure( 1 ),
Show Legend( 0 ),
Show Graph Filter( 0 ),
Forecast(
Group( "" ),
Risk Set(
[1991, 2000, 1999, 2024, 1959, 1958, 2000, 2001, 1986, 1966, 1983, 2011, 2026, 1950, 1989, 1963, 1954, 2030, 1981, 2006, 1991,
1950, 2025, 1996, 1987, 1957, 1988, 1966, 2038, 2014, 1962, 1965, 1952, 2045, 2018, 2036]
),
Future Risk Set(
[2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026],
[3139862400, 3142540800, 3145219200, 3147811200, 3150489600, 3153081600, 3155760000, 3158438400, 3160944000, 3163622400,
3166214400, 3168892800, 3171484800, 3174163200, 3176841600, 3179433600, 3182112000]
),
Forecast To( "01/2004" ),
Distribution( Weibull ),
Contract( 5, Month ),
Forecast Type( Incremental ),
Interval Type( No Interval ),
Alpha( 0.05 )
)
);
d1 = rf << Save Forecast Data Table;
Code Explanation:
- Open table.
- Perform reliability forecast.
- Set input format.
- Define production count.
- Specify timestamp.
- Identify failure count.
- Set life time unit.
- Handle interval censored failures.
- Configure legend display.
- Save forecast data table.
Distribution using Descriptive Data
Summary: Creates a distribution analysis, analyzing the Gender, Age, Hair Color, U.S. Region, and Residence columns, displaying histograms only.
Code:
// Descriptive Data (The Xs)
Distribution(
Nominal Distribution(
Column( :Gender )
),
Continuous Distribution(
Column( :Age )
),
Nominal Distribution(
Column( :Hair Color )
),
Nominal Distribution(
Column( :U.S. Region )
),
Nominal Distribution(
Column( :Residence )
),
Histograms Only
);
Code Explanation:
- Create distribution analysis.
- Analyze Gender column.
- Analyze Age column.
- Analyze Hair Color column.
- Analyze U.S. Region column.
- Analyze Residence column.
- Display histograms only.
Distribution using Transformed response
Summary: Opens a distribution analysis, analyzing the EWS1_BIN10_ column and its logarithmic transformation, Log(Bin10), to fit a normal distribution.
Code:
// Transformed response (EWS1_BIN10_)
Distribution(
Continuous Distribution(
Column( :EWS1_BIN10_ )
),
Continuous Distribution(
Column( :"Log(Bin10)"n ),
Fit Distribution( Normal )
)
);
Code Explanation:
- Open distribution analysis.
- Analyze EWS1_BIN10_ column.
- Analyze Log(Bin10) column.
- Fit normal distribution.
Distribution of Presenter Name
Summary: Opens a distribution analysis and uses multiple response distribution to analyze the 'Presenter Name (Delimited)' column, providing an interactive platform for exploring presenter name data.
Code:
// Distribution of Presenter Name (Delimited)
Distribution(
Multiple Response Distribution(
Column(
:
"Presenter Name (Delimited)"n
)
)
);
Code Explanation:
- Open distribution analysis.
- Use multiple response distribution.
- Analyze column "Presenter Name (Delimited)".
Distribution using Element 1
Example 1
Summary: Opens a distribution platform, sets a nominal distribution, and references the 'Asset ID[asset_key]' column. It then dispatches to the 'Asset ID[asset_key]' window with histograms only and sets the outline box title.
Code:
// Dashboard 3 - Element 1 (Filter)
Distribution(
Nominal Distribution(
Column(
Referenced Column(
"Asset ID[asset_key]",
Reference(
Column( :asset_key ),
Reference(
Column(
:Asset ID
)
)
)
)
)
),
Histograms Only,
SendToReport(
Dispatch( {},
"Asset ID[asset_key]",
OutlineBox,
{Set Title( "Asset ID" )}
)
)
);
Code Explanation:
- Open distribution platform.
- Set nominal distribution.
- Reference "Asset ID[asset_key]" column.
- Link to "asset_key" column.
- Link to "Asset ID" column.
- Display histograms only.
- Send report to window.
- Dispatch to "Asset ID[asset_key]".
- Set outline box title.
- Title set to "Asset ID".
Example 2
Summary: Opens a distribution platform, selects a nominal distribution with histograms only, and sends the report to a dashboard with customized settings.
Code:
// Dashboard 4 - Element 1 (Filter)
Distribution(
Nominal Distribution(
Column(
Referenced Column(
"Asset ID[asset_key]",
Reference(
Column( :asset_key ),
Reference(
Column(
:Asset ID
)
)
)
)
)
),
Histograms Only,
SendToReport(
Dispatch( {},
"Asset ID[asset_key]",
OutlineBox,
{Set Title( "Asset ID" )}
)
)
);
Code Explanation:
- Open distribution platform.
- Select nominal distribution.
- Use referenced column.
- Reference asset_key column.
- Reference Asset ID column.
- Display histograms only.
- Send report to dashboard.
- Dispatch report settings.
- Set title to "Asset ID".
- Finalize dashboard element.
Example 3
Summary: Visualizes a nominal distribution of 'Asset ID' data, enabling histograms only and sending the report to a dashboard with a customized title.
Code:
// Dashboard 5 - Element 1 (Filter)
Distribution(
Nominal Distribution(
Column(
Referenced Column(
"Asset ID[asset_key]",
Reference(
Column( :asset_key ),
Reference(
Column(
:Asset ID
)
)
)
)
)
),
Histograms Only,
SendToReport(
Dispatch( {},
"Asset ID[asset_key]",
OutlineBox,
{Set Title( "Asset ID" )}
)
)
);
Code Explanation:
- Open Distribution platform.
- Set Nominal Distribution.
- Select "Asset ID[asset_key]" column.
- Reference "asset_key" column.
- Reference "Asset ID" column.
- Enable Histograms Only.
- Send report to dashboard.
- Dispatch report settings.
- Set title to "Asset ID".
- Close dispatch.
Example 4
Summary: Visualizes a distribution analysis using nominal distribution type, referencing the 'asset_key' column and defining a reference for 'Asset Group Level 2', displaying histograms only.
Code:
// Dashboard 1 - Element 1 (Filter)
Distribution(
Nominal Distribution(
Column(
Referenced Column(
"Asset Group Level 2[asset_key]",
Reference(
Column( :asset_key ),
Reference(
Column(
:
Asset Group Level 2
)
)
)
)
)
),
Histograms Only
);
Code Explanation:
- Create distribution analysis.
- Use nominal distribution type.
- Specify referenced column.
- Set reference for asset_key.
- Define reference for Asset Group Level 2.
- Display histograms only.
Distribution using Element 2
Summary: Opens a Nominal Distribution platform, references an external column 'Asset Group Level 3[asset_key]', and displays frequencies.
Code:
// Dashboard 1 - Element 2 (Second Filter)
Distribution(
Nominal Distribution(
Column(
Referenced Column(
"Asset Group Level 3[asset_key]",
Reference(
Column( :asset_key ),
Reference(
Column(
:
Asset Group Level 3
)
)
)
)
),
Frequencies( 0 )
)
);
Code Explanation:
- Open Distribution platform.
- Set distribution type to Nominal.
- Select column for analysis.
- Reference external column.
- Specify referenced column name.
- Establish reference relationship.
- Link to primary column.
- Further reference nested column.
- Identify nested column name.
- Display frequencies.
Distribution using New Project
Summary: Creates a distribution report with virtual columns, utilizing workflow steps to set properties and open tables in a new project.
Code:
project = New Project();
project << Run Script(
w = Workflow();
w << Set flow name( "WFB1" );
w << Add JSL Step( "open data_table", JSL quote(dt=Open("data_table.jmp")) );
w << Add JSL Step( " data_table: LINK ID", JSL quote( Data Table("data_table"):Person << Set Property( "Link ID", 1 )) );
w << Add JSL Step( "open Laptop Runs", JSL quote(dt1=Open("data_table.jmp")) );
w << Add JSL Step(
" Laptop Runs: LINK REFERENCE", JSL Quote( Data Table("data_table"):Person << Set Property(
"Link Reference",
Reference Table( "data_table.jmp" ) )) );
w << Add JSL Step(
"Distribution with Virtual Columns", JSL Quote( rpt1 = Data Table("data_table") << Distribution(
Nominal Distribution(
Column(
Referenced Column(
"Gender[Person]",
Reference( Column( :Person ), Reference( Column( :Gender ) ) )
)
)
),
Nominal Distribution(
Column(
Referenced Column(
"Job[Person]",
Reference( Column( :Person ), Reference( Column( :Job ) ) )
)
)
)
);
) );
w << Clear selection();
w << Execute next();
w << Execute next();
w << Execute next();
w << Execute next();
w << Execute next();
rpt = New Window( "Laptop Runs - Distribution",
Data Table("data_table") << Distribution(
Nominal Distribution(
Column( Referenced Column( "Gender[Person]", Reference( Column( :Person ), Reference( Column( :Gender ) ) ) ) )
),
Nominal Distribution(
Column( Referenced Column( "Job[Person]", Reference( Column( :Person ), Reference( Column( :Job ) ) ) ) )
)
)
);
w << clear selection();
);
Code Explanation:
- Create new project.
- Run script within project.
- Initialize workflow.
- Set workflow name.
- Open "data_table1" table.
- Set "Link ID" property for "Person".
- Open "data_table2" table.
- Set "Link Reference" property for "Person".
- Generate distribution report with virtual columns.
- Execute workflow steps sequentially.
- Create new window for distribution report.
- Clear selection in workflow.
Distribution using Labeled
Example 1
Summary: Runs the analysis and labeling of rows in a data table, generating a distribution report with frame boxes and marker segments.
Code:
Open("data_table.jmp");
Labeled( Row State( 5 ) ) = 1;
Labeled( Row State( 8 ) ) = 1;
dist = Distribution( Continuous Distribution( Column( :height ) ) );
frame = (dist << report)[FrameBox( 2 )];
seg = (frame << Find Seg( Marker Seg( 1 ) ));
Code Explanation:
- Open data table;
- Mark row 5 labeled.
- Mark row 8 labeled.
- Create distribution analysis.
- Select height column.
- Access distribution report.
- Locate second frame box.
- Find marker segment.
- Identify first marker segment.
- Assign to variable 'seg'.
Example 2
Summary: Runs the labeling and offsetting of marker segments in a JMP report, utilizing Distribution and Find Seg functions.
Code:
Open("data_table.jmp");
Labeled( Row State( 5 ) ) = 1;
Labeled( Row State( 8 ) ) = 1;
dist = Distribution( Continuous Distribution( Column( :height ) ) );
frame = (dist << report)[FrameBox( 2 )];
seg = (frame << Find Seg( Marker Seg( 1 ) ));
seg << label offset( {0, -23, 5}, {1, -5, -10} );
Code Explanation:
- Open data table.
- Mark row 5 as labeled.
- Mark row 8 as labeled.
- Create distribution for height.
- Access second frame box.
- Find first marker segment.
- Set label offset for segment.
Distribution using If
Example 1
Summary: Analyze and visualize causes in a data table, generating Pareto plots and distribution summaries for top and bottom causes.
Code:
If( JMP Version() >= "17",
Names Default To Here( 1 );
dt = Open("data_table.jmp");
pp = dt << Pareto Plot( Cause( :Causes ), Freq( :Count ) );
pp << Get Causes;
first2 = pp << Get Causes( "First", 2 );
last3 = pp << Get Causes( "Last", 3 );
first80Perc = pp << Get Causes( "First %", 80 );
last10Perc = pp << Get Causes( "Last %", 10 );
);
dt = New Table( "myCauses" );
dt << New Column( "First2", Character, set values( first2 ) );
dt << New Column( "Last3", Character, set values( last3 ) );
dt << New Column( "first80Perc", Character, set values( first80Perc ) );
dt << New Column( "last10Perc", Character, set values( last10Perc ) );
ds = dt << Distribution(
Nominal Distribution( Column( :First2 ) ),
Nominal Distribution( Column( :Last3 ) ),
Nominal Distribution( Column( :first80Perc ) ),
Nominal Distribution( Column( :last10Perc ) ),
Histograms Only
);
Code Explanation:
- Check JMP version.
- Set names default.
- Open data table.
- Create Pareto plot.
- Get all causes.
- Get top 2 causes.
- Get bottom 3 causes.
- Get top 80% causes.
- Get bottom 10% causes.
- Create new table.
- Add columns for causes.
- Set column values.
- Run distribution analysis.
Example 2
Summary: Fits Generalized Regression models with Elastic Net adaptive estimation and Lasso adaptive estimation, retrieving model summary reports, and extracting number of observations from two different data tables.
Code:
If( JMP Product Name() == "Pro",
dt = Open("data_table.jmp");
fm = dt << Fit Model(
Validation( :Validation ),
Y( :Fish Caught ),
Effects(
:Live Bait, :Fishing Poles, :Camper, :People, :Children, :Live Bait * :Fishing Poles, :Live Bait * :Camper,
:Live Bait * :People, :Live Bait * :Children, :Fishing Poles * :Camper, :Fishing Poles * :People, :Fishing Poles * :Children,
:Camper * :People, :Camper * :Children, :People * :Children
),
Personality( Generalized Regression ),
Generalized Distribution( ZI Poisson ),
Run( Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( Validation Column ) ) )
);
rp = Report( fm )["Model Summary"];
nobs = (rp[Table Box( 2 )] << get as matrix)[1, 0];
Close( dt, No Save );
dt = Open("data_table.jmp");
fm = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( Generalized Regression ),
Generalized Distribution( Normal ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ) ) )
);
rp = Report( fm )["Model Summary"];
nobs = (rp[Table Box( 2 )] << get as matrix)[1, 0];
Close( dt, No Save );
);
Code Explanation:
- Check if JMP version is Pro.
- Open data table;
- Fit Generalized Regression model.
- Specify validation column.
- Set response variable to "Fish Caught".
- Define multiple effects for interaction terms.
- Use ZI Poisson distribution.
- Run model with Elastic Net adaptive estimation.
- Retrieve model summary report.
- Extract number of observations from report.
- Close "Fishing.jmp" without saving.
- Open data table;
- Fit Generalized Regression model.
- Specify validation column.
- Set response variable to "Y".
- Define multiple effects.
- Use Normal distribution.
- Run model with Lasso adaptive estimation.
- Retrieve model summary report.
- Extract number of observations from report.
- Close "Diabetes.jmp" without saving.
Example 3
Summary: Analyze a generalized regression model in JMP Pro, extracting parameter estimates and uncoded estimates for specific predictors.
Code:
If( Contains( JMP Product Name(), "Pro" ) > 0,
dt = Open("data_table.jmp");
dt:Feed Rate[1 :: 2] = .;
dt:Catalyst[3 :: 4] = .;
dt:Stir Rate[8 :: 9] = .;
obj1 = dt << Fit Model(
Y( :Percent Reacted ),
Effects( :Feed Rate, :Catalyst, :Stir Rate, :Temperature ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Informative Missing( 1 ),
Run( Fit( Estimation Method( "Standard Least Squares " ) ) )
);
rpt1 = obj1 << report;
est1 = (rpt1["Parameter Estimates for Original Predictors"][Number Col Box( "Estimate" )] << get as matrix);
tmp est1 = est1[[1, 2, 4, 6, 8]];
uncoded est1 = rpt1[Number Col Box( "Uncoded Estimate" )] << get as matrix;
collst = {"Feed Rate", "Catalyst", "Stir Rate", "Temperature"};
r1 = m1 = [];
For( i = 1, i <= N Items( collst ), i++,
lo = (Column( dt, collst[i] ) << Get Property( "Coding" ))[1];
hi = (Column( dt, collst[i] ) << Get Property( "Coding" ))[2];
r1 |/= (hi - lo) / 2;
m1 |/= (hi + lo) / 2;
);
b uncoded est1 = (tmp est1[1] + Sum( tmp est1[2 :: 5] :* (-m1) :/ r1 )) |/ (tmp est1[2 :: 5] :/ r1);
obj2 = dt << Fit Model(
Y( :Percent Reacted ),
Effects( :Feed Rate, :Catalyst, :Stir Rate, :Temperature ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Informative Missing( 1 ),
Suppress Coding( 1 ),
Run
);
rpt2 = obj2 << report;
est2 = rpt2["Parameter Estimates for Original Predictors"][Number Col Box( "Estimate" )] << get as matrix;
uncoded est2 = Try( rpt2[Number Col Box( "Uncoded Estimate" )] << get as matrix, 0 );
Close( dt, no save );
);
Code Explanation:
- Check if JMP Pro.
- Open data_table data
- Set some values to missing.
- Fit generalized regression model.
- Extract parameter estimates.
- Filter specific estimates.
- Get uncoded estimates.
- Define predictor names.
- Initialize matrices.
- Calculate coding parameters.
- Calculate uncoded estimates.
- Fit model without coding.
- Extract parameter estimates.
- Optionally extract uncoded estimates.
- Close data table without saving.
Example 4
Summary: Fits a Generalized Regression model to a data table, generating ROC and lift curves for validation and prediction.
Code:
If( Contains( Build Information(), "Pro" ) > 0,
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Gender ),
Target Level( "1" ),
Effects( :Y, :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Binomial" ),
Run( Fit( Estimation Method( Maximum Likelihood ), Validation Method( Validation Column ), ROC Curve( 1 ), Lift Curve( 1 ) ) )
);
obj << savescripttodatatable( "Generalized Regression" );
obj2 = dt << runscript( "Generalized Regression" );
rpt = obj2 << report;
a = Try( auc = rpt["ROC Curve for Gender = 1"][Number Col Box( 1 )] << getasmatrix, 0 );
a = Try( lift = rpt["Lift Curve for Gender = 1"][Text Edit Box( 1 )] << gettext, 0 );
Close( dt, nosave );
);
Code Explanation:
- Check for JMP Pro.
- Open data table;
- Fit Generalized Regression model.
- Set validation method.
- Specify response variable.
- Define target level.
- Include all effects.
- Use binomial distribution.
- Perform maximum likelihood estimation.
- Generate ROC and lift curves.
- Save script to data table.
- Run saved script.
- Extract ROC curve data.
- Extract lift curve data.
- Close dataset without saving.
Example 5
Summary: Fits a generalized regression model to data in a JMP table, specifying censoring and response variables, and selecting Gamma distribution.
Code:
If( Contains( Build Information(), "Pro" ) > 0,
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Censor( :censor ),
Censor Code( "1" ),
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Gamma" ),
Run( Fit( Estimation Method( Maximum Likelihood ), Validation Method( None ) ) ),
SendToReport( Dispatch( {}, "Model Launch", OutlineBox, {Close( 0 )} ) )
);
Close( dt, nosave );
);
Code Explanation:
- Check for Pro version.
- Open data_table data
- Fit generalized regression model.
- Specify censor variable.
- Set censor code.
- Define response variable.
- Include multiple effects.
- Choose Generalized Regression personality.
- Select Gamma distribution.
- Run maximum likelihood estimation.
Example 6
Summary: Fits a generalized regression model to data, using JMP Pro's Fit Model platform and specifying normal distribution.
Code:
If( Contains( Build Information(), "Pro" ) > 0,
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run(),
SendToReport( Dispatch( {}, "Model Launch", OutlineBox, {Close( 0 )} ) )
);
rpt = obj << report;
a = Try( parms = rpt["Parameter Estimates for Original Predictors"][Number Col Box( "Estimate" )] << getasmatrix, 0 );
Close( dt, nosave );
);
Code Explanation:
- Check for JMP Pro.
- Open data table;
- Start Fit Model process.
- Use Validation column.
- Set Y variable.
- Define effects variables.
- Choose Generalized Regression.
- Specify Normal distribution.
- Run the model.
- Close Model Launch outline.
Example 7
Summary: Fits a generalized regression model to a data table, utilizing JMP Pro's capabilities for maximum likelihood estimation and normal distribution.
Code:
If( Contains( Build Information(), "Pro" ) > 0,
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Maximum Likelihood ), Validation Method( None ) ) ),
SendToReport( Dispatch( {}, "Model Launch", OutlineBox, {Close( 0 )} ) )
);
newdt = obj << savecodingtable;
dtx = newdt << getasmatrix;
modx = obj << getxmatrix;
Close( newdt, nosave );
Close( dt, nosave );
);
Code Explanation:
- Check for JMP Pro.
- Open data table;
- Fit generalized regression model.
- Specify response variable.
- Define model effects.
- Choose generalized regression personality.
- Set normal distribution.
- Run maximum likelihood estimation.
- Save coding table.
- Extract matrices and close datasets.
Example 8
Summary: Fits a Generalized Regression model to a data table, utilizing JMP Pro features for logistic regression and binomial distribution.
Code:
If( Contains( Build Information(), "Pro" ) > 0,
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y Binary ),
Target Level( "High" ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Binomial" ),
Run( Fit( Estimation Method( Logistic Regression ), Validation Method( Validation Column ) ) )
);
rpt = obj << report;
bText = rpt[Outline Box( 1 )] << gettext;
obj << savescripttodatatable( "Generalized Regression" );
obj2 = dt << runscript( "Generalized Regression" );
rpt2 = obj2 << report;
aText = rpt2[Outline Box( 1 )] << gettext;
Close( dt, nosave );
);
Code Explanation:
- Check for JMP Pro version.
- Open data table;
- Fit Generalized Regression model.
- Set validation column.
- Define binary response variable.
- Specify target level as High.
- Include multiple effects.
- Use Binomial distribution.
- Perform logistic regression fit.
- Save script to data table.
Example 9
Summary: Fits a generalized regression model with elastic net estimation and validation in JMP Pro, extracting alpha values from the report.
Code:
If( Contains( JMP Product Name(), "Pro" ) > 0,
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive, Alpha( 0 ) ) ), Validation Method( Validation Column ) ) )
);
rpt = obj << report;
alpha1 = rpt[Outline Box( "Normal Adaptive Elastic Net with Validation Column" )][Outline Box( "Estimation Details" )][NumberBox( 1 )]
<< get text;
Close( dt, no save );
);
Code Explanation:
- Check for JMP Pro.
- Open data table;
- Initiate Fit Model.
- Set validation method.
- Define response variable.
- Specify predictor variables.
- Choose Generalized Regression personality.
- Select Normal distribution.
- Run model with Elastic Net.
- Extract alpha value from report.
- Close dataset without saving.
Example 10
Summary: Analyze binary data by fitting a generalized regression model, extracting distribution information, and enabling specific report items in JMP Pro.
Code:
If( Contains( JMP Product Name(), "Pro" ) > 0,
dt = Open("data_table.jmp");
obj1 = dt << Fit Model( Y( :Y Binary ), Target Level( "Low" ), Personality( "Generalized Regression" ), );
rpt1 = obj1 << report;
dist1 = (rpt1[Combo Box( 2 )] << get items)[rpt1[Combo Box( 2 )] << Get];
obj2 = dt << Fit Model(
Y( :Y Binary ),
Target Level( "Low" ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Binomial" )
);
rpt2 = obj2 << report;
check1 = rpt2[Combo Box( 2 )] << Item Enabled( 13 );
Close( dt, no save );
);
Code Explanation:
- Check if JMP Pro.
- Open data table;
- Fit binary model.
- Get report.
- Extract distribution.
- Refit with binomial.
- Get new report.
- Enable item 13.
- Close table without saving.
Example 11
Summary: Fits a generalized regression model to a data table using JMP Pro, specifying validation and response variables, and enforcing heredity constraints.
Code:
If( Contains( JMP Product Name(), "Pro" ) > 0,
dt = Open("data_table.jmp");
obj1 = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects(
:Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose, :Age * :Gender, :Age * :BMI, :Age * :BP,
:Age * :Total Cholesterol, :Age * :LDL, :Age * :HDL, :Age * :TCH, :Age * :LTG, :Age * :Glucose, :Gender * :BMI, :Gender * :BP,
:Gender * :Total Cholesterol, :Gender * :LDL, :Gender * :HDL, :Gender * :TCH, :Gender * :LTG, :Gender * :Glucose, :BMI * :BP,
:BMI * :Total Cholesterol, :BMI * :LDL, :BMI * :HDL, :BMI * :TCH, :BMI * :LTG, :BMI * :Glucose, :BP * :Total Cholesterol,
:BP * :LDL, :BP * :HDL, :BP * :TCH, :BP * :LTG, :BP * :Glucose, :Total Cholesterol * :LDL, :Total Cholesterol * :HDL,
:Total Cholesterol * :TCH, :Total Cholesterol * :LTG, :Total Cholesterol * :Glucose, :LDL * :HDL, :LDL * :TCH, :LDL * :LTG,
:LDL * :Glucose, :HDL * :TCH, :HDL * :LTG, :HDL * :Glucose, :TCH * :LTG, :TCH * :Glucose, :LTG * :Glucose
),
Personality( Generalized Regression ),
Generalized Distribution( "Normal" ),
Run
);
obj1 << Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( Validation Column ), Enforce Heredity( 1 ) );
Close( dt, no save );
);
Code Explanation:
- Check if JMP Pro is installed.
- Open data table;
- Launch Fit Model platform.
- Specify validation column.
- Set response variable.
- Define all effects.
- Choose Generalized Regression personality.
- Select Normal distribution.
- Run the model.
- Fit using Elastic Net method.
- Use validation column for validation.
- Enforce heredity constraint.
- Close dataset without saving.
Example 12
Summary: Fits an ordinal logistic generalized regression model to a data table, utilizing maximum likelihood estimation and hiding summary reports.
Code:
If( Contains( JMP Product Name(), "Pro" ) > 0,
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :age ),
Effects( :sex, :height, :weight ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Ordinal Logistic" ),
Run( Fit( Estimation Method( Maximum Likelihood ), Validation Method( None ), Show Prediction Expression( 1 ) ) ),
SendToReport(
Dispatch( {"Ordinal Logistic Maximum Likelihood"}, "Model Summary", OutlineBox, {Close( 1 )} ),
Dispatch( {"Ordinal Logistic Maximum Likelihood"}, "Parameter Estimates for Original Predictors", OutlineBox, {Close( 1 )} )
)
);
rpt = obj << report;
rpt[Outline Box( "Prediction Expression" )][PictBox( 6 )] << get journal;
Close( dt, no save );
);
Code Explanation:
- Check if JMP is Pro.
- Open data table;
- Fit generalized regression model.
- Set response variable to age.
- Include sex, height, weight effects.
- Use ordinal logistic distribution.
- Run model with maximum likelihood estimation.
- Hide model summary and parameter estimates.
- Extract prediction expression report.
- Close dataset without saving.
Example 13
Summary: Fits a Generalized Regression model with Quantile Regression distribution to a data table, using Backward Elimination and AICc validation.
Code:
If( Contains( JMP Product Name(), "Pro" ) > 0,
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Effects( :BMI, :BP, :HDL, :LTG ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Quantile Regression" ),
Quantile( 0.3 ),
Run( Fit( Estimation Method( Backward Elimination ), Validation Method( "AICc" ), ) )
);
rpt = obj << report;
title1 = rpt[Outline Box( 4 )] << get title;
Close( dt, no save );
);
Code Explanation:
- Check for JMP Pro.
- Open data table;
- Fit Generalized Regression model.
- Set response variable Y.
- Include BMI, BP, HDL, LTG effects.
- Use Quantile Regression distribution.
- Set quantile to 0.3.
- Run model with Backward Elimination.
- Validate using AICc.
- Retrieve report title.
Example 14
Summary: Fits a Generalized Regression model with validation, specifying gender as an effect and normal distribution, and generates a report with outline title.
Code:
If( Contains( JMP Product Name(), "Pro" ) > 0,
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Gender ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run
);
rpt = obj << report;
outlinetitle = rpt[Outline Box( "Normal Standard Least Squares with Validation Column" )][Outline Box( 2 )] << get title;
Close( dt, no save );
);
Code Explanation:
- Check for JMP Pro.
- Open data_table data
- Fit Generalized Regression model.
- Specify validation column.
- Set response variable.
- Include gender effect.
- Use Normal distribution.
- Run the model.
- Get model report.
- Extract outline title.
Example 15
Summary: Fits and creates reports for linear and generalized regression models in JMP Pro, extracting R-squared values from each model.
Code:
If( Contains( JMP Product Name(), "Pro" ) > 0,
dt = Open("data_table.jmp");
obj1 = dt << Fit Model(
Y( :Damping ),
Effects( :CuSO4 & RS & Mixture, :Na2S2O3 & RS & Mixture, :CuSO4 * :Na2S2O3, :Glyoxal ),
Center Polynomials( 0 ),
Personality( "Standard Least Squares" ),
Emphasis( "Minimal Report" ),
Run
);
rpt1 = obj1 << report;
obj2 = dt << Fit Model(
Y( :Damping ),
Effects( :CuSO4 & RS & Mixture, :Na2S2O3 & RS & Mixture, :CuSO4 * :Na2S2O3, :Glyoxal ),
No Intercept( 1 ),
Center Polynomials( 0 ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Maximum Likelihood ), Validation Method( None ) ) ),
);
rpt2 = obj2 << report;
rsquare1 = (rpt1[Outline Box( "Summary of Fit" )][Table Box( 1 )] << get as matrix)[2];
rsquare2 = (rpt2[Outline Box( "Standard Least Squares" )][Outline Box( "Model Summary" )][Table Box( 2 )] << get as matrix)[8];
Close( dt, no save );
);
Code Explanation:
- Check for JMP Pro.
- Open data table.
- Fit linear model.
- Retrieve report.
- Fit generalized regression model.
- Retrieve report.
- Extract R-squared from linear model.
- Extract R-squared from generalized regression model.
- Close data table without saving.
Example 16
Summary: Fits a generalized regression model with forward selection and AICc validation in JMP Pro, using the specified data table and predictor variables.
Code:
If( Contains( JMP Product Name(), "Pro" ) > 0,
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y Ordinal ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Multinomial" ),
Run( Fit( Estimation Method( Forward Selection ), Validation Method( AICc ) ) )
);
rpt = obj << report;
fit1 = rpt[Outline Box( 6 )] << get title;
Close( dt, no save );
);
Code Explanation:
- Check for JMP Pro.
- Open data table;
- Fit generalized regression model.
- Set response variable.
- Define predictor variables.
- Choose personality: Generalized Regression.
- Specify distribution: Multinomial.
- Run model with forward selection.
- Use AICc for validation.
- Extract model report title.
Example 17
Summary: Fits a generalized regression model to validate data in JMP Pro, utilizing the Validation column and specifying response variable Damping.
Code:
If( Contains( JMP Product Name(), "Pro" ) > 0,
dt = Open("data_table.jmp");
dt << New Column( "Validation", values( [1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1] ) );
obj = Fit Model(
Validation( :Validation ),
Y( :Damping ),
Effects(
:CuSO4 & RS & Mixture, :Na2S2O3 & RS & Mixture, :Glyoxal & RS & Mixture, :CuSO4 * :Na2S2O3, :CuSO4 * :Glyoxal,
:CuSO4 * :Wavelength, :Na2S2O3 * :Glyoxal, :Na2S2O3 * :Wavelength, :Glyoxal * :Wavelength
),
No Intercept( 1 ),
Center Polynomials( 0 ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Pruned Forward Selection ), Validation Method( Validation Column ) ) )
);
rpt = obj << report;
fitstat = rpt[Outline Box( "Model Summary" )][Table Box( 2 )] << get as matrix;
nstep = (rpt[Outline Box( "Solution Path" )][FrameBox( 2 )] << Find Seg( Line Seg( 1 ) )) << get x values;
scl_NegLL_plot1 = ((rpt[Outline Box( "Solution Path" )][FrameBox( 2 )] << Find Seg( Line Seg( 2 ) )) << get y values)[nstep[1] + 1];
scl_NegLL_plot2 = ((rpt[Outline Box( "Solution Path" )][FrameBox( 2 )] << Find Seg( Line Seg( 3 ) )) << get y values)[nstep[1] + 1];
Close( dt, no save );
);
Code Explanation:
- Check if JMP is Pro.
- Open data table.
- Add "Validation" column.
- Fit generalized regression model.
- Specify response variable.
- Define model effects.
- Exclude intercept.
- Disable center polynomials.
- Use normal distribution.
- Perform pruned forward selection.
Example 18
Summary: Fits a Generalized Regression model to transform and analyze data, utilizing JMP Pro's advanced statistical capabilities.
Code:
If( Contains( JMP Product Name(), "Pro" ) > 0,
dt1 = Open("data_table.jmp");
obj = dt1 << Fit Model(
Y( Transform Column( "Log[Y]", Formula( Log( :Y ) ) ) ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run
);
dt2 = obj << Save Coding Table( 1 );
mY1 = dt1:Y << get values;
Current Data Table( dt2 );
mY2 = dt2:Name( "Log[Y]" ) << get values;
Close( dt1, no save );
Close( dt2, no save );
);
Code Explanation:
- Check for JMP Pro.
- Open data table;
- Fit Generalized Regression model.
- Transform Y using log.
- Include specified effects.
- Set Normal distribution.
- Run the model.
- Save coding table.
- Get original Y values.
- Get transformed Y values.
- Close original data table.
- Close coding table.
Example 19
Summary: Fits a generalized logistic regression model with binary outcome and multiple comparisons for gender, generating reports and adjusted p-values without saving the dataset.
Code:
If( Contains( JMP Product Name(), "Pro" ) > 0,
dt = Open("data_table.jmp");
obj1 = dt << Fit Model(
Y( :Y Binary ),
Target Level( "Low" ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Binomial" ),
Run( Fit( Estimation Method( "Logistic Regression" ), Validation Method( None ) ), )
);
rpt1 = obj1 << report;
obj1 << (Fit[1] << Multiple Comparisons(
Effect( Gender ),
Comparisons with Control(
1,
Control Level( "Gender:1" ),
Comparisons with Control Decision Chart( Control Differences Chart( 1, Point Options( "Show Needles" ) ) ),
Name( "Calculate Adjusted P-Values" )(1)
)
));
obj1 << (Fit[1] << Multiple Comparisons(
Effect( Gender ),
Comparisons with Overall Average(
1,
Comparisons with Overall Average Decision Chart( Control Differences Chart( 1, Point Options( "Show Needles" ) ) ),
Name( "Calculate Adjusted P-Values" )(1)
)
));
Close( dt, no save );
);
Code Explanation:
- Check for JMP Pro.
- Open data table;
- Fit model with binary outcome.
- Set target level to "Low".
- Include specified effects.
- Use Generalized Regression personality.
- Set distribution to Binomial.
- Run logistic regression without validation.
- Generate model report.
- Perform multiple comparisons for Gender.
- Compare with control level.
- Display control differences chart.
- Calculate adjusted p-values.
- Compare with overall average.
- Display overall average differences chart.
- Calculate adjusted p-values.
- Close dataset without saving.
Example 20
Summary: Fits a generalized regression model with ZI Negative Binomial distribution to a data table, utilizing Maximum Likelihood estimation and validation.
Code:
If( Contains( JMP Product Name(), "Pro" ) > 0,
dt = Open("data_table.jmp");
obj2 = Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run(
Fit(
Generalized Distribution( "ZI Negative Binomial" ),
Estimation Method( Maximum Likelihood ),
Validation Method( Validation Column ),
)
),
);
obj2 << (Fit[1] << Show Prediction Expression( 1 ));
Close( dt, no save );
);
Code Explanation:
- Check if JMP is Pro.
- Open data table;
- Launch Fit Model platform.
- Set validation method.
- Specify response variable.
- Define model effects.
- Choose Generalized Regression personality.
- Set Normal distribution.
- Fit model with ZI Negative Binomial.
- Use Maximum Likelihood estimation.
- Show prediction expression.
- Close dataset without saving.
Example 21
Summary: Fits a Generalized Regression model to predict Y, utilizing JMP Pro's capabilities for data manipulation and statistical analysis.
Code:
If( Contains( JMP Product Name(), "Pro" ) > 0,
dt = Open("data_table.jmp");
dt:age[1 :: 430] = .;
obj = dt << Fit Model(
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( "Maximum Likelihood" ), Validation Method( "None" ) ) )
);
obj << (Fit[1] << Plot Residual by Predicted( 1 ));
rpt = obj << report;
Close( dt, no save );
);
Code Explanation:
- Check if JMP Pro is installed.
- Open data table;
- Set first 430 age values to missing.
- Fit Generalized Regression model.
- Specify response variable Y.
- Include Age, Gender, BMI, BP, Total Cholesterol as effects.
- Use Normal distribution.
- Estimate using Maximum Likelihood.
- Plot residuals by predicted values.
- Close dataset without saving.
Example 22
Summary: Fits a generalized regression model with binomial distribution and BIC validation for Lasso and Elastic Net methods, extracting solution path summaries.
Code:
If( Contains( JMP Product Name(), "Pro" ) > 0,
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y Binary ),
Target Level( "Low" ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Binomial" ),
Run(
Fit( Estimation Method( "Lasso" ), Validation Method( "BIC" ), Show Solution Path Summary( 1 ) ),
Fit( Estimation Method( "Elastic Net" ), Validation Method( "BIC" ), Show Solution Path Summary( 1 ) )
)
);
rpt = obj << report;
test1 = Try(
rpt[Outline Box( "Binomial Lasso with BIC Validation" )][Outline Box( "Solution Path Summary" )][
Number Col Box( "Conditional Model Probability" )] << get as matrix,
"Cond. Model Prob. not available"
);
test2 = Try(
rpt[Outline Box( "Binomial Lasso with BIC Validation" )][Outline Box( "Solution Path Summary" )][Plot Col Box( 1 )] <<
get as matrix,
"Cond. Model Prob. not available"
);
test3 = Try(
rpt[Outline Box( "Binomial Elastic Net with BIC Validation" )][Outline Box( "Solution Path Summary" )][
Number Col Box( "Conditional Model Probability" )] << get as matrix,
"Cond. Model Prob. not available"
);
test4 = Try(
rpt[Outline Box( "Binomial Elastic Net with BIC Validation" )][Outline Box( "Solution Path Summary" )][Plot Col Box( 1 )] <<
get as matrix,
"Cond. Model Prob. not available"
);
Close( dt, no save );
);
Code Explanation:
- Check if JMP Pro.
- Open data table;
- Fit model with validation.
- Set response variable to binary.
- Define target level as "Low".
- Specify effects: Age, Gender, BMI, BP, Total Cholesterol, LDL, HDL, TCH, LTG, Glucose.
- Choose Generalized Regression personality.
- Set distribution to Binomial.
- Run fits for Lasso and Elastic Net methods.
- Extract solution path summaries.
- Close dataset without saving.
Example 23
Summary: Fits a generalized regression model to a data table using JMP Pro, with multiple estimation methods and validation techniques.
Code:
If( Contains( JMP Product Name(), "Pro" ) > 0,
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run(
Fit( Estimation Method( Best Subset ), Validation Method( AICc ), Force( [1 1 0 0 0 0 0 0 0 0 0] ) ),
Fit( Estimation Method( Best Subset ), Validation Method( BIC ), Force( [1 1 0 0 0 0 0 1 0 0 0] ) ),
Fit( Estimation Method( Best Subset ), Validation Method( Holdback, 0.3 ), Force( [1 0 0 0 0 0 0 1 0 0 0] ) ),
Fit( Estimation Method( Best Subset ), Validation Method( AICc ), Force( [1 1 1 1 1 1 1 1 1 1 1] ) ),
Fit( Estimation Method( Best Subset ), Validation Method( BIC ), Early Stopping, Force( [1 1 1 1 1 1 1 1 1 1 1] ) ),
Fit( Estimation Method( Best Subset ), Validation Method( Holdback, 0.3 ), Force( [1 1 1 1 1 1 1 1 1 1 1] ) )
),
);
rpt = obj << report;
Close( dt, no save );
);
Code Explanation:
- Check for JMP Pro.
- Open data table;
- Initiate Fit Model platform.
- Set response variable Y.
- Define predictor variables.
- Choose Generalized Regression personality.
- Specify Normal distribution.
- Run multiple fits with different methods.
- Extract model report.
- Close dataset without saving.
Example 24
Summary: Fits a generalized regression model to a data table, utilizing JMP Pro's Fit Model platform and specifying elastic net estimation method.
Code:
If( Contains( JMP Product Name(), "Pro" ) > 0,
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Elastic Net( Adaptive, Alpha( . ) ) ), Validation Method( "Validation Column" ) ) )
);
rpt = obj << report;
obj << Save Script to Report;
saved_script = rpt[Outline Box( "Generalized Regression for Y" )][Text Box( 1 )] << get text;
Close( dt, no save );
);
Code Explanation:
- Check if JMP Pro is installed.
- Open data table;
- Launch Fit Model platform.
- Set validation column.
- Specify response variable Y.
- Define model effects.
- Choose Generalized Regression personality.
- Select Normal distribution.
- Run model with Elastic Net method.
- Save script to report.
Example 25
Summary: Runs the fitting and comparison of generalized regression models for binary response variables with different target levels, utilizing JMP's Fit Model platform.
Code:
If( Contains( JMP Product Name(), "Pro" ) > 0,
dt = Open("data_table.jmp");
dt:Y[1 :: 10] = .;
obj1 = Fit Model(
Y( :Y Binary ),
Target Level( "High" ),
Effects( :Age, :Gender, :BMI, :BP, ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Binomial" ),
Run( Fit( Estimation Method( "Maximum Likelihood" ), Validation Method( "None" ), ROC Curve( 1 ) ) )
);
rpt1 = obj1 << report;
obj1 << (Fit[1] << Save Prediction Formula( 1 ));
obj2 = Fit Model(
Y( :Y Binary ),
Target Level( "Low" ),
Effects( :Age, :Gender, :BMI, :BP, ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Binomial" ),
Run( Fit( Estimation Method( "Maximum Likelihood" ), Validation Method( "None" ), ROC Curve( 1 ) ) )
);
rpt2 = obj2 << report;
obj2 << (Fit[1] << Save Prediction Formula( 1 ));
obj3 = Fit Model(
Y( :Y Binary ),
Target Level( "High" ),
Effects( :Age, :Gender, :BMI, :BP, ),
Personality( "Nominal Logistic" ),
Run( Positive Level( "High" ), ROC Curve( 1 ) )
);
rpt3 = obj3 << report;
obj3 << Save Probability Formula( 1 );
dt << Model Comparison( ROC Curve( 1 ) );
roc1 = rpt1[Outline Box( "ROC Curve for Y Binary = High" )][Number Col Box( "AUC" )] << get as matrix;
roc2 = rpt2[Outline Box( "ROC Curve for Y Binary = Low" )][Number Col Box( "AUC" )] << get as matrix;
roc3 = rpt3[Outline Box( "Receiver Operating Characteristic" )][Number Col Box( "AUC" )] << get as matrix;
Close( dt, no save );
);
Code Explanation:
- Check if JMP is Pro.
- Open data table;
- Set first 10 Y values to missing.
- Fit model for high target level.
- Extract model report.
- Save prediction formula.
- Fit model for low target level.
- Extract model report.
- Save prediction formula.
- Fit model using Nominal Logistic personality.
- Extract model report.
- Save probability formula.
- Compare models using ROC curve.
- Retrieve AUC from high target model.
- Retrieve AUC from low target model.
- Retrieve AUC from Nominal Logistic model.
- Close dataset without saving.
Example 26
Summary: Executes a generalized regression model with Lasso adaptive estimation and validation, utilizing the Fit Model platform in JMP Pro.
Code:
If( Contains( JMP Product Name(), "Pro" ) > 0,
dt = Open("data_table.jmp");
Log Capture(
obj = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run(
Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ) ),
Fit( Generalized Distribution( "Beta" ), Estimation Method( Lasso( Adaptive ) ), Validation Method( Validation Column ) )
)
)
);
Close( dt, no save );
);
Code Explanation:
- Check for JMP Pro.
- Open data table;
- Start logging output.
- Launch Fit Model platform.
- Set validation column.
- Define response variable.
- Specify model effects.
- Choose Generalized Regression personality.
- Select Normal distribution.
- Run Lasso Adaptive estimation with validation.
- Run Beta distribution with Lasso Adaptive estimation and validation.
- Close dataset without saving.
Example 27
Summary: Generalized regression analysis with adaptive and elastic net methods, extracting parameter estimates for original predictors and removing fits after each iteration.
Code:
If( Contains( JMP Product Name(), "Pro" ) > 0,
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :weight ),
Effects( :age, :sex, :height ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run
);
rpt = obj << report;
obj << (Fit[1] << remove fit);
For( i = 1, i <= 10, i++,
obj << Fit( Estimation Method( Lasso ), Validation Method( "Leave-One-Out" ) );
If( i == 1,
parmest0 = rpt[Outline Box( "Parameter Estimates for Original Predictors" )][Table Box( 1 )] << get as matrix,
parmest = rpt[Outline Box( "Parameter Estimates for Original Predictors" )][Table Box( 1 )] << get as matrix
);
obj << (Fit[1] << Remove fit);
);
For( i = 1, i <= 10, i++,
obj << Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( "Leave-One-Out" ) );
If( i == 1,
parmest0 = rpt[Outline Box( "Parameter Estimates for Original Predictors" )][Table Box( 1 )] << get as matrix,
parmest = rpt[Outline Box( "Parameter Estimates for Original Predictors" )][Table Box( 1 )] << get as matrix
);
obj << (Fit[1] << Remove fit);
);
For( i = 1, i <= 10, i++,
obj << Fit( Estimation Method( Elastic Net ), Validation Method( "Leave-One-Out" ) );
If( i == 1,
parmest0 = rpt[Outline Box( "Parameter Estimates for Original Predictors" )][Table Box( 1 )] << get as matrix,
parmest = rpt[Outline Box( "Parameter Estimates for Original Predictors" )][Table Box( 1 )] << get as matrix
);
obj << (Fit[1] << Remove fit);
);
For( i = 1, i <= 10, i++,
obj << Fit( Estimation Method( Elastic Net( Adaptive ) ), Validation Method( "Leave-One-Out" ) );
If( i == 1,
parmest0 = rpt[Outline Box( "Parameter Estimates for Original Predictors" )][Table Box( 1 )] << get as matrix,
parmest = rpt[Outline Box( "Parameter Estimates for Original Predictors" )][Table Box( 1 )] << get as matrix
);
obj << (Fit[1] << Remove fit);
);
Close( dt, no save );
);
Code Explanation:
- Check if JMP is Pro.
- Open data table;
- Fit model with weight as response.
- Use age, sex, height as effects.
- Apply Generalized Regression personality.
- Set Normal distribution.
- Run the model.
- Retrieve report object.
- Remove initial fit.
- Loop 10 times for Lasso method.
- Extract parameter estimates.
- Remove fit after each iteration.
- Loop 10 times for Adaptive Lasso method.
- Extract parameter estimates.
- Remove fit after each iteration.
- Loop 10 times for Elastic Net method.
- Extract parameter estimates.
- Remove fit after each iteration.
- Loop 10 times for Adaptive Elastic Net method.
- Extract parameter estimates.
- Remove fit after each iteration.
- Close the data table without saving.
Example 28
Summary: Fits and creates reports for a Generalized Regression model using Lasso estimation method with AICc validation, extracting Model Summary text for each fit.
Code:
If( Contains( JMP Product Name(), "Pro" ) > 0,
dt = Open("data_table.jmp");
Log Capture(
obj = dt << Fit Model(
Y( :Y ),
Effects( Factorial to Degree( :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG ) ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run(
Fit( Estimation Method( Lasso ), Validation Method( AICc ), Enforce Heredity ),
Fit( Estimation Method( Lasso ), Validation Method( AICc ), ),
Fit( Estimation Method( Lasso ), Validation Method( AICc ), Enforce Hereditory( 0 ), )
)
)
);
rpt = obj << report;
notes1 = Try( rpt[Outline Box( 6 )]["Model Summary"][Text Box( 1 )] << get text, 0 );
notes2 = Try( rpt[Outline Box( 12 )]["Model Summary"][Text Box( 1 )] << get text, 0 );
notes3 = Try( rpt[Outline Box( 18 )]["Model Summary"][Text Box( 1 )] << get text, 0 );
Close( dt, no save );
);
Code Explanation:
- Check if JMP Pro is installed.
- Open data table;
- Start log capture.
- Fit Generalized Regression model.
- Set response variable Y.
- Include factorial effects up to degree.
- Use Normal distribution.
- Run three Lasso fits with AICc validation.
- Extract Model Summary text for each fit.
- Close dataset without saving.
Example 29
Summary: Generalized regression analysis in JMP Pro, fitting a model to predict continuous outcomes based on multiple predictor effects and validating the results.
Code:
If( Contains( JMP Product Name(), "Pro" ) > 0,
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Validation( :Validation ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run(
Fit( Estimation Method( Pruned Forward Selection ), Validation Method( Validation Column ), Force( [1 1 0 0 0 0 0 0 0 0 0] ) )
)
);
rpt = obj << report;
string1 = rpt["Parameter Estimates for Original Predictors"][String Col Box( 2 )] << get;
Close( dt, no save );
);
Code Explanation:
- Check for JMP Pro.
- Open data table;
- Start Fit Model.
- Set response variable.
- Add predictor effects.
- Specify validation method.
- Choose Generalized Regression personality.
- Select Normal distribution.
- Run model with Pruned Forward Selection.
- Extract parameter estimates.
- Close dataset without saving.
Example 30
Summary: Runs the refitting and reporting of a Generalized Regression model in JMP Pro, utilizing Quantile Regression and adding new data rows.
Code:
If( Contains( JMP Product Name(), "Pro" ) > 0,
dt = Open("data_table.jmp");
obj1 = dt << Fit Model(
Y( :weight ),
Effects( :age, :sex, :height ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Quantile Regression" ),
Quantile( 0.5 ),
Run()
);
rpt1 = obj1 << report;
dt << Add rows( 200 );
obj2 = dt << Fit Model(
Y( :weight ),
Effects( :age, :sex, :height ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Quantile Regression" ),
Quantile( 0.5 ),
Run()
);
rpt2 = obj2 << report;
test1 = rpt1["Parameter Estimates for Original Predictors"][Table Box( 1 )] << get as matrix;
test2 = rpt2["Parameter Estimates for Original Predictors"][Table Box( 1 )] << get as matrix;
Close( dt, no save );
);
Code Explanation:
- Check if JMP is Pro.
- Open data table.
- Fit Generalized Regression model.
- Store model report.
- Add 200 rows to data table.
- Refit model with new data.
- Store updated model report.
- Extract parameter estimates from original report.
- Extract parameter estimates from updated report.
- Close data table without saving.
Example 31
Summary: Runs generalized regression modeling and quantile regression analysis across multiple datasets, utilizing JMP's Fit Model platform.
Code:
If( Contains( JMP Product Name(), "Pro" ) > 0,
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Validation( :Validation ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run(
Fit( Estimation Method( Pruned Forward Selection ), Validation Method( Validation Column ), Force( [1 1 0 0 0 0 0 0 0 0 0] ) )
)
);
rpt = obj << report;
string1 = rpt["Parameter Estimates for Original Predictors"][String Col Box( 2 )] << get;
Close( dt, no save );
);
If( Contains( JMP Product Name(), "Pro" ) > 0,
dt = Open("data_table.jmp");
obj1 = dt << Fit Model(
Y( :weight ),
Effects( :age, :sex, :height ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Quantile Regression" ),
Quantile( 0.5 ),
Run()
);
rpt1 = obj1 << report;
dt << Add rows( 200 );
obj2 = dt << Fit Model(
Y( :weight ),
Effects( :age, :sex, :height ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Quantile Regression" ),
Quantile( 0.5 ),
Run()
);
rpt2 = obj2 << report;
test1 = rpt1["Parameter Estimates for Original Predictors"][Table Box( 1 )] << get as matrix;
test2 = rpt2["Parameter Estimates for Original Predictors"][Table Box( 1 )] << get as matrix;
Close( dt, no save );
);
If( Contains( JMP Product Name(), "Pro" ) > 0,
dt = Open("data_table.jmp");
obj1 = dt << Fit Model(
Y( :Damping ),
Effects( :CuSO4 & RS & Mixture, :Na2S2O3 & RS & Mixture, :CuSO4 * :Na2S2O3, :Glyoxal ),
Center Polynomials( 0 ),
No Intercept( 0 ),
Personality( "Generalized Regression" ),
Run( Fit( Estimation Method( Forward Selection ), Validation Method( AICc ) ) )
);
obj1 << Save Script to Report( 1 );
rpt = obj1 << report;
script1 = rpt[Text Box( 1 )] << get text;
Close( dt, no save );
);
Code Explanation:
- Check if JMP is Pro.
- Open data table;
- Fit generalized regression model.
- Retrieve parameter estimates.
- Close data_table dataset.
- Check if JMP is Pro.
- Open data table;
- Fit quantile regression model.
- Add rows to Big Class dataset.
- Fit another quantile regression model.
- Retrieve parameter estimates.
- Close Big Class dataset.
- Check if JMP is Pro.
- Open data table;
- Fit generalized regression model.
- Save script to report.
- Retrieve report text.
- Close Mixture Data dataset.
Example 32
Summary: Fits a generalized regression model with specified effects, estimating parameters using SVEM forward selection and Lasso methods.
Code:
If( Contains( JMP Product Name(), "Pro" ) > 0,
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Y ),
Effects(
:p1 & Mixture,
:p2 & Mixture,
:p3 & Mixture,
:p1 * :p2,
:p1 * :p3,
:p2 * :p3,
Scheffe Cubic( :p1, :p2 ),
Scheffe Cubic( :p1, :p3 ),
:p1 * :p2 * :p3,
Scheffe Cubic( :p2, :p3 )
),
No Intercept( 1 ),
Center Polynomials( 0 ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run(
Fit( Estimation Method( SVEM Forward Selection( Samples( 200 ) ) ), Force( [1 1 1 0 0 0 0 0 0 0] ) ),
Fit( Estimation Method( SVEM Lasso( Samples( 200 ) ) ), Force( [1 1 1 0 0 0 0 0 0 0] ) )
)
);
rpt = obj << report;
est1 = rpt["Normal SVEM Forward Selection"]["Parameter Estimates"][Number Col Box( "Resampling Estimate" )] << get as matrix;
est2 = rpt["Normal SVEM Lasso"]["Parameter Estimates"][Number Col Box( "Resampling Estimate" )] << get as matrix;
Close( dt, no save );
);
Code Explanation:
- Check if JMP is Pro.
- Open data table.
- Fit model with specified effects.
- Disable intercept.
- Disable center polynomials.
- Set personality to Generalized Regression.
- Set distribution to Normal.
- Run forward selection estimation.
- Run Lasso estimation.
- Extract parameter estimates matrices.
Example 33
Summary: Fits generalized regression models with SVEM forward selection for ordinal and multinomial responses in JMP Pro, capturing logs for each model run.
Code:
If( JMP Product Name() == "Pro",
dt = Open("data_table.jmp");
b log = "SVEM is not available for Multinomial or Ordinal responses.";
log1 = Log Capture(
obj = dt << Fit Model(
Y( :Y Ordinal ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Multinomial" ),
Run(
Fit( Estimation Method( Lasso ), Validation Method( AICc ) ),
Fit( Estimation Method( SVEM Forward Selection( Samples( 5 ) ) ) )
)
)
);
log2 = Log Capture(
obj2 = dt << Fit Model(
Y( :Y Ordinal ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Ordinal Logistic" ),
Run(
Fit( Estimation Method( Lasso ), Validation Method( AICc ) ),
Fit( Estimation Method( SVEM Forward Selection( Samples( 5 ) ) ) )
)
)
);
dt:Y Ordinal << Modeling Type( "Nominal" );
log3 = Log Capture(
obj3 = dt << Fit Model(
Y( :Y Ordinal ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Multinomial" ),
Run(
Fit( Estimation Method( Elastic Net ), Validation Method( AICc ) ),
Fit( Estimation Method( SVEM Forward Selection( Samples( 5 ) ) ) )
)
)
);
Close( dt, no save );
);
Code Explanation:
- Check if JMP Product Name is "Pro".
- Open data table;
- Log message about SVEM availability.
- Capture log for first Fit Model run.
- Fit model with Multinomial distribution.
- Use Lasso and SVEM Forward Selection.
- Capture log for second Fit Model run.
- Fit model with Ordinal Logistic distribution.
- Use Lasso and SVEM Forward Selection.
- Change Y Ordinal modeling type to Nominal.
- Capture log for third Fit Model run.
- Fit model with Multinomial distribution.
- Use Elastic Net and SVEM Forward Selection.
- Close dataset without saving.
Example 34
Summary: Fits a Generalized Linear Mixed Model to analyze Grade data, considering Program as an effect and School and Class as random effects.
Code:
If( Contains( JMP Product Name(), "Pro" ),
dt = Open("data_table.jmp");
obj = dt << Fit Model(
Y( :Grade ),
Effects( :Program ),
Random Effects( :School, :Class[:School] ),
NoBounds( 0 ),
Personality( "Generalized Linear Mixed Model" ),
Generalized Distribution( "Binomial" ),
Run( Fit )
);
Log Capture( obj << (Fit[1] << Save Simulation Formula) );
formula1 = Char( Arg( Arg( Arg( Arg( dt:Grade Simulation Formula << get formula, 2 ), 1 ), 1 ), 2 ) );
Close( dt, no save );
);
Code Explanation:
- Check if JMP is Pro.
- Open data table;
- Fit Generalized Linear Mixed Model.
- Set response variable to Grade.
- Add Program as effect.
- Define School and Class as random effects.
- Set no bounds.
- Use Binomial distribution.
- Run the model fit.
- Save simulation formula.
Example 35
Summary: Runs the fitting and profiling of a generalized linear mixed model to analyze Defect data, utilizing fixed effects for Finishing Treatment and random effects for lot and unit interactions.
Code:
If( Contains( JMP Product Name(), "Pro" ),
dt = Open("data_table.jmp");
obj = Fit Model(
Y( :Defect ),
Effects( :Finishing Treatment ),
Random Effects(
Intercept[:lot] & Random Coefficients( 1 ), :Finishing Treatment[:lot] & Random Coefficients( 1 ), :lot * :Unit in Lot
),
NoBounds( 1 ),
Personality( "Generalized Linear Mixed Model" ),
Generalized Distribution( "Poisson" ),
Run(
Fit(
Conditional Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
"Conditional",
Finishing Treatment( 5, Lock( 0 ), Show( 1 ) ),
Lot( 1, Lock( 0 ), Show( 1 ) ),
Unit in Lot( 1, Lock( 0 ), Show( 1 ) )
)
)
)
)
);
rpt = obj << report;
pred1 = rpt["Conditional Model Profiler"][Text Box( 2 )] << get text;
obj << (Fit[1] << Conditional Profiler(
1,
Confidence Intervals( 0 ),
Term Value(
"Conditional",
Finishing Treatment( 5, Lock( 0 ), Show( 1 ) ),
Lot( 1, Lock( 0 ), Show( 1 ) ),
Unit in Lot( 1, Lock( 0 ), Show( 1 ) )
)
));
pred2 = rpt["Conditional Model Profiler"][Text Box( 2 )] << get text;
Close( dt, no save );
);
Code Explanation:
- Check if JMP Pro is installed.
- Open data table.
- Fit generalized linear mixed model.
- Set response variable.
- Define fixed effects.
- Specify random effects.
- Remove bounds.
- Choose Poisson distribution.
- Run the model fit.
- Generate conditional profiler.
- Extract first prediction text.
- Update profiler settings.
- Extract second prediction text.
- Close the data table without saving.
Example 36
Summary: Analyze a mixed model for weight by sex, generating reports and extracting covariance estimates from JMP Pro.
Code:
If( Contains( JMP Product Name(), "Pro" ),
dt = Open("data_table.jmp");
obj1 = dt << Fit Model(
Y( :weight ),
Effects( :sex ),
Repeated Effects( :sex ),
Repeated Structure( "Unequal Variances" ),
Personality( "Mixed Model" ),
Run
);
rpt1 = obj1 << report;
obj2 = dt << Distribution( Y( :weight ), By( :sex ), Stack( 1 ), Customize Summary Statistics( Variance( 1 ) ) );
rpt2 = obj2 << report;
b covparm = (rpt2[1][Outline Box( "weight" )][Outline Box( "Summary Statistics" )][Table Box( 1 )] << get as matrix)[7] |/ (rpt2[2][
Outline Box( "weight" )][Outline Box( "Summary Statistics" )][Table Box( 1 )] << get as matrix)[7];
covparm = rpt1[Outline Box( "Repeated Effects Covariance Parameter Estimates" )][Number Col Box( "Estimate" )] << get as matrix;
Close( dt, no save );
);
Code Explanation:
- Check if JMP Pro.
- Open data_table data
- Fit mixed model for weight.
- Extract report from fit model.
- Create distribution report by sex.
- Extract report from distribution.
- Calculate between covariance parameter.
- Extract covariance estimates from report.
- Close data table without saving.
Example 37
Summary: Fits a Probit 4P curve to algae density data, extracting parallel fit parameter estimates and SSE from test results, and performing nonlinear fitting with solution estimation.
Code:
If( Host is( "Mac" ) != 1,
dt = Open("data_table.jmp");
obj = dt << Fit Curve( Y( :Algae density ), X( :Days ), Group( :Treatment ), Fit Probit 4P( Test Parallelism ) );
rpt = obj << report;
paraEst = rpt[Outline Box( "Parallel Fit Parameter Estimates" )][Table Box( 1 )] << get as matrix;
sse = (rpt[Outline Box( "Test Results" )][Table Box( 1 )] << get as matrix)[1];
nlfit = dt << Nonlinear(
Y( :Algae density ),
Group( :Treatment ),
Model(
Parameter(
{a = 0.2, c = -42.3, d = 13.5, b_COOShaking = 4.4, b_CO2 = 5.7, b_Control = -2.1, b_Shaking = 5.6},
b = Match( :Treatment, "CO0 & Shaking", b_COOShaking, "CO2", b_CO2, "Control", b_Control, "Shaking", b_Shaking, . );
c + (d - c) * Normal Distribution( a * (:Days - b) );,
),
),
Newton,
Finish
);
rpt1 = nlfit << report;
est1 = (rpt1[Outline Box( "Solution" )][Table Box( 2 )] << get as matrix)[0, 1 :: 2];
sse1 = (rpt1[Outline Box( "Solution" )][Table Box( 1 )] << get as matrix)[1];
Close( dt, No Save );
);
Code Explanation:
- Check if host is Mac.
- Open data table.
- Fit curve using Probit 4P.
- Extract parallel fit parameter estimates.
- Extract SSE from test results.
- Perform nonlinear fitting.
- Extract solution estimates.
- Extract SSE from nonlinear fit.
- Close data table without saving.
Example 38
Summary: Runs text analysis and clustering in JMP Pro, generating a report with distribution of clusters and frequencies.
Code:
If( Contains( JMP Product Name(), "Pro" ),
dt = Open("data_table.jmp");
te = dt << Text Explorer(
Text Columns( :Final Narrative ),
Set Regex( Library( "Money" ), Library( "Words" ), Library( "HTML Link Grabber" ), Library( "Time" ), Library( "Numbers" ) ),
Language( "English" )
);
rpt = te << Report();
lsa = te << Latent Semantic Analysis(
Maximum Number of Terms( 10 ),
Minimum Term Frequency( 4 ),
Weighting( "TF IDF" ),
Number of Singular Vectors( 10 ),
Centering and Scaling( "Centered" )
);
clust = lsa << Cluster Documents( Number of Clusters( 5 ) );
rpt[Outline Box( "Clustering Documents" )][List Box( 2 )][Button Box( 2 )] << Click( 1 );
dist = dt << Distribution( Column( :Cluster ) );
rpt_dist = dist << Report();
levels = rpt_dist[Outline Box( "Frequencies" )][String Col Box( 1 )] << get;
last = levels[N Items( levels )];
If( last == "Total",
numclusts = Num( levels[N Items( levels ) - 1] )
);
Close( dt, nosave );
);
Code Explanation:
- Check for JMP Pro.
- Open data table;
- Initialize Text Explorer.
- Set regex libraries.
- Set language to English.
- Generate Text Explorer report.
- Perform Latent Semantic Analysis.
- Cluster documents into 5 groups.
- Click on clustering button.
- Create distribution of clusters.
- Extract cluster levels.
- Get last level name.
- Check if last level is "Total".
- Count number of clusters.
- Close dataset without saving.
Example 39
Summary: Runs life distribution analysis and updates censor code preference in JMP, utilizing the Life Distribution window and popup box items.
Code:
dt = Open("data_table.jmp");
If( Mod( Day Of Week( Today() ), 2 ),
dt:Censor << Delete Property( "Value Labels" )
);
lifedistribution( Censor( :Censor ) );
wn = Window( "Life Distribution" );
actvals = {};
For( i = 1, i <= wn[Popup Box( 2 )] << get menu count, i++,
actvals[i] = wn[Popup Box( 2 )] << get menu text( i )
);
values = Design Nom( :Censor << get values, <<Levels )[2];
labels = :Censor << get value labels;
If( !Is Empty( labels ),
lst = Arg( labels, 1 );
aa = Associative Array();
For( i = 1, i <= N Items( lst ), i++,
aa[Arg( lst[i], 1 )] = Arg( lst[i], 2 )
);
For( i = 1, i <= N Items( values ), i++,
values[i] = Char( aa[values[i]] )
);
,
For( i = 1, i <= N Items( values ), i++,
values[i] = Char( values[i] )
)
);
prefcode = Arg( Arg( Arg( Get Preferences( LifeDistribution( Censor Code ) ), 1 ), 1 ), 1 );
ccodes = values;
wn << close window;
Preference( LifeDistribution( Censor Code( "2.205" ) ) );
lifedistribution( Censor( :Censor ) );
wn = Window( "Life Distribution" );
actvals = {};
For( i = 1, i <= wn[Popup Box( 2 )] << get menu count, i++,
actvals[i] = wn[Popup Box( 2 )] << get menu text( i )
);
values = Design Nom( :Censor << get values, <<Levels )[2];
labels = :Censor << get value labels;
If( !Is Empty( labels ),
lst = Arg( labels, 1 );
aa = Associative Array();
For( i = 1, i <= N Items( lst ), i++,
aa[Arg( lst[i], 1 )] = Arg( lst[i], 2 )
);
For( i = 1, i <= N Items( values ), i++,
values[i] = Char( aa[values[i]] )
);
,
For( i = 1, i <= N Items( values ), i++,
values[i] = Char( values[i] )
)
);
prefcode = Arg( Arg( Arg( Get Preferences( LifeDistribution( Censor Code ) ), 1 ), 1 ), 1 );
ccodes = values;
wn << close window;
Close( dt, No Save );
Preference( LifeDistribution( Censor Code() ) );
Code Explanation:
- Open data table.
- Check if day is odd.
- Delete value labels if odd.
- Perform life distribution analysis.
- Open Life Distribution window.
- Initialize empty list for actual values.
- Loop through popup box items.
- Add menu texts to list.
- Get censor values and labels.
- Convert values to labels if available.
- Get current censor code preference.
- Set new censor code preference.
- Repeat steps 4-10 with new preference.
- Close data table without saving.
- Reset censor code preference.
Example 40
Summary: Creates a life distribution plot and updates censor code preferences based on today's day.
Code:
dt = Open("data_table.jmp");
If( Mod( Day Of Week( Today() ), 2 ),
dt:Censor << Delete Property( "Value Labels" )
);
lifedistribution( Censor( :Censor ) );
wn = Window( "Life Distribution" );
actvals = {};
For( i = 1, i <= wn[Popup Box( 2 )] << get menu count, i++,
actvals[i] = wn[Popup Box( 2 )] << get menu text( i )
);
values = Design Nom( :Censor << get values, <<Levels )[2];
labels = :Censor << get value labels;
If( !Is Empty( labels ),
lst = Arg( labels, 1 );
aa = Associative Array();
For( i = 1, i <= N Items( lst ), i++,
aa[Arg( lst[i], 1 )] = Arg( lst[i], 2 )
);
For( i = 1, i <= N Items( values ), i++,
values[i] = Char( aa[values[i]] )
);
,
For( i = 1, i <= N Items( values ), i++,
values[i] = Char( values[i] )
)
);
prefcode = Arg( Arg( Arg( Get Preferences( LifeDistribution( Censor Code ) ), 1 ), 1 ), 1 );
ccodes = values;
wn << close window;
Preference( LifeDistribution( Censor Code( "2.205" ) ) );
lifedistribution( Censor( :Censor ) );
wn = Window( "Life Distribution" );
actvals = {};
For( i = 1, i <= wn[Popup Box( 2 )] << get menu count, i++,
actvals[i] = wn[Popup Box( 2 )] << get menu text( i )
);
values = Design Nom( :Censor << get values, <<Levels )[2];
labels = :Censor << get value labels;
If( !Is Empty( labels ),
lst = Arg( labels, 1 );
aa = Associative Array();
For( i = 1, i <= N Items( lst ), i++,
aa[Arg( lst[i], 1 )] = Arg( lst[i], 2 )
);
For( i = 1, i <= N Items( values ), i++,
values[i] = Char( aa[values[i]] )
);
,
For( i = 1, i <= N Items( values ), i++,
values[i] = Char( values[i] )
)
);
prefcode = Arg( Arg( Arg( Get Preferences( LifeDistribution( Censor Code ) ), 1 ), 1 ), 1 );
ccodes = values;
wn << close window;
Code Explanation:
- Open data table;
- Check if today's day is odd.
- Remove value labels if day is odd.
- Create life distribution plot.
- Capture popup box items.
- Retrieve censor values and labels.
- Convert values to labels if available.
- Store current censor code preference.
- Set new censor code preference.
- Reopen life distribution plot.
Distribution using New Window
Example 1
Summary: Creates a new window with two outline boxes, displaying distributions for weight and age, as well as a Graph Builder element to visualize the relationship between height, age, and sex.
Code:
dt = Open("data_table.jmp");
nw = New Window( "test",
ob1 = Outline Box( "Dist1", Distribution( Continuous Distribution( Column( :weight ) ), Nominal Distribution( Column( :age ) ) ) ),
ob2 = Outline Box( "GB1",
Graph Builder(
Show Control Panel( 0 ),
Variables( X( (:height), Size( 0, 21 ) ), Y( :age, Size( 0, 22 ) ), Group X( :sex ) ),
Elements( Histogram( X, Y, Legend( 2 ) ) )
)
)
);
Code Explanation:
- Open data table.
- Create new window named "test".
- Add outline box "Dist1".
- Display distribution for weight.
- Display distribution for age.
- Add outline box "GB1".
- Initialize Graph Builder.
- Hide control panel.
- Set X variable: height.
- Set Y variable: age.
- Group by sex.
- Add histogram element.
Example 2
Summary: Generates a histogram analysis for continuous variable :weight, displaying summary statistics and count axis with percentages and counts.
Code:
Open("data_table.jmp");
New Window( "Histogram Test",
Distribution(
Stack( 1 ),
Continuous Distribution(
Column( :weight ),
Quantiles( 0 ),
Summary Statistics( 0 ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Count Axis( 1 ),
Show Percents( 1 ),
Show Counts( 1 ),
Outlier Box Plot( 0 )
),
SendToReport( Dispatch( {"weight"}, "Distrib Histogram", FrameBox, {Frame Size( 368, 246 )} ) )
),
Graph Builder( Show Control Panel( 0 ), Variables( X( :weight ) ), Elements( Histogram( X, Legend( 2 ), Horizontal ) ) )
);
Code Explanation:
- Open data table.
- Create new window titled "Histogram Test".
- Generate distribution analysis.
- Stack distributions vertically.
- Analyze continuous variable :weight.
- Hide quantiles and summary statistics.
- Arrange layout horizontally.
- Enable count axis.
- Display percentages and counts.
- Disable outlier box plot.
- Set frame size for histogram.
- Create graph builder.
- Hide control panel.
- Set X variable to :weight.
- Add histogram element.
- Customize legend and orientation.
Example 3
Summary: Creates a histogram to visualize the distribution of weight data, utilizing Graph Builder and Distribution platforms.
Code:
Open("data_table.jmp");
New Window( "Histogram",
Graph Builder( Show Control Panel( 0 ), Variables( X( :weight ) ), Elements( Histogram( X, Legend( 2 ), Horizontal ) ) ),
Distribution(
Stack( 1 ),
Continuous Distribution(
Column( :weight ),
Quantiles( 0 ),
Summary Statistics( 0 ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Count Axis( 1 ),
Show Percents( 1 ),
Show Counts( 1 ),
Outlier Box Plot( 0 )
),
SendToReport( Dispatch( {"weight"}, "Distrib Histogram", FrameBox, {Frame Size( 368, 246 )} ) )
),
);
Code Explanation:
- Open data table.
- Create new window.
- Add Graph Builder.
- Hide control panel.
- Set X variable to weight.
- Add histogram element.
- Enable legend.
- Align histogram horizontally.
- Add Distribution platform.
- Configure distribution settings.
Example 4
Summary: Visualizes and analyzes weight distribution in a new window, displaying summary statistics, count axis, and percents.
Code:
Open("data_table.jmp");
New Window( "Distribution",
Distribution(
Stack( 1 ),
Continuous Distribution(
Column( :weight ),
Quantiles( 0 ),
Summary Statistics( 0 ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Count Axis( 1 ),
Show Percents( 1 ),
Show Counts( 1 ),
Outlier Box Plot( 0 )
),
SendToReport( Dispatch( {"weight"}, "Distrib Histogram", FrameBox, {Frame Size( 368, 246 )} ) )
),
Distribution(
Stack( 1 ),
Continuous Distribution(
Column( :weight ),
Quantiles( 0 ),
Summary Statistics( 0 ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Count Axis( 1 ),
Show Counts( 1 ),
Outlier Box Plot( 0 )
),
SendToReport( Dispatch( {"weight"}, "Distrib Histogram", FrameBox, {Frame Size( 368, 246 )} ) )
)
);
Code Explanation:
- Open data table;
- Create new window named "Distribution".
- Display weight distribution.
- Disable quantiles summary statistics.
- Enable horizontal layout.
- Disable vertical orientation.
- Enable count axis.
- Show percents.
- Show counts.
- Disable outlier box plot.
Example 5
Summary: Creates a new window with a horizontal list box displaying distributions for weight and age, filtered by age and sex.
Code:
Open("data_table.jmp");
nw = New Window( "Try DF",
H List Box(
Distribution( Continuous Distribution( Column( :weight ) ), Nominal Distribution( Column( :age ) ) ),
Current Data Table() << Data Filter( Add Filter( Columns( :Name( "age" ), :Name( "sex" ) ), Mode( Show( 1 ), Include( 1 ) ) ) )
)
);
nw << Close window;
Code Explanation:
- Open data table.
- Create new window named "Try DF".
- Add horizontal list box.
- Display distribution for weight.
- Display distribution for age.
- Add data filter.
- Set filter columns: age, sex.
- Show filter initially.
- Include filter initially.
- Close the window.
Example 6
Summary: Creates a new window for filtering data, displaying distributions for weight and age, and updating a text box to display the number of selected rows.
Code:
dt1 = Open("data_table.jmp");
New Window( "filter test",
H List Box(
V List Box(
t1 = Text Box( "0 Rows Selected" ),
dt1 << Distribution( Continuous Distribution( Column( :weight ) ), Nominal Distribution( Column( :age ) ) )
)
)
);
rebindHandlers = Function( {},
Eval(
Substitute(
Expr(
rsh = dt1 << Make Row State Handler( _func )
),
Expr( _func ), Substitute( rsFunc[1], Expr( updateFunc ), Name Expr( updatetext1 ) )
)
)
);
updatetext1 = Function( {},
{rs1, n1, ii},
rebindHandlers();
rs1 = dt1 << Get Row States();
n1 = 0;
For( ii = 1, ii <= N Rows( rs1 ), ii++,
If( Selected( As Row State( rs1[ii] ) ),
n1
++)
);
t1 << Set Text( Char( n1 ) || " Rows Selected" );
);
rsFunc = {Function( {a}, If( Is Matrix( a ), updateFunc() ) )};
Eval(
Substitute(
Expr(
rsh = dt1 << Make Row State Handler( _func )
),
Expr( _func ), Substitute( rsFunc[1], Expr( updateFunc ), Name Expr( updatetext1 ) )
)
);
dt1 << Data Filter( Location( {563, 44} ), Add Filter( columns( :sex ), Where( :sex == "F" ) ) );
dt1 << get row states;
Code Explanation:
- Open data table.
- Create new window for filtering.
- Add vertical list box to window.
- Add text box to display selected rows.
- Display distributions for weight and age.
- Define function to rebind handlers.
- Define function to update text based on selection.
- Create row state handler function.
- Apply data filter for female sex.
- Retrieve row states from table.
Example 7
Summary: Process of opening a data table, creating a new window with an outline box, appending distribution analysis to the outline box, and renaming the data table.
Code:
dt = Open("data_table.jmp");
wNW = New Window( "windowName", db = Outline Box( "" ) );
db << Append( dt << Distribution( Continuous Distribution( Column( :height ) ), ) );
val3 = wNW << GetWindowTitle;
dt << SetName( "newNames" );
val4 = wNW << GetWindowTitle;
Code Explanation:
- Open data table.
- Create new window.
- Add outline box to window.
- Append distribution analysis to outline box.
- Get window title.
- Rename data table.
- Get updated window title.
Example 8
Summary: Process of renaming a data table, filtering by a specific name, and generating a distribution analysis with local data filtering.
Code:
dt = Open("data_table.jmp");
wNW = New Window( "windowName", db = Outline Box( "" ) );
val5 = wNW << GetWindowTitle;
dt << SetName( "newName" );
db << Append(
dt << Distribution(
Continuous Distribution( Column( :height ) ),
Local Data Filter(
Close Outline( 1 ),
Add Filter(
columns( :name ),
Where( :name == "ROBERT" ),
Display( :name, N Items( 15 ), Size( 161, 255 ), Find( Set Text( "" ) ) )
)
)
)
);
val6 = wNW << GetWindowTitle;
Code Explanation:
- Open data table.
- Create new window.
- Get window title.
- Rename data table.
- Append distribution analysis.
- Filter by name "ROBERT".
- Append local data filter.
- Get window title again.
Example 9
Summary: Runs the filtering process for a data table, displaying the number of excluded rows in a text box.
Code:
dt = Open("data_table.jmp");
New Window( "filter test",
Data Filter Context Box(
V List Box(
t = Text Box( "0 Rows Excluded" ),
Distribution( Continuous Distribution( Column( :weight ) ), Nominal Distribution( Column( :age ) ) )
)
)
);
updatetext = Function( {},
rs = t << Get Row States( dt );
n = 0;
For( ii = 1, ii <= N Rows( rs ), ii++,
If( Excluded( As Row State( rs[ii] ) ),
n
++)
);
t << Set Text( Char( n ) || " Rows Excluded" );
);
rsupdate = Function( {a},
If( Is Matrix( a ),
updatetext()
)
);
rsh = t << Make Row State Handler( dt, rsupdate );
updatetext();
Code Explanation:
- Open data table;
- Create new window titled "filter test".
- Add data filter context box.
- Insert vertical list box.
- Add text box for row count.
- Add distribution for weight and age.
- Define function
updatetext. - Get row states from text box.
- Initialize excluded row counter.
- Loop through row states.
- Increment counter for excluded rows.
- Update text box with excluded row count.
- Define function
rsupdate. - Check if input is matrix.
- Call
updatetextif true. - Create row state handler.
- Call
updatetextinitially.
Example 10
Summary: Creates a histogram to visualize the distribution of weight data, including summary statistics and outlier detection, within a new JMP window.
Code:
Open("data_table.jmp");
New Window( "Histogram",
Graph Builder( Show Control Panel( 0 ), Variables( X( :weight ) ), Elements( Histogram( X, Legend( 2 ), Horizontal ) ) ),
H List Box(
Distribution(
Stack( 1 ),
Continuous Distribution(
Column( :weight ),
Quantiles( 0 ),
Summary Statistics( 0 ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Count Axis( 1 ),
Show Percents( 1 ),
Show Counts( 1 ),
Outlier Box Plot( 0 )
),
SendToReport( Dispatch( {"weight"}, "Distrib Histogram", FrameBox, {Frame Size( 368, 246 )} ) )
),
Graph Builder(
Size( 400, 300 ),
Show Control Panel( 0 ),
Variables( X( :weight ), Group Y( :age ) ),
Elements( Histogram( X, Legend( 5 ) ) )
)
)
);
Code Explanation:
- Open data table;
- Create new window titled "Histogram".
- Initialize Graph Builder.
- Hide control panel.
- Set X variable to :weight.
- Add histogram element.
- Create horizontal list box.
- Insert distribution analysis.
- Configure continuous distribution settings.
- Adjust report size for histogram.
Example 11
Summary: Generates a distribution analysis for continuous and nominal variables, with supplementary rows for subject and gender, and detailed coordinates and scaling for the first three dimensions.
Code:
dt = Open("data_table.jmp");
New Window( "test",
testPlat = dt << Distribution(
Continuous Distribution( Column( :weight ) ),
Nominal Distribution( Column( :age ) ),
SendToReport( Dispatch( {}, "Distributions", OutlineBox, {Set Title( "Custom" )} ) )
)
);
testRedo = Report( testPlat << Redo Analysis );
Code Explanation:
- Open data table;
- Create new window named "test".
- Generate distribution analysis.
- Analyze continuous column "weight".
- Analyze nominal column "age".
- Set outline box title to "Custom".
- Store redo analysis report.
Example 12
Summary: Process of opening a data table, generating a distribution plot, and saving the journal content.
Code:
dt = Open("data_table.jmp");
nw = New Window( "test", Distribution( Continuous Distribution( Column( :age ) ) ) );
nw << journal window( freeze all );
nw << close window;
Close( dt, nosave );
Current Journal() << save journal( "$TEMP\journal freeze problem.jrn" );
Current Journal() << close window;
Code Explanation:
- Open data table.
- Create new window.
- Generate distribution plot.
- Freeze all journal content.
- Close plot window.
- Close data table.
- Save current journal.
- Close journal window.
Example 13
Summary: Creates a new window named 'test' and generates a distribution analysis for age, freezing all elements in the journal before closing the window.
Code:
Open("data_table.jmp");
nw = New Window( "test", Distribution( Continuous Distribution( Column( :age ) ) ) );
nw << journal window( freeze all );
nw << close window;
Code Explanation:
- Open data table;
- Create new window named "test".
- Generate distribution analysis for age.
- Freeze all elements in journal.
- Close the window.
Distribution using For Each
Example 1
Summary: Creates distribution analysis reports for continuous data, applying sample-specific presets and closing unnecessary windows.
Code:
plat_samples = ["Continuous Distribution" => {"One-Sample t Test", "Check Normality", "Extended Summary Statistics",
"Focus on Distribution", "Publication Simple Histogram"}, => {}];
dt = Open("data_table.jmp");
For Each( {sample}, plat_samples["Continuous Distribution"],
obj = dt << Distribution( Column( :Weight ) );
obj << Set Report Title( sample );
obj = obj[1];
Eval(
Eval Expr(
With Window Handler(
obj << Apply Preset( "Sample Presets", Expr( sample ) ),
Function( {window},
If( Contains( window << get window title, "Test Mean" ),
window << close window()
)
)
)
)
);
);
Code Explanation:
- Define presets for continuous distribution.
- Open data table;
- Loop through each sample preset.
- Create distribution analysis for Weight column.
- Set report title to current sample.
- Access first report element.
- Apply preset to distribution analysis.
- Use window handler for preset application.
- Close window if title contains "Test Mean".
- End loop.
Example 2
Summary: Creates and customizes distribution plots for nominal data samples, applying presets to visualize Age column distributions with interactive window handling.
Code:
plat_samples = ["Nominal Distribution" => {"Basic Plot and Table", "Publication Simple Histogram"}, => {}];
dt = Open("data_table.jmp");
For Each( {sample}, plat_samples["Nominal Distribution"],
obj = dt << Distribution( Column( :Age ) );
obj << Set Report Title( sample );
obj = obj[1];
Eval(
Eval Expr(
With Window Handler(
obj << Apply Preset( "Sample Presets", Expr( sample ) ),
Function( {window},
If( Contains( window << get window title, "Test Mean" ),
window << close window()
)
)
)
)
);
);
Code Explanation:
- Define presets for analysis.
- Open data table;
- Iterate over nominal distribution samples.
- Create distribution object for Age column.
- Set report title to current sample.
- Access first element of distribution object.
- Apply preset to distribution object.
- Handle window events during preset application.
- Close window if title contains "Test Mean".
- End loop for each sample.
Distribution using Select Where
Example 1
Summary: Analyze and visualize a subset of data, focusing on Body System or Organ Class and Age variables, with customized plot markers.
Code:
dt = Open("data_table.jmp");
dt << Select Where( :Domain Abbreviation == "DM" );
dt2 = dt << Subset( Selected Rows, link to original data table( 1 ) );
dt2 << Clear Row States;
dt2 << Distribution(
Nominal Distribution(
Column( :Body System or Organ Class ),
Frequencies( 0 ),
Histogram( 0 ),
Mosaic Plot( 1 ),
Order By( "Count Ascending" )
),
Continuous Distribution( Column( :Age ), Quantiles( 0 ), Summary Statistics( 0 ), Histogram( 0 ) ),
SendToReport( Dispatch( {"Age"}, "Distrib Outlier Box", FrameBox, {DispatchSeg( Marker Seg( 1 ), {Marker( "FilledCircle" )} )} ) )
);
Code Explanation:
- Open data table;
- Select rows where Domain Abbreviation is DM.
- Create subset of selected rows.
- Clear row states in subset.
- Run Distribution analysis on subset.
- Analyze Body System or Organ Class with Mosaic Plot.
- Analyze Age with Quantiles and Summary Statistics.
- Customize Age plot with FilledCircle markers.
- Send report to destination.
- End script execution.
Example 2
Summary: Analyze a data table by selecting rows where age is greater than 50, hiding selected rows, and creating a distribution object for multiple columns.
Code:
dt under test = Open("data_table.jmp");
dt under test << Select Where( :age > 50 );
dt under test << Hide;
obj = dt under test << Distribution(
Nominal Distribution( Column( :sex ) ),
Nominal Distribution( Column( :marital status ) ),
Continuous Distribution( Column( :age ) ),
Nominal Distribution( Column( :country ) ),
Nominal Distribution( Column( :size ) ),
Nominal Distribution( Column( :type ) )
);
Code Explanation:
- Open data table;
- Select rows where age > 50.
- Hide selected rows.
- Create Distribution object.
- Analyze sex column.
- Analyze marital status column.
- Analyze age column.
- Analyze country column.
- Analyze size column.
- Analyze type column.
Example 3
Summary: Analyze a subset of data to visualize the distribution of nominal and continuous variables, including a mosaic plot and histogram.
Code:
dt = Open("data_table.jmp");
dt << Select Where( :Domain Abbreviation == "DM" );
dt << Subset( Selected Rows, link to original data table( 1 ) );
dt << Clear Select;
Distribution(
Nominal Distribution(
Column( :Body System or Organ Class ),
Frequencies( 0 ),
Histogram( 0 ),
Mosaic Plot( 1 ),
Order By( "Count Ascending" )
),
Continuous Distribution( Column( :Age ), Quantiles( 0 ), Summary Statistics( 0 ), Histogram( 0 ) ),
SendToReport( Dispatch( {"Age"}, "Distrib Outlier Box", FrameBox, {DispatchSeg( Marker Seg( 1 ), {Marker( "FilledCircle" )} )} ) )
);
Code Explanation:
- Open table.
- Select rows.
- Subset selected rows.
- Clear selection.
- Create distribution analysis.
- Analyze nominal column.
- Disable frequencies.
- Disable histogram.
- Enable mosaic plot.
- Order by count ascending.
Distribution using Column
Example 1
Summary: Analyze body system frequency and age distribution, generating a mosaic plot for body systems and sending the results to a report.
Code:
dt = Open("data_table.jmp");
subset = dt << subset( by( Column( "Domain Abbreviation" ) ), linked( 1 ) );
myDt = Data Table("data_table");
myDt << Distribution(
Nominal Distribution(
Column( :Body System or Organ Class ),
Frequencies( 0 ),
Histogram( 0 ),
Mosaic Plot( 1 ),
Order By( "Count Ascending" )
),
Continuous Distribution( Column( :Age ), Quantiles( 0 ), Summary Statistics( 0 ), Histogram( 0 ) ),
SendToReport( Dispatch( {"Age"}, "Distrib Outlier Box", FrameBox, {DispatchSeg( Marker Seg( 1 ), {Marker( "FilledCircle" )} )} ) )
);
Code Explanation:
- Open data table.
- Create subset by domain.
- Select specific subset.
- Generate distribution analysis.
- Analyze body system frequency.
- Disable histogram for body system.
- Enable mosaic plot for body system.
- Sort body system by count.
- Analyze age distribution.
- Disable quantiles for age.
Example 2
Summary: Performs process screening analysis on height and weight variables, utilizing Weibull and Exponential distributions, and generates a report with individual and moving range control charts.
Code:
dt = Open("data_table.jmp");
Column( dt, "height" ) << set property( "Distribution", Distribution( Weibull ) );
Column( dt, "weight" ) << set property( "Process Capability Distribution", Process Capability Distribution( Exponential ) );
obj = dt << Process Screening( Process Variables( :height, :weight ), Control Chart Type( "Indiv and MR" ) );
rpt = obj << report;
Code Explanation:
- Open data table.
- Set height column to Weibull distribution.
- Set weight column to Exponential process capability.
- Perform Process Screening on height and weight.
- Use Individual and Moving Range control chart type.
- Generate report from Process Screening.
Example 3
Summary: Fits a Lognormal distribution to a dataset, extracting probability estimates and generating a report with statistics.
Code:
dt = Open("data_table.jmp");
Column( dt, "Temp" ) << Set Modeling Type( Ordinal );
obj = dt << Fit Life by X( Distribution( Lognormal ), Y( :Time ), X( :Temp ), Censor( :censor ), Censor Code( 1 ), );
rpt = obj << report;
scptObj = rpt[Outline Box( "Lognormal Results" )][Tab Page Box( 1 )][Outline Box( "Statistics" )] << get scriptable object;
scptObj << Save Probability Estimates;
_mat = dt << get as matrix( {9} );
Code Explanation:
- Open data table.
- Set "Temp" column as ordinal.
- Fit life by X using Lognormal distribution.
- Extract report from fit object.
- Access Lognormal Results outline box.
- Access Statistics tab page box.
- Get scriptable object for statistics.
- Save probability estimates.
- Retrieve matrix from data table.
Example 4
Summary: Process of setting detection limits for a column, fitting an exponential distribution to continuous data, and generating a report with statistical results.
Code:
dt = Open("data_table.jmp");
Column( dt, "TOTAL DAILY DOSE" ) << Set Property( "Detection Limits", {0, 40} );
obj = dt << Distribution( Continuous Distribution( Column( :TOTAL DAILY DOSE ), Fit Exponential ) );
rpt = obj << report;
c = 1;
Code Explanation:
- Open data table.
- Set detection limits for column.
- Fit exponential distribution.
- Generate distribution report.
- Initialize counter variable.
Example 5
Summary: Runs the detection limits for 'Multiple Choice Year2' and performs a continuous distribution analysis, generating a report object.
Code:
dt = Open("data_table.jmp");
Column( dt, "Multiple Choice Year2" ) << Set Property( "Detection Limits", {3, 9} );
obj = dt << Distribution( Continuous Distribution( Column( :Multiple Choice Year2 ), Fit All ) );
rpt = obj << report;
c = 1;
Try( actAICc = preorder2( rpt, {"AICc"} )[1], c = 2 );
Code Explanation:
- Open data table;
- Set detection limits for "Multiple Choice Year2".
- Create distribution analysis.
- Retrieve report object.
- Initialize counter c to 1.
- Try to extract AICc value.
- If AICc extraction fails, set c to 2.
Example 6
Summary: Analyze a continuous distribution in a JMP data table, setting detection limits and fitting a Beta model if running on Pro version.
Code:
dt = Open("data_table.jmp");
Column( dt, "caliper" ) << Set Property( "Detection Limits", {.2, .5} );
obj = dt << Distribution( Continuous Distribution( Column( :caliper ), Fit Beta ) );
If( Contains( JMP Product Name(), "Pro" ) > 0,
obj2 = dt << Fit Model(
Y( :caliper ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Beta" ),
Run( Fit( Estimation Method( Maximum Likelihood ), Validation Method( None ) ) )
);
rpt = obj << report;
rpt2 = obj2 << report;
);
Code Explanation:
- Open table.
- Set detection limits.
- Create distribution analysis.
- Check JMP version.
- Fit model if Pro version.
- Retrieve distribution report.
- Retrieve model report.
Example 7
Summary: Process of setting a Gamma distribution for the 'weight' column and generating a report object, allowing for further analysis and visualization.
Code:
dt = Open("data_table.jmp");
Column( dt, "weight" ) << Set Property( "Distribution", Gamma );
obj = dt << Distribution( Continuous Distribution( Column( :weight ) ) );
rpt = obj << report;
Code Explanation:
- Open data table.
- Set weight column distribution.
- Run distribution analysis.
- Generate report object.
Example 8
Summary: Analyzes and creates reports for GDP per Capita data by fitting a Weibull distribution and setting detection limits.
Code:
dt = Open("data_table.jmp");
Column( dt, "GDP per Capita" ) << Set Property( "Detection Limits", {10, 40} );
obj = dt << Distribution( Continuous Distribution( Column( :GDP per Capita ), Fit Weibull ) );
rpt = obj << report;
Code Explanation:
- Open data table;
- Set detection limits for GDP per Capita.
- Create distribution object for GDP per Capita.
- Fit Weibull distribution to data.
- Generate report from distribution analysis.
Example 9
Summary: Analyze continuous distribution by grouping data based on a renamed column, utilizing the Distribution platform in JMP.
Code:
dt = Open("data_table.jmp");
Column( dt, "weight" ) << set name( "Weight/lbs" );
obj = dt << Distribution( Continuous Distribution( Column( :height ) ), By( :Name( "Weight/lbs" ) ) );
Code Explanation:
- Open data table.
- Rename "weight" column.
- Create distribution analysis.
- Analyze continuous distribution.
- Group by renamed weight column.
Distribution using Random Reset
Example 1
Summary: Fits a generalized regression model to predict Oxy using Weight, Runtime, RunPulse, RstPulse, and MaxPulse as predictors, with Elastic Net estimation method and Holdback validation.
Code:
Random Reset( 47 );
dt = Open("data_table.jmp");
obj = Fit Model(
Y( :Oxy ),
Effects( :Weight, :Runtime, :RunPulse, :RstPulse, :MaxPulse ),
Personality( Generalized Regression ),
Generalized Distribution( Normal ),
Run(
Fit(
Estimation Method( Elastic Net( Adaptive ) ),
Validation Method( Holdback, 0.3 ),
Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
Weight( 77.445, Lock( 0 ), Show( 1 ) ),
Runtime( 10.5861, Lock( 0 ), Show( 1 ) ),
RunPulse( 169.645, Lock( 0 ), Show( 1 ) ),
RstPulse( 53.452, Lock( 0 ), Show( 1 ) ),
MaxPulse( 173.774, Lock( 0 ), Show( 1 ) )
)
),
Plot Actual by Predicted( 1 ),
Covariance of Estimates( 1 ),
Correlation of Estimates( 1 )
)
),
SendToReport( Dispatch( {"Normal Adaptive Elastic Net with Holdback Validation"}, "Effect Tests", OutlineBox, {Close( 0 )} ) )
);
Code Explanation:
- Set random seed.
- Open data table;
- Define model with Oxy as response.
- Include five predictors: Weight, Runtime, RunPulse, RstPulse, MaxPulse.
- Use Generalized Regression personality.
- Specify Normal distribution.
- Run model with Elastic Net method.
- Use Holdback validation with 30% holdback.
- Generate profiler with confidence intervals.
- Close Effect Tests report section.
Example 2
Summary: Fits a generalized regression model with Lasso estimation to a dataset, generating frequency data and extracting parameter estimates.
Code:
dt = Open("data_table.jmp");
Random Reset( 135 );
vec = 0 |/ J( N Rows( dt ) - 1, 1, Random Integer( 1, 4 ) );
dt << New Column( "Freq", Numeric, Continuous, Set Values( vec ) );
fm = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Freq( :Freq ),
Personality( Generalized Regression ),
Generalized Distribution( Normal ),
Run( Fit( Estimation Method( Lasso( Adaptive, Linear Grid ) ), Validation Method( Validation Column ) ) )
);
vec = Report( fm )[Outline Box( "Parameter Estimates for Original Predictors" )][Table Box( 2 )][Number Col Box( "Estimate" )] <<
get as matrix;
Code Explanation:
- Open data table;
- Reset random seed.
- Generate random frequency vector.
- Add frequency column to dataset.
- Initiate Fit Model.
- Specify validation column.
- Define response variable.
- List predictor variables.
- Use frequency column.
- Select Generalized Regression personality.
- Choose Normal distribution.
- Run model with Lasso estimation.
- Extract parameter estimates.
Example 3
Summary: Fits and creates reports for generalized regression models with Weibull distribution and Ridge estimation method, utilizing holdback validation and retrieving solution paths and training negative log-likelihood.
Code:
dt = Open("data_table.jmp");
Random Reset( 5469122 );
obj = dt << Fit Model(
Censor( :censor ),
Censor Code( "1" ),
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Weibull" ),
Run( Fit( Estimation Method( Ridge( Linear Grid ) ), Validation Method( Holdback, 0.3 ) ) )
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
tnll = obj << (fit[1] << gettrainingnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
obj << closewindow;
obj = dt << Fit Model(
Censor( :censor ),
Censor Code( "1" ),
Y( :Time ),
Effects( :Cell Type, :Treatment, :Prior, :Age, :Diag Time, :KPS ),
Personality( "Generalized Regression" ),
Generalized Distribution( "LogNormal" ),
Run( set random seed( 5469122 ), Fit( Estimation Method( Ridge( Linear Grid ) ), Validation Method( Holdback, 0.3 ) ) )
);
rpt = obj << report;
path = obj << (fit[1] << getsolutionpath);
tnll = obj << (fit[1] << gettrainingnegativeloglikelihood);
actmin = rpt["Parameter Estimates for Centered and Scaled Predictors"][Number Col Box( "Estimate" )] << getasmatrix;
Code Explanation:
- Open data table;
- Set random seed.
- Fit generalized regression model.
- Use Weibull distribution.
- Apply Ridge estimation method.
- Use holdback validation with 30%.
- Retrieve model report.
- Get solution path.
- Get training negative log-likelihood.
- Extract parameter estimates matrix.
- Close model window.
- Refit model using LogNormal distribution.
- Apply Ridge estimation method again.
- Use holdback validation with 30%.
- Retrieve model report.
- Get solution path.
- Get training negative log-likelihood.
- Extract parameter estimates matrix.
Example 4
Summary: Runs the Weibull life distribution analysis by bootstrapping estimates and calculating confidence intervals, utilizing JMP's scripting capabilities.
Code:
dt = Open("data_table.jmp");
obj = dt << run script( "Life Distribution - Weibull" );
rpt = obj << report;
Random Reset( 45871 );
boot = (rpt["Parametric Estimate - Weibull"][Number Col Box( 1 )] << Bootstrap(
10,
Split Selected Column( 1 ),
Discard Stacked Table if Split Works( 1 )
))[2];
obj2 = boot << Distribution( Y( :location ) );
rpt2 = obj2 << report;
orig = (boot << getasmatrix)[1, 2];
bootres = (boot << getasmatrix)[2 :: 11, 2];
w = Normal Quantile( Sum( bootres <= orig ) / 10 );
alphalow = [.025, .05, .1, .25];
alphahigh = [.975, .95, .9, .75];
zlow = Normal Quantile( alphalow );
zhigh = Normal Quantile( alphahigh );
alphatildelow = Normal Distribution( 2 * w + zlow );
alphatildehigh = Normal Distribution( 2 * w + zhigh );
bclow = J( N Row( alphatildelow ), 1, . );
bchigh = J( N Row( alphatildehigh ), 1, . );
For( i = 1, i <= N Row( alphatildelow ), i++,
bclow[i] = Quantile( alphatildelow[i], bootres );
bchigh[i] = Quantile( alphatildehigh[i], bootres );
);
conf = [.95, .9, .8, .5];
Code Explanation:
- Open data table.
- Run Weibull life distribution script.
- Extract report from analysis.
- Set random seed for reproducibility.
- Perform bootstrap on Weibull estimates.
- Create distribution for bootstrapped location.
- Extract original estimate matrix.
- Extract bootstrapped results matrix.
- Calculate normal quantile for bootstrap results.
- Define confidence levels and calculate bounds.
Distribution using For
Example 1
Summary: Generates a reliability forecast for a specified data table using the Reliability Forecast platform in JMP.
Code:
Names Default To Here( 1 );
dt = Open("data_table.jmp");
collist = {};
For( i = 3, i <= 38, i++,
Insert Into( collist, Column( dt, i ) )
);
obj = dt << Reliability Forecast(
Input Format( Nevada ),
Production Count( :Volume ),
Timestamp( :Time ),
Failure Count( Eval List( collist ) ),
Life Time Unit( Month ),
Show Legend( 0 ),
Show Graph Filter( 0 ),
Forecast(
Group(),
Risk Set(
[1991, 2000, 1999, 2024, 1959, 1958, 2000, 2001, 1986, 1966, 1983, 2011, 2026, 1950, 1989, 1963, 1954, 2030, 1981, 2006, 1991,
1950, 2025, 1996, 1987, 1957, 1988, 1966, 2038, 2014, 1962, 1965, 1952, 2045, 2018, 2036]
),
Forecast To( "01/2004" ),
Distribution( Weibull ),
Contract( 5, Month ),
Forecast Type( Sequential ),
Interval Type( No Interval ),
Alpha( 0.05 )
),
Forecast Options(
Animation( 0 ),
Interactive Configuration of Risk Sets( 1 ),
Spreadsheet Configuration of Risk Sets( 0 ),
Show Interval( 0 ),
Forecasting Interval Type( Prediction Interval ),
Use Contract Length( 1 ),
Use Failure Cost( 0 ),
Average Failure Cost( . ),
Monte Carlo Sample Size( 10000 ),
Random Seed( -1 ),
Use Approximate Distribution( 1 )
),
);
Code Explanation:
- Set default names.
- Open data table.
- Initialize column list.
- Loop through columns.
- Add columns to list.
- Create reliability forecast object.
- Set input format.
- Specify production count.
- Define timestamp column.
- Set failure counts.
Example 2
Summary: Generates a distribution analysis for continuous variables in a specified data table using the Distribution platform, with features such as Lognormal and Weibull models, Bayesian estimates, and surface plots.
Code:
dt = Open("data_table.jmp");
ran = [];
For( i = 1, i <= 2, i++,
Log Capture(
obj = dt << Fit Life by X(
Distribution( Lognormal ),
Relationship( Inverse Power ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
<<Fit Lognormal,
<<Fit Weibull,
<<Time Acceleration Baseline( 10 ),
Show Surface Plot( 1 ),
<<Set Scriptables(
{Bayesian Estimates(
Lognormal,
Model(
Quantile and Parameter Priors,
Quantile( Normal, Probability( 0.1 ), X( 10 ), Low( 118161.2563986 ), High( 7642243.4981611 ) ),
Beta1( Normal, Low( -5.04922162968372 ), High( -2.45511726437163 ) ),
Shape or Scale( Normal, Low( 0.645835721344997 ), High( 1.33962373325817 ) ),
Number of Monte Carlo Iterations( 10 )
)
)}
),
Confidence Interval Method( Wald ),
)
);
ran = ran |/ (Random Uniform());
);
Code Explanation:
- Open data table.
- Initialize empty list
ran. - Loop 2 times.
- Capture log output.
- Fit life by X with Lognormal distribution.
- Set inverse power relationship.
- Use "Hours" as Y variable.
- Use "Temp" as X variable.
- Censor data with "Censor" column.
- Set censor code to 1.
- Use "Weight" as frequency.
- Fit Lognormal model.
- Fit Weibull model.
- Set time acceleration baseline to 10.
- Enable surface plot.
- Configure Bayesian estimates for Lognormal model.
- Set quantile and parameter priors.
- Define Normal distribution for quantile.
- Set Beta1 Normal distribution limits.
- Set Shape or Scale Normal distribution limits.
- Set Monte Carlo iterations to 10.
- Use Wald confidence interval method.
- Append random uniform value to
ran.
Distribution using Value Labels
Summary: Explores data by generating a distribution for female height and creating a bar chart by sex for age, while defining an array of certification ages.
Code:
dt = Open("data_table.jmp");
:sex << Value Labels( {"G" = "girl", "B" = "boy"} );
:sex << Use Value Labels( 1 );
Distribution( Continuous Distribution( Column( :height ) ), Where( :sex == "F" ) );
Chart( Grouping( :sex ), Y( :age ), Category Axis << {Axis Name( Rows )}, Bar Chart( 1 ) );
certage =
"[12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 17, 17, 17]";
a = :age << GetAsMatrix;
Code Explanation:
- Open data table;
- Assign value labels to sex.
- Enable value labels for sex.
- Generate distribution for female height.
- Create bar chart by sex for age.
- Define certage array.
- Retrieve age column as matrix.
Distribution using Set Property
Example 1
Summary: Creates a distribution analysis report, grouping data by age and specifying the height column, utilizing the Distribution platform in JMP.
Code:
dt = Open("data_table.jmp");
dt:age << Set Property( "Value Ordering", {17, 16, 13, 12} );
obj = Distribution( Continuous Distribution( Column( :height ) ), By( :age ) );
rpt = obj << report;
Code Explanation:
- Open data table;
- Set age value ordering.
- Create distribution analysis.
- Specify height column.
- Group by age.
- Generate report object.
Example 2
Summary: Runs life distribution analysis and generates cause summary reports for specified missing values in a data table, utilizing Weibull failure distribution by cause.
Code:
dt = Open("data_table.jmp");
dt:Cause Code << Set Property( "Missing Value Codes", {0, 1} );
ldcc1 = dt << Life Distribution( Y( :Time Cycles ), Failure Cause( :Cause Code ), Failure Distribution by Cause( Weibull ) );
rvec1 = Report( ldcc1 )["Cause Summary"][Table Box( 1 )] << get as matrix;
dt:Cause Code[dt << get rows where( Col Stored Value( :Cause Code ) == 0 | Col Stored Value( :Cause Code ) == 1 )] = .;
ldcc2 = dt << Life Distribution( Y( :Time Cycles ), Failure Cause( :Cause Code ), Failure Distribution by Cause( Weibull ) );
rvec2 = Report( ldcc2 )["Cause Summary"][Table Box( 1 )] << get as matrix;
Code Explanation:
- Open data_table data
- Set missing value codes.
- Perform life distribution analysis.
- Extract cause summary report.
- Replace specified missing values.
- Perform life distribution analysis again.
- Extract new cause summary report.
Example 3
Summary: Fits a Weibull distribution to data, capturing log output and setting units for Hours and Temp.
Code:
dt = Open("data_table.jmp");
dt:Hours << Set Property( Units, "hrs" );
dt:Temp << Set Property( Units, "Celsius" );
Log Capture(
obj = dt << Fit Life by X(
Y( :Hours ),
X( :Temp ),
Distribution( Weibull ),
Censor( :Censor ),
Freq( :Weight ),
Relationship( Voltage ),
<<Set Scriptables(
{Lognormal Estimate Probability( Likelihood, {2500}, {45} ), Lognormal Estimate Quantile( Likelihood, {0.5}, {45} )}
)
)
);
rpt = Report( obj );
ab = rpt["Scatterplot"][AxisBox( 2 )];
ytxt = rpt["Scatterplot"][AxisBox( 1 )][Text Edit Box( 1 )] << get text;
xtxt = rpt["Scatterplot"][AxisBox( 2 )][Text Edit Box( 1 )] << get text;
Code Explanation:
- Open data table.
- Set units for Hours.
- Set units for Temp.
- Capture log output.
- Fit life model by X.
- Set Y variable to Hours.
- Set X variable to Temp.
- Choose Weibull distribution.
- Specify censor variable.
- Set frequency variable.
Distribution using Control Chart
Summary: Creates a control chart and distribution analysis from a data table, selecting specific rows and excluding others.
Code:
dt = Open("data_table.jmp");
dt << select rows( 2 ) << exclude( 1 );
dt << select rows( 3 ) << exclude( 1 );
obj1 = Control Chart( Sample Size( :Lot Size ), KSigma( 3 ), Chart Col( :Name( "# defective" ), P ), );
obj2 = Distribution( Continuous Distribution( Column( :Lot Size ) ), Continuous Distribution( Column( :Name( "# defective" ) ) ) );
dt << delete rows();
Code Explanation:
- Open data table;
- Select row 2.
- Exclude selected row.
- Select row 3.
- Exclude selected row.
- Create control chart object.
- Create distribution object.
- Delete all rows from table.
Distribution using Summarize
Summary: Runs the summarization and visualization of data by sex, generating a new window with distribution analysis and variability charts for each group.
Code:
dt = Open("data_table.jmp");
Summarize( dt, groupBy = by( :sex ) );
NW = New Window( "The Output", vlb = V List Box() );
For( i = 1, i <= N Items( groupBy ), i++,
vlb << append(
Eval(
Substitute(
Expr(
dis = Distribution(
Continuous Distribution(
Column( :height ),
Quantiles( 0 ),
Summary Statistics( 0 ),
Horizontal Layout( 1 ),
Vertical( 0 )
),
Where( :sex == __where__ )
);
var = Variability Chart( Y( :height ), X( :age ), Std Dev Chart( 0 ), Where( :sex == __where__ ) );
),
Expr( __where__ ), groupBy[i]
)
)
)
);
NW << Save journal( "$TEMP/Output.jrn" );
Code Explanation:
- Open data table.
- Summarize data by sex.
- Create new window for output.
- Initialize vertical list box.
- Loop through each sex group.
- Append distribution analysis to list box.
- Substitute current sex into expression.
- Perform distribution analysis on height.
- Append variability chart to list box.
- Substitute current sex into expression.
- Save journal to temporary file.
Distribution using Data Type
Example 1
Summary: Processes and visualizes a table, including data type conversion, distribution analysis, and header chart configuration.
Code:
dt2 = Open("data_table.jmp");
dt2:order date << Data Type( "Numeric", Format( ":day:hr:m:s", 17, 0 ), Input Format( "m/d/y" ) );
dist2 = dt2 << Distribution( Continuous Distribution( Column( :Order Date ), Outlier Box Plot( 0 ) ) );
dt2:order date << Set header chart type( "heat map" );
dt2:order year << Set header chart type( "histogram" );
matrix2 = Report( dist2 )[Outline Box( 3 )][Table Box( 1 )][Number Col Box( 1 )] << get as matrix;
Close( dt2, nosave );
Preferences( Factory Default );
Code Explanation:
- Open table.
- Change data type.
- Create distribution.
- Enable outlier box plot.
- Set heat map header.
- Set histogram header.
- Extract matrix data.
- Close table.
- Reset preferences.
Example 2
Summary: Prepares data and visualization by opening a data table, changing the order date data type, creating a distribution report, setting header chart types, and extracting a matrix from the report.
Code:
dt2 = Open("data_table.jmp");
dt2:order date << Data Type( "Numeric", Format( ":day:hr:m:s", 17, 0 ), Input Format( "m/d/y" ) );
dist2 = dt2 << Distribution( Continuous Distribution( Column( :Order Date ), Outlier Box Plot( 0 ) ) );
dt2:order date << Set header chart type( "heat map" );
dt2:order year << Set header chart type( "histogram" );
matrix2 = Report( dist2 )[Outline Box( 3 )][Table Box( 1 )][Number Col Box( 1 )] << get as matrix;
Code Explanation:
- Open data table.
- Change order date data type.
- Create distribution report.
- Set order date header chart type.
- Set order year header chart type.
- Extract matrix from report.
Example 3
Summary: Analyze and visualize a continuous distribution by opening a data table, setting the order date data type, creating a distribution analysis, excluding outlier box plots, extracting report outline boxes, accessing table boxes within outlines, retrieving number column boxes, and converting to a matrix.
Code:
dt2 = Open("data_table.jmp");
dt2:order date << Data Type( "Numeric", Format( ":day:hr:m:s", 17, 0 ), Input Format( "m/d/y" ) );
dist2 = dt2 << Distribution( Continuous Distribution( Column( :Order Date ), Outlier Box Plot( 0 ) ) );
matrix2 = Report( dist2 )[Outline Box( 3 )][Table Box( 1 )][Number Col Box( 1 )] << get as matrix;
Code Explanation:
- Open data table.
- Set order date data type.
- Create distribution analysis.
- Exclude outlier box plot.
- Extract report outline box.
- Access table box within outline.
- Retrieve number column box.
- Convert to matrix.
Example 4
Summary: Process and format date data in a JMP data table, including setting the 'Order Date' column to numeric format and extracting outlier box plot data.
Code:
dt3 = Open("data_table.jmp");
dt3:order date << Data Type( "Numeric", Format( "ddMonyyyy", 22 ), Input Format( "m/d/y" ) );
dist3 = dt3 << Distribution( Continuous Distribution( Column( :Order Date ), Outlier Box Plot( 0 ) ) );
axis3 = Report( dist3 )[Outline Box( 1 )][Number Col Box( 1 )] << get as matrix;
newdate = Format( axis3[5], "ddMonyyyy", 22 );
dt3 << Close Summary Panels( 1 );
Close( dt3, nosave );
Pref( Show summary graphs below column names( 0 ) );
Preferences( Virtual Join Auto Open Linked table( 1 ), Virtual Join Use Linked Column Name( 1 ) );
prefsOn = Get Preferences( Virtual Join Auto Open Linked table, Virtual Join Use Linked Column Name );
Code Explanation:
- Open data table;
- Set "Order Date" to numeric.
- Create distribution for "Order Date".
- Extract outlier box plot data.
- Format extracted date.
- Close summary panels.
- Close table without saving.
- Disable summary graphs below column names.
- Enable virtual join auto open linked table.
- Enable virtual join use linked column name.
- Get preferences for virtual join settings.
Example 5
Summary: Process and format a data table, including setting the 'order date' column to numeric format, creating a distribution report with an outlier box plot, extracting data from the plot, and closing summary panels.
Code:
dt3 = Open("data_table.jmp");
dt3:order date << Data Type( "Numeric", Format( "ddMonyyyy", 22 ), Input Format( "m/d/y" ) );
dist3 = dt3 << Distribution( Continuous Distribution( Column( :Order Date ), Outlier Box Plot( 0 ) ) );
axis3 = Report( dist3 )[Outline Box( 1 )][Number Col Box( 1 )] << get as matrix;
newdate = Format( axis3[5], "ddMonyyyy", 22 );
dt3 << Close Summary Panels( 1 );
Code Explanation:
- Open data table;
- Set "order date" to numeric.
- Create distribution report.
- Extract outlier box plot data.
- Format extracted date.
- Close summary panels.
Distribution using Collapse Whitespace
Example 1
Summary: Fits a generalized regression model to predict sex based on height and weight, utilizing maximum likelihood estimation and binomial distribution.
Code:
log1 = Collapse Whitespace(
Log Capture(
dt1 = Open("data_table.jmp");
obj1 = dt1 << Fit Model(
Y( :sex ),
Effects( :height, :weight ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Binomial" ),
Run( Fit( Estimation Method( Maximum Likelihood ), Validation Method( None ) ) )
);
obj1 << (Fit[1] << save simulation formula( 1 ));
)
);
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Set Y to sex.
- Include height and weight effects.
- Use binomial distribution.
- Run maximum likelihood estimation.
- Save simulation formula.
- Capture log output.
- Collapse whitespace in log.
Example 2
Summary: Fits a generalized regression model to a data table, capturing log output and saving simulation formulas, while also initializing a matrix and performing parallel assignments.
Code:
dt2 = Open("data_table.jmp");
log2 = Collapse Whitespace(
Log Capture(
obj2 = dt2 << Fit Model(
Y( :sex ),
Effects( :height, :weight ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Binomial" ),
Run( Fit( Estimation Method( Maximum Likelihood ), Validation Method( None ) ) )
);
obj2 << (Fit[1] << save simulation formula( 1 ));
)
);
Close( dt2, no save );
m = J( 1000, 1000, 0 );
lc = Log Capture( Parallel Assign( {}, m[r, c] = (Write( "." ) ; r + c) ) );
Code Explanation:
- Open data table;
- Fit generalized regression model.
- Capture log output.
- Save simulation formula.
- Close table without saving.
- Initialize 1000x1000 matrix.
- Capture parallel assignment log.
- Write "." to console.
- Sum row and column indices.
- Assign sum to matrix element.
Example 3
Summary: Fits a generalized regression model to predict sex based on height and weight, using maximum likelihood estimation and binomial distribution.
Code:
dt2 = Open("data_table.jmp");
log2 = Collapse Whitespace(
Log Capture(
obj2 = dt2 << Fit Model(
Y( :sex ),
Effects( :height, :weight ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Binomial" ),
Run( Fit( Estimation Method( Maximum Likelihood ), Validation Method( None ) ) )
);
obj2 << (Fit[1] << save simulation formula( 1 ));
)
);
Code Explanation:
- Open data table.
- Capture log output.
- Fit generalized regression model.
- Set response variable to sex.
- Include height and weight effects.
- Use binomial distribution.
- Estimate using maximum likelihood.
- Save simulation formula.
- Collapse whitespace in log.
Distribution using Loc
Example 1
Summary: Extracts and analyzes data from a JMP data table, fitting a generalized regression model with validation columns for Age and Gender effects.
Code:
dt = Open("data_table.jmp");
y1 = (dt:Y << get as matrix)[Loc( dt:Validation << get as matrix == 1 )];
y2 = (dt:Y << get as matrix)[Loc( dt:Validation << get as matrix == 2 )];
x1 = (dt:Age << get as matrix)[Loc( dt:Validation << get as matrix == 1 )];
x2 = (dt:Age << get as matrix)[Loc( dt:Validation << get as matrix == 2 )];
obj1 = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Cauchy" ),
Run( Fit( Estimation Method( "Forward Selection" ), Validation Method( "Validation Column" ) ) )
);
rpt1 = obj1 << report;
Code Explanation:
- Open data table;
- Extract validation 1 Y values.
- Extract validation 2 Y values.
- Extract validation 1 Age values.
- Extract validation 2 Age values.
- Fit generalized regression model.
- Specify validation column.
- Set response variable.
- Include Age and Gender effects.
- Generate report.
Example 2
Summary: Extracts and analyzes data for two validation groups, using Generalized Regression with Lasso estimation method and Exponential distribution.
Code:
dt = Open("data_table.jmp");
y1 = (dt:Y << get as matrix)[Loc( dt:Validation << get as matrix == 1 )];
y2 = (dt:Y << get as matrix)[Loc( dt:Validation << get as matrix == 2 )];
x1 = (dt:Age << get as matrix)[Loc( dt:Validation << get as matrix == 1 )];
x2 = (dt:Age << get as matrix)[Loc( dt:Validation << get as matrix == 2 )];
obj1 = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Exponential" ),
Run( Fit( Estimation Method( "Lasso" ), Validation Method( "Validation Column" ) ) )
);
rpt1 = obj1 << report;
Code Explanation:
- Open data table;
- Extract Y for Validation 1.
- Extract Y for Validation 2.
- Extract Age for Validation 1.
- Extract Age for Validation 2.
- Fit model with Age and Gender.
- Use Generalized Regression personality.
- Set Exponential distribution.
- Run Lasso estimation method.
- Generate report.
Example 3
Summary: Extracts and analyzes data from a JMP data table, using Generalized Regression to model Age and Gender effects.
Code:
dt = Open("data_table.jmp");
y1 = (dt:Y << get as matrix)[Loc( dt:Validation << get as matrix == 1 )];
y2 = (dt:Y << get as matrix)[Loc( dt:Validation << get as matrix == 2 )];
x1 = (dt:Age << get as matrix)[Loc( dt:Validation << get as matrix == 1 )];
x2 = (dt:Age << get as matrix)[Loc( dt:Validation << get as matrix == 2 )];
obj1 = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Gamma" ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( "Validation Column" ) ) )
);
rpt1 = obj1 << report;
Code Explanation:
- Open data table;
- Extract Y for validation 1.
- Extract Y for validation 2.
- Extract Age for validation 1.
- Extract Age for validation 2.
- Fit model with Age and Gender.
- Use Generalized Regression personality.
- Set Gamma distribution.
- Run Lasso Adaptive estimation.
- Generate report.
Example 4
Summary: Extracts and analyzes data from a Weibull distribution model, utilizing Generalized Regression and Maximum Likelihood estimation for validation.
Code:
dt = Open("data_table.jmp");
y1 = (dt:Y << get as matrix)[Loc( dt:Validation << get as matrix == 1 )];
y2 = (dt:Y << get as matrix)[Loc( dt:Validation << get as matrix == 2 )];
x1 = (dt:Age << get as matrix)[Loc( dt:Validation << get as matrix == 1 )];
x2 = (dt:Age << get as matrix)[Loc( dt:Validation << get as matrix == 2 )];
obj1 = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Weibull" ),
Run( Fit( Estimation Method( "Maximum Likelihood" ), Validation Method( "Validation Column" ) ) )
);
rpt1 = obj1 << report;
Code Explanation:
- Open data table;
- Extract Y for validation 1.
- Extract Y for validation 2.
- Extract Age for validation 1.
- Extract Age for validation 2.
- Fit model with Generalized Regression.
- Set Weibull distribution.
- Use Maximum Likelihood estimation.
- Validate using Validation Column.
- Generate report.
Example 5
Summary: Extracts and analyzes data from a JMP data table, using Generalized Regression to fit a model with LogNormal distribution and Elastic Net estimation method.
Code:
dt = Open("data_table.jmp");
y1 = (dt:Y << get as matrix)[Loc( dt:Validation << get as matrix == 1 )];
y2 = (dt:Y << get as matrix)[Loc( dt:Validation << get as matrix == 2 )];
x1 = (dt:Age << get as matrix)[Loc( dt:Validation << get as matrix == 1 )];
x2 = (dt:Age << get as matrix)[Loc( dt:Validation << get as matrix == 2 )];
obj1 = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender ),
Personality( "Generalized Regression" ),
Generalized Distribution( "LogNormal" ),
Run( Fit( Estimation Method( "Elastic Net" ), Validation Method( "Validation Column" ) ) )
);
rpt1 = obj1 << report;
Code Explanation:
- Open data table;
- Extract Y values for Validation=1.
- Extract Y values for Validation=2.
- Extract Age values for Validation=1.
- Extract Age values for Validation=2.
- Fit model using Generalized Regression.
- Specify LogNormal distribution.
- Use Elastic Net estimation method.
- Validate using Validation Column.
- Generate report from fit model.
Example 6
Summary: Extracts and analyzes fish caught data, using Generalized Regression to model the relationship between fishing poles and validation status.
Code:
dt = Open("data_table.jmp");
y1 = (dt:Fish Caught << get as matrix)[Loc( dt:Validation << get as matrix == 1 )];
y2 = (dt:Fish Caught << get as matrix)[Loc( dt:Validation << get as matrix == 2 )];
x1 = (dt:Fishing Poles << get as matrix)[Loc( dt:Validation << get as matrix == 1 )];
x2 = (dt:Fishing Poles << get as matrix)[Loc( dt:Validation << get as matrix == 2 )];
obj1 = dt << Fit Model(
Y( :Fish Caught ),
Validation( :Validation ),
Effects( :live bait, :Fishing Poles ),
Personality( "Generalized Regression" ),
Generalized Distribution( "ZI Gamma" ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( "Best Subset" ) ) ),
);
rpt1 = obj1 << report;
Code Explanation:
- Open data table.
- Extract Fish Caught for validation 1.
- Extract Fish Caught for validation 2.
- Extract Fishing Poles for validation 1.
- Extract Fishing Poles for validation 2.
- Fit model using Generalized Regression.
- Set response variable as Fish Caught.
- Use Validation column.
- Include live bait and Fishing Poles as effects.
- Generate report from model fit.
Distribution using Log Capture
Example 1
Summary: Runs a generalized linear regression analysis on the provided data table, capturing log information and enforcing heredity constraints.
Code:
dt = Open("data_table.jmp");
log1 = Log Capture(
obj1 = dt << Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects(
:Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose, :Age * :Gender, :Age * :BMI, :Age * :BP,
:Age * :Total Cholesterol, :Age * :LDL, :Age * :HDL, :Age * :TCH, :Age * :LTG, :Age * :Glucose, :Gender * :BMI, :Gender * :BP,
:Gender * :Total Cholesterol, :Gender * :LDL, :Gender * :HDL, :Gender * :TCH, :Gender * :LTG, :Gender * :Glucose, :BMI * :BP,
:BMI * :Total Cholesterol, :BMI * :LDL, :BMI * :HDL, :BMI * :TCH, :BMI * :LTG, :BMI * :Glucose, :BP * :Total Cholesterol,
:BP * :LDL, :BP * :HDL, :BP * :TCH, :BP * :LTG, :BP * :Glucose, :Total Cholesterol * :LDL, :Total Cholesterol * :HDL,
:Total Cholesterol * :TCH, :Total Cholesterol * :LTG, :Total Cholesterol * :Glucose, :LDL * :HDL, :LDL * :TCH, :LDL * :LTG,
:LDL * :Glucose, :HDL * :TCH, :HDL * :LTG, :HDL * :Glucose, :TCH * :LTG, :TCH * :Glucose, :LTG * :Glucose
),
Personality( Generalized Regression ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Double Lasso( Linear Grid ) ), Validation Method( Validation Column ), Enforce Heredity( 1 ) ) )
)
);
Code Explanation:
- Open data table;
- Start log capture.
- Initiate Fit Model.
- Set validation column.
- Define response variable.
- Specify all effects.
- Choose Generalized Regression personality.
- Select Normal distribution.
- Run fit with Double Lasso.
- Use validation column method.
- Enforce heredity constraint.
Example 2
Summary: Fits a generalized regression model to predict Movie Name based on Theme, World Gross, and their interaction, using Multinomial distribution.
Code:
dt = Open("data_table.jmp");
log1 = Log Capture(
obj = dt << Fit Model(
Validation( :Foreign Gross ),
Y( :Movie Name ),
Effects( :Theme, :World Gross, :Theme * :World Gross ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Multinomial" ),
Run( Fit )
)
);
Code Explanation:
- Open data table;
- Start log capture.
- Launch Fit Model platform.
- Set validation column.
- Define response variable.
- Specify effects.
- Choose Generalized Regression personality.
- Select Multinomial distribution.
- Run the fit.
- End log capture.
Example 3
Summary: Fits a generalized linear model to a data table, specifying response variable, effects, and distribution.
Code:
dt = Open("data_table.jmp");
log1 = Log Capture(
obj = dt << Fit Model(
Y( :Stretch ),
Effects( :Silica, :Sulfur * :Silane ),
Suppress Warning for Missing Effects( 1 ),
Personality( "Generalized Linear Model" ),
GLM Distribution( "Normal" ),
Link Function( "Identity" ),
Run
)
);
Code Explanation:
- Open data table.
- Start log capture.
- Fit model to data.
- Specify response variable.
- Define effects for model.
- Suppress missing effects warning.
- Set personality to GLM.
- Choose normal distribution.
- Select identity link function.
- Execute model fit.
Example 4
Summary: Fits a parametric survival model to analyze the relationship between temperature, censoring, and response variable hours, utilizing Arrhenius effect and Weibull distribution.
Code:
dt = Open("data_table.jmp");
log1 = Log Capture(
obj1 = dt << Fit Model(
Freq( :Count ),
Y( :Hours ),
Effects( Arrhenius( :Temp ) ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
Personality( "Parametric Survival" ),
Distribution( "Weibull" ),
Run( Distribution Plot by Level Combinations( 1 ) ),
)
);
b log1 = "";
Code Explanation:
- Open data table.
- Start logging output.
- Fit parametric survival model.
- Set frequency column.
- Define response variable.
- Add Arrhenius effect.
- Specify censoring variable.
- Set censor code.
- Include weight column.
- Choose Weibull distribution.
Example 5
Summary: Runs life distribution analysis by capturing log data and defining a Weibull distribution by cause, using the 'Time Cycles' response variable and 'Causes' failure cause.
Code:
dt = Open("data_table.jmp");
lc = Log Capture(
ld1 = Life Distribution( Y( :Time Cycles ), Failure Cause( :Causes ), Censor( :Censor ), Failure Distribution by Cause( DS Weibull ), )
);
Code Explanation:
- Open data table;
- Start log capture.
- Define life distribution analysis.
- Set response variable to "Time Cycles".
- Specify failure cause as "Causes".
- Use "Censor" for censoring information.
- Apply Weibull distribution by cause.
- End log capture.
Example 6
Summary: Performs a life by X analysis with Box-Cox transformation, Weibull distribution, and censoring to extract estimates into a matrix.
Code:
dt = Open("data_table.jmp");
Log Capture(
obj = dt << Fit Life by X(
Relationship( Name( "Box-Cox" )(-0.5) ),
Distribution( Weibull ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
)
);
rpt = obj << report;
est = rpt[Outline Box( "Estimates" )][Table Box( 1 )] << get as matrix;
Code Explanation:
- Open table.
- Fit life by X analysis.
- Use Box-Cox transformation.
- Assume Weibull distribution.
- Set Y variable as Hours.
- Set X variable as Temp.
- Specify censoring variable.
- Define censor code.
- Include frequency variable.
- Extract estimates into matrix.
Example 7
Summary: Performs a life by X analysis with Box-Cox transformation, nested model tests, and lognormal distribution to explore the relationship between Hours and Temp in a data table.
Code:
dt = Open("data_table.jmp");
lc = Log Capture(
obj = dt << Fit Life by X(
Relationship( Name( "Box-Cox" )(1.5) ),
Nested Model Tests( Regression ),
Distribution( Lognormal ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
<<Fit Lognormal
)
);
Code Explanation:
- Open data table.
- Start log capture.
- Fit life by X analysis.
- Use Box-Cox transformation.
- Perform nested model tests.
- Assume lognormal distribution.
- Set Y variable: Hours.
- Set X variable: Temp.
- Define censoring variable: Censor.
- Set censor code: 1.
Example 8
Summary: Fits life by X with Arrhenius relationship, capturing log output and retrieving Cox-Snell residual P-P plot settings for diagnostic analysis.
Code:
dt = Open("data_table.jmp");
Log Capture(
plat = dt << Fit Life by X(
Relationship( Arrhenius Celsius ),
Nested Model Tests( No Effect ),
Distribution( Lognormal ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
<<Fit Lognormal,
)
);
rep = Report( plat );
AxisSetting = rep["Diagnostics - No Effect"]["Cox-Snell Residual P-P Plot"][AxisBox( 1 )] << GetScript;
CheckMaxValue = (0.2 <= Arg( AxisSetting[4] ) <= 0.4);
AxisSetting = rep["Diagnostics - No Effect"]["Cox-Snell Residual P-P Plot"][AxisBox( 2 )] << GetScript;
CheckMaxValue = (0.2 <= Arg( AxisSetting[4] ) <= 0.4);
Close( dt, No Save );
dt = New Table( "Test",
New Column( "X", Values( [1, 1, 1, 1, 1, 2, 2, 2, 2, 2] ) ),
New Column( "Y", Values( [1, 2, 3, 4, 5, 1, 2, 3, 4, 5] ) ),
New Column( "C", Values( [0, 0, 0, 0, 1, 0, 0, 0, 0, 1] ) ),
New Column( "F", Values( [1, 1, 1, 1, 100, 1, 1, 1, 1, 200] ) )
);
Log Capture(
plat = dt << Fit Life by X(
Relationship( Linear ),
Nested Model Tests( Regression ),
Distribution( Weibull ),
Y( :Y ),
X( :X ),
Censor( :C ),
Censor Code( 1 ),
Freq( :F ),
)
);
rep = Report( plat );
outlinetitlelist = {"Diagnostics - Separate Location and Scale", "Diagnostics - Separate Location", "Diagnostics - Regression"};
For( i = 1, i <= N Items( outlinetitlelist ), i++,
AxisSetting = Eval( Eval Expr( rep[Expr( outlinetitlelist[i] )]["Cox-Snell Residual P-P Plot"][AxisBox( 1 )] << GetScript ) );
CheckMaxValue = (0.08 <= Arg( AxisSetting[4] ) <= 0.1);
AxisSetting = Eval( Eval Expr( rep[Expr( outlinetitlelist[i] )]["Cox-Snell Residual P-P Plot"][AxisBox( 2 )] << GetScript ) );
CheckMaxValue = (0.03 <= Arg( AxisSetting[4] ) <= 0.05);
);
Code Explanation:
- Open data table.
- Fit life by X with Arrhenius relationship.
- Set distribution to lognormal.
- Define Y, X, censor, and frequency columns.
- Capture log output.
- Retrieve Cox-Snell residual P-P plot settings.
- Check if max value is between 0.2 and 0.4.
- Close the original data table.
- Create new test data table.
- Fit life by X with linear relationship.
Example 9
Summary: Fits a Lognormal distribution to a life by X model, capturing report estimates and extracting the matrix for further analysis.
Code:
dt = Open("data_table.jmp");
Log Capture(
plat = dt << Fit Life by X(
Relationship( Location ),
Distribution( Lognormal ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
<<Fit Lognormal,
)
);
rep = Report( plat );
result = rep["Estimates"][Table Box( 1 )] << GetAsMatrix;
Close( dt, No Save );
Expected = [9.81475026696382 0.422085826181696 8.98747724926286 10.6420232846648,
1.00833750784337 0.273688504380296 0.471917896275358 1.54475711941138,
8.64407486921034 0.347412084841354 7.96315969512731 9.32499004329337,
1.18755179219794 0.316732395770119 0.566767703751417 1.80833588064446,
7.08384977490681 0.208736004886721 6.67473472305206 7.49296482676156,
0.804570493233217 0.155258728988956 0.500268976129399 1.10887201033703];
Code Explanation:
- Open data table.
- Fit life by X model.
- Use Lognormal distribution.
- Set Y variable.
- Set X variable.
- Define censoring.
- Specify frequency.
- Fit Lognormal model.
- Capture report.
- Extract estimates matrix.
- Close data table without saving.
Example 10
Summary: Performs a life by X analysis with Box-Cox transformation, nested model tests, and Lognormal distribution to estimate parameters and generate reports.
Code:
dt = Open("data_table.jmp");
lc = Log Capture(
plat = dt << Fit Life by X(
Relationship( Name( "Box-Cox" )(1.5) ),
Nested Model Tests( Regression ),
Distribution( Lognormal ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
<<Fit Lognormal
);
r = Report( plat );
est = r[Number Col Box( "Estimate" )] << GetAsMatrix;
expected = [11.2240721233811, -0.00871323610181759, 0.961188085225786];
expected = "321.644";
ll = (r[Number Col Box( "-2 Loglikelihood" )] << GetAsMatrix)[1];
rl = r["Profile Relative Likelihood"][Text Box( 2 )] << GetText;
expected = 836.2031;
pf = r["Results"]["Lognormal Results"]["B10 Sensitivity"];
nebx = r["B10 Sensitivity"][Number Edit Box( 1 )];
(pf << getscriptableobject) << term value( Temp( 67.5 ) );
b10 = r["B10 Sensitivity"][Text Box( 2 )] << GetText;
act = (pf << Get Scriptable Object) << Get Responses;
nebx << set( 0, Run Script( 1 ) );
b10.0 = r["B10 Sensitivity"][Text Box( 2 )] << GetText;
);
Code Explanation:
- Open data table.
- Fit life by X analysis.
- Set relationship to Box-Cox.
- Use nested model tests.
- Select Lognormal distribution.
- Specify Y and X variables.
- Define censoring parameters.
- Include frequency weights.
- Fit Lognormal model.
- Capture and analyze report results.
Example 11
Summary: Performs a life by X analysis using the Lognormal distribution, Arrhenius Celsius relationship, and frequency variable to visualize the results in a surface plot.
Code:
dt = Open("data_table.jmp");
Log Capture(
obj = dt << Fit Life by X(
Y( :Hours ),
X( :Temp ),
Distribution( Lognormal ),
Censor( :Censor ),
Relationship( Arrhenius Celsius ),
Freq( :Weight )
);
obj << Show Surface Plot( 1 );
);
r = Report( obj );
check = 0;
Try(
r["Lognormal Results"]["Lognormal"];
check = 1;
);
Code Explanation:
- Open data table.
- Fit life by X analysis.
- Set Y variable: Hours.
- Set X variable: Temp.
- Use Lognormal distribution.
- Specify censoring variable: Censor.
- Use Arrhenius Celsius relationship.
- Include frequency variable: Weight.
- Show surface plot.
- Capture report object.
Example 12
Summary: Performs a life by X analysis using the Arrhenius Celsius relationship, nested model tests, and lognormal distribution to fit data table variables, generating a report with nonparametric overlay journal content.
Code:
dt = Open("data_table.jmp");
Log Capture(
obj = dt << Fit Life by X(
Relationship( Arrhenius Celsius ),
Nested Model Tests( Regression ),
Distribution( Lognormal ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Freq( :Weight ),
<<Fit Lognormal,
)
);
obj << Show Points( 1 );
r = Report( obj );
jrnl = r["Nonparametric Overlay"][FrameBox( 1 )] << GetJournal;
Upjrnl = Uppercase( jrnl );
Pat Match( Upjrnl, "MARKERSIZE", "" );
check = Contains( Upjrnl, "MARKER" ) > 0;
Code Explanation:
- Open data table.
- Fit life by X analysis.
- Use Arrhenius Celsius relationship.
- Perform nested model tests.
- Assume lognormal distribution.
- Set Y variable as Hours.
- Set X variable as Temp.
- Define censor variable as Censor.
- Set frequency variable as Weight.
- Capture report and analyze journal content.
Example 13
Summary: Fits a lognormal distribution to data using Arrhenius relationship, with nested model tests for regression and censoring, and generates a report with density curve visualization.
Code:
dt = Open("data_table.jmp");
Log Capture(
obj = dt << Fit Life by X(
Relationship( Arrhenius Celsius ),
Nested Model Tests( Regression ),
Distribution( Lognormal ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Freq( :Weight ),
<<Fit Lognormal
)
);
r = Report( obj );
obj << Show Density Curve( 1 );
jrnl = r["Scatterplot"][FrameBox( 1 )] << GetJournal;
check = Contains( Uppercase( jrnl ), "POLYGON" ) > 0;
obj << Show Density Curve( 0 );
jrnl = r["Scatterplot"][FrameBox( 1 )] << GetJournal;
check = Contains( Uppercase( jrnl ), "POLYGON" ) > 0;
Close( dt, No Save );
Check = 0;
Code Explanation:
- Open data table;
- Start Log Capture.
- Fit Life by X using Arrhenius relationship.
- Apply nested model tests for regression.
- Assume lognormal distribution.
- Set Y variable as Hours.
- Set X variable as Temp.
- Specify censoring column as Censor.
- Use Weight for frequency.
- Fit lognormal distribution.
- Generate report from fit object.
- Display density curve on plot.
- Retrieve journal from scatterplot frame.
- Check if "POLYGON" is in journal.
- Hide density curve on plot.
- Retrieve updated journal from scatterplot frame.
- Check again if "POLYGON" is in journal.
- Close dataset without saving.
- Set check variable to 0.
Example 14
Summary: Performs a life by X analysis on the provided data table, utilizing Lognormal distribution and Arrhenius relationship to model the Hours variable with Temp as the predictor.
Code:
dt = Open("data_table.jmp");
Log Capture(
obj = dt << Fit Life by X(
Y( :Hours ),
X( :Temp ),
Distribution( Lognormal ),
Censor( :Censor ),
Relationship( Arrhenius Celsius ),
Freq( :Weight )
);
af1 = obj << TAF( SEV, 10, 20 );
af2 = obj << TAF( Normal, 10, 20 );
af3 = obj << TAF( Logistic, 10, 20 );
af4 = obj << TAF( LEV, 10, 20 );
);
Check = 1;
Close( dt, No Save );
Check = 0;
Code Explanation:
- Open data table.
- Fit life by X analysis.
- Set Y variable.
- Set X variable.
- Choose Lognormal distribution.
- Specify censor variable.
- Define Arrhenius relationship.
- Use frequency weight.
- Capture log output.
- Close data table without saving.
Example 15
Summary: Runs a Fit Life by X analysis with Arrhenius Celsius relationship, lognormal distribution, and custom censoring to visualize the relationship between Temp and Hours.
Code:
dt = Open("data_table.jmp");
Log Capture(
plat = dt << Fit Life by X(
Relationship( Arrhenius Celsius ),
Nested Model Tests( No Effect ),
Distribution( Lognormal ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
<<Fit Lognormal,
)
);
rep = Report( plat );
AxisSetting = rep["Diagnostics - No Effect"]["Cox-Snell Residual P-P Plot"][AxisBox( 1 )] << GetScript;
CheckMaxValue = (0.2 <= Arg( AxisSetting[4] ) <= 0.4);
AxisSetting = rep["Diagnostics - No Effect"]["Cox-Snell Residual P-P Plot"][AxisBox( 2 )] << GetScript;
CheckMaxValue = (0.2 <= Arg( AxisSetting[4] ) <= 0.4);
Code Explanation:
- Open data table.
- Perform Fit Life by X analysis.
- Use Arrhenius Celsius relationship.
- Disable nested model tests.
- Assume lognormal distribution.
- Set Y variable as Hours.
- Set X variable as Temp.
- Define censor variable as Censor.
- Set censor code to 1.
- Use Weight for frequency.
Example 16
Summary: Estimates lognormal distribution parameters for a life by X relationship, using Fit Life by X and Log Capture in JMP.
Code:
dt = Open("data_table.jmp");
Log Capture(
plat = dt << Fit Life by X(
Relationship( Location ),
Distribution( Lognormal ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
<<Fit Lognormal,
)
);
rep = Report( plat );
result = rep["Estimates"][Table Box( 1 )] << GetAsMatrix;
Code Explanation:
- Open table.
- Fit life by X.
- Set relationship to location.
- Use lognormal distribution.
- Specify Y variable.
- Specify X variable.
- Define censor variable.
- Set censor code.
- Include frequency variable.
- Extract estimates matrix.
Example 17
Summary: Runs a Fit Life by X analysis to estimate parameters of a Lognormal distribution, utilizing the specified variables and censoring information.
Code:
dt = Open("data_table.jmp");
Log Capture(
plat = dt << Fit Life by X(
Relationship( Location and Scale ),
Distribution( Lognormal ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
<<Fit Lognormal,
)
);
rep = Report( plat );
result = rep["Estimates"][Table Box( 1 )] << GetAsMatrix;
Code Explanation:
- Open data table.
- Perform Fit Life by X analysis.
- Set relationship type.
- Choose Lognormal distribution.
- Specify response variable.
- Define predictor variable.
- Identify censoring variable.
- Set censor code.
- Include frequency variable.
- Retrieve estimates matrix.
Example 18
Summary: Performs a life by X analysis to fit a lognormal distribution, performing nested model tests and generating density curves.
Code:
dt = Open("data_table.jmp");
Log Capture(
obj = dt << Fit Life by X(
Relationship( Arrhenius Celsius ),
Nested Model Tests( Regression ),
Distribution( Lognormal ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Freq( :Weight ),
<<Fit Lognormal
)
);
r = Report( obj );
obj << Show Density Curve( 1 );
jrnl = r["Scatterplot"][FrameBox( 1 )] << GetJournal;
check = Contains( Uppercase( jrnl ), "POLYGON" ) > 0;
obj << Show Density Curve( 0 );
jrnl = r["Scatterplot"][FrameBox( 1 )] << GetJournal;
check = Contains( Uppercase( jrnl ), "POLYGON" ) > 0;
Code Explanation:
- Open data table.
- Fit life by X analysis.
- Set relationship type.
- Perform nested model tests.
- Specify distribution type.
- Define Y variable.
- Define X variable.
- Specify censor variable.
- Define frequency variable.
- Fit lognormal distribution.
Example 19
Summary: Runs a Life by X analysis to fit the Lognormal distribution of 'Hours' data, considering censoring and frequency weights, and calculates TAFs for SEV, Normal, Logistic, and LEV distributions.
Code:
dt = Open("data_table.jmp");
Log Capture(
obj = dt << Fit Life by X(
Y( :Hours ),
X( :Temp ),
Distribution( Lognormal ),
Censor( :Censor ),
Relationship( Arrhenius Celsius ),
Freq( :Weight )
);
af1 = obj << TAF( SEV, 10, 20 );
af2 = obj << TAF( Normal, 10, 20 );
af3 = obj << TAF( Logistic, 10, 20 );
af4 = obj << TAF( LEV, 10, 20 );
);
Check = 1;
Code Explanation:
- Open data table;
- Start Log Capture.
- Fit Life by X analysis.
- Set Y variable to "Hours".
- Set X variable to "Temp".
- Use Lognormal distribution.
- Set censor variable to "Censor".
- Use Arrhenius Celsius relationship.
- Set frequency variable to "Weight".
- Calculate TAF for SEV, Normal, Logistic, and LEV distributions.
Example 20
Summary: Performs a life by X analysis with Box-Cox transformation and Lognormal distribution, capturing log output for further examination.
Code:
dt = Open("data_table.jmp");
Log Capture(
plat = dt << Fit Life by X(
Relationship( Name( "Box-Cox" )(0) ),
Distribution( Lognormal ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
<<Fit Lognormal
)
);
plat << Fit Weibull;
Check = 1;
Code Explanation:
- Open data table.
- Capture log output.
- Fit life by X analysis.
- Use Box-Cox transformation.
- Assume Lognormal distribution.
- Set Y variable: Hours.
- Set X variable: Temp.
- Define censoring variable.
- Specify censor code.
- Include frequency variable.
Example 21
Summary: Runs life distribution analysis to model failure rates by cause, utilizing Weibull distribution and Bayesian models for improved accuracy.
Code:
dt = Open("data_table.jmp");
lCap = Log Capture(
dt << Life Distribution(
Y( :Time Cycles ),
Censor( :Censor ),
Censor Code( 1 ),
Failure Cause( :Causes ),
Failure Distribution by Cause( Weibull ),
Comparison Criterion( AICc ),
Allow failure mode to use Bayesian models( 1 ),
<<Fit Model(
{{"bearing seal", Bayesian Weibull, 0}, {"belt", Bayesian Weibull, 0}, {"circuitry", Bayesian Weibull, 1}, {"container throw",
Bayesian Weibull, 0}, {"cord short", Bayesian Weibull, 0}, {"engine fan", Bayesian Weibull, 0}, {"none", Bayesian Weibull, 0},
{"power switch", Bayesian Weibull, 0}, {"stripped gear", Bayesian Weibull, 0}, {"switch, other", Bayesian Weibull, 1}}
)
)
);
Code Explanation:
- Open data table;
- Initiate Log Capture.
- Perform Life Distribution analysis.
- Set Y variable: Time Cycles.
- Define Censor variable: Censor.
- Set Censor Code: 1.
- Specify Failure Cause: Causes.
- Use Weibull distribution by cause.
- Select AICc as comparison criterion.
- Enable Bayesian models for failure modes.
Example 22
Summary: Runs the Life Distribution analysis for a specified data table, capturing log information and setting censor code.
Code:
Open("data_table.jmp");
lc = Log Capture( obj = dt << Life Distribution( Y( :Time ), Censor( :Censor ), Censor Code( 3 ), ) );
Code Explanation:
- Open data table;
- Assign log capture object.
- Launch Life Distribution analysis.
- Specify time variable.
- Specify censor variable.
- Set censor code.
Example 23
Summary: Runs life distribution analysis by capturing log output and specifying response and censor variables, utilizing the Life Distribution platform in JMP.
Code:
dt = Open("data_table.jmp");
lc = Log Capture( obj = dt << Life Distribution( Y( :Time ), Censor( :Censor ), Censor Code( 3 ), ) );
Code Explanation:
- Open data table.
- Capture log output.
- Perform life distribution analysis.
- Set response variable to Time.
- Specify censor variable as Censor.
- Define censor code as 3.
Example 24
Summary: Fits a generalized linear model to analyze the relationship between Number Popped and Total Kernels, with customizable surface profiler and response column colors.
Code:
dt = Open("data_table.jmp");
Log Capture(
obj = dt << Fit Model(
Y( :Number Popped, :Total Kernels ),
Effects( :Brand, :Time, :Power, :Brand * :Time, :Brand * :Power, :Time * :Power, :Time * :Time, :Power * :Power ),
Personality( "Generalized Linear Model" ),
GLM Distribution( "Binomial" ),
Link Function( "Logit" ),
Overdispersion Tests and Intervals( 0 ),
Run(
Surface Profiler(
Surface Color Theme( "Green to Black to Red" ),
Surface Color Theme2( "Green to White to Red" ),
Surface Color Theme3( "White to Black" ),
Surface Color Theme4( "Blue to Gray to Red" ),
Response Column Color Theme( "Blue to Green to Red" ),
Response Column Color Theme2( "Spectral" ),
Response Column Color Theme3( "Jet" ),
Response Column Color Theme4( "White to Blue" ),
Surface Color Method( "Solid", "Solid", "Solid", "Solid" ),
)
)
)
);
Code Explanation:
- Open data table.
- Fit generalized linear model.
- Set response variables.
- Define effects for model.
- Specify binomial distribution.
- Use logit link function.
- Disable overdispersion tests.
- Generate surface profiler.
- Customize surface color themes.
- Customize response column colors.
Example 25
Summary: Creates a distribution analysis for continuous data, utilizing frequency and weight from column :x, and calculates a nonparametric tolerance interval with specified alpha and proportion.
Code:
dt = Open("data_table.jmp");
Log Capture(
obj = dt << Distribution(
Freq( :x ),
Weight( :x ),
Continuous Distribution( Column( :y ), Tolerance Interval( Alpha( 0.95 ), Proportion( 0.9 ), Nonparametric ) )
)
);
rpt = obj << report;
Code Explanation:
- Open data table;
- Log capture starts.
- Create distribution analysis.
- Set frequency to column :x.
- Set weight to column :x.
- Analyze continuous distribution of :y.
- Calculate nonparametric tolerance interval.
- Set alpha to 0.95.
- Set proportion to 0.9.
- Retrieve report object.
Distribution using Associative Array
Example 1
Summary: Fits a generalized regression model to a data table, removing common windows from associative arrays, and closing remaining windows.
Code:
dt = Open("data_table.jmp");
befAA = Associative Array( Window() << get window title );
obj = dt << Fit Model(
Y( :Y Binary ),
Target Level( "Low" ),
Effects( :age ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Binomial" ),
Run
);
aftAA = Associative Array( Window() << get window title );
aftAA << Remove( befAA );
aftlst = aftAA << get keys;
If( N Items( aftlst ) == 1,
tmp = Window( aftlst[1] );
tmp << close window( 1 );
);
Code Explanation:
- Open data table;
- Create associative array before fitting model.
- Fit generalized regression model.
- Create associative array after fitting model.
- Remove common windows from associative arrays.
- Get remaining window keys.
- Check if only one window remains.
- Close the remaining window.
Example 2
Summary: Fits a generalized regression model to an ordinal response variable, while managing window titles and removing unchanged windows.
Code:
dt = Open("data_table.jmp");
befAA = Associative Array( Window() << get window title );
obj = dt << Fit Model(
Y( :Y Ordinal ),
Effects( :age ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Ordinal Logistic" ),
Run
);
aftAA = Associative Array( Window() << get window title );
aftAA << Remove( befAA );
aftlst = aftAA << get keys;
If( N Items( aftlst ) == 1,
tmp = Window( aftlst[1] );
tmp << close window( 1 );
);
Code Explanation:
- Open data table;
- Create associative array before model run.
- Fit generalized regression model.
- Create associative array after model run.
- Remove unchanged windows from array.
- Get keys from updated associative array.
- Check if one window remains.
- Close remaining window if true.
Example 3
Summary: Fits a Generalized Linear Model to analyze miles data, specifying effects for species, subject:species, season, and species:season.
Code:
dt = Open("data_table.jmp");
befAA = Associative Array( Window() << get window title );
log1 = Log Capture(
dt << Fit Model(
Y( :miles ),
Effects( :species, :subject[:species] & Random, :season, :species * :season ),
Personality( "Generalized Linear Model" ),
GLM Distribution( "Normal" ),
Link Function( "Identity" ),
Run
)
);
aftAA = Associative Array( Window() << get window title );
aftAA << Remove( befAA );
aftlst = aftAA << get keys;
Try( If( Is Empty( aftlst ) == 0, Window( aftlst[1] ) << close window( 1 ) ) );
Code Explanation:
- Open data table;
- Create associative array of current windows.
- Start log capture.
- Fit Generalized Linear Model.
- Specify response variable: miles.
- Define effects: species, subject:species, season, species:season.
- Set personality to Generalized Linear Model.
- Choose Normal distribution.
- Select Identity link function.
- Run the model.
Example 4
Summary: Fits a generalized regression model to data, capturing log messages and managing window titles.
Code:
dt = Open("data_table.jmp");
befAA = Associative Array( Window() << get window title );
log1 = Log Capture(
dt << Fit Model(
Y( :miles ),
Effects( :species, :subject[:species] & Random, :season, :species * :season ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run
)
);
aftAA = Associative Array( Window() << get window title );
aftAA << Remove( befAA );
aftlst = aftAA << get keys;
Try( If( Is Empty( aftlst ) == 0, Window( aftlst[1] ) << close window( 1 ) ) );
Close( dt, no save );
b log1 = "Random or secondary effects specified in a fitting personality that does not support them";
Code Explanation:
- Open data table.
- Create associative array of current windows.
- Capture log of Fit Model execution.
- Fit model with specified effects.
- Create associative array of current windows post-fit.
- Remove pre-fit windows from post-fit array.
- Get keys of remaining windows.
- Close the first remaining window if any.
- Close data table without saving.
- Assign log message to b log1 variable.
Example 5
Summary: Fits a generalized regression model to a data table, capturing log information and storing window titles in an associative array.
Code:
dt = Open("data_table.jmp");
befAA = Associative Array( Window() << get window title );
log1 = Log Capture(
dt << Fit Model(
Y( :miles ),
Effects( :species, :subject[:species] & Random, :season, :species * :season ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run
)
);
aftAA = Associative Array( Window() << get window title );
aftAA << Remove( befAA );
aftlst = aftAA << get keys;
Try( If( Is Empty( aftlst ) == 0, Window( aftlst[1] ) << close window( 1 ) ) );
Code Explanation:
- Open data table;
- Create associative array before model fitting.
- Start logging.
- Fit generalized regression model.
- Specify response variable "miles".
- Define effects for model.
- Set personality to "Generalized Regression".
- Choose "Normal" distribution.
- Run the model.
- Stop logging.
Distribution using Modeling Type
Summary: Fits a Generalized Regression model to an ordinal response variable, utilizing window titles for tracking and closing windows.
Code:
dt = Open("data_table.jmp");
dt:Y Ordinal << Modeling Type( "Nominal" );
befAA = Associative Array( Window() << get window title );
obj = dt << Fit Model(
Y( :Y Ordinal ),
Effects( :age ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Multinomial" ),
Run
);
aftAA = Associative Array( Window() << get window title );
aftAA << Remove( befAA );
aftlst = aftAA << get keys;
If( N Items( aftlst ) == 1,
tmp = Window( aftlst[1] );
tmp << close window( 1 );
);
Code Explanation:
- Open data table;
- Set Y Ordinal as Nominal.
- Store initial window titles.
- Fit Generalized Regression model.
- Store new window titles.
- Remove initial titles from new titles.
- Get remaining window titles.
- If one window remains.
- Close that window.
Distribution using Select where
Summary: Analyze fish caught data by fitting a Generalized Linear Model with Poisson distribution and Log link function, using specified effects to predict Fish Caught.
Code:
dt = Open("data_table.jmp");
s = dt << Select where( :Fished == 1 );
s << Exclude( 1 );
Log Capture(
obj = dt << Fit Model(
By( :Fished ),
Y( :Fish Caught ),
Effects(
:Live Bait, :Fishing Poles, :Camper, :People, :Children, :Live Bait * :Fishing Poles, :Live Bait * :Camper,
:Live Bait * :People, :Live Bait * :Children, :Fishing Poles * :Camper, :Fishing Poles * :People, :Fishing Poles * :Children,
:Camper * :People, :Camper * :Children, :People * :Children
),
Personality( "Generalized Linear Model" ),
GLM Distribution( "Poisson" ),
Link Function( "Log" ),
Run
)
);
Code Explanation:
- Open table.
- Select rows where Fished = 1.
- Exclude selected rows.
- Capture log output.
- Fit model using Generalized Linear Model personality.
- Set response variable to Fish Caught.
- Include specified effects in the model.
- Set distribution to Poisson.
- Set link function to Log.
- Run the model.
Distribution using Lock Data Table
Summary: Fits a Generalized Linear Model to predict weight based on height, age, and sex, using a Normal distribution and Identity link function.
Code:
dt = Open("data_table.jmp");
dt << Lock Data Table( 1 );
obj = dt << Fit Model(
Y( :weight ),
X( :height, :age, :sex ),
Personality( "Generalized Linear Model" ),
GLM Distribution( "Normal" ),
Link Function( "Identity" ),
Run
);
obj << Predicted Values;
Code Explanation:
- Open data table.
- Lock data table.
- Fit Generalized Linear Model.
- Set response variable to weight.
- Add predictors: height, age, sex.
- Choose Normal distribution.
- Use Identity link function.
- Run the model.
- Generate predicted values.
Distribution using Select Rows
Example 1
Summary: Analyze a survival dataset by fitting a parametric survival model and generating distribution plots, while also performing life-by-X modeling with nested model tests.
Code:
dt = Open("data_table.jmp");
r = dt << Select Rows( [1] );
r << Exclude;
obj1 = dt << Fit Model(
Freq( :Count ),
Y( :Hours ),
Effects( :x ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
Personality( "Parametric Survival" ),
Distribution( "Exponential" ),
Run( Distribution Plot by Level Combinations( 1 ) )
);
fmrpt1 = obj1 << report;
(fmrpt1["Distribution Plot by Level Combinations"] << get scriptable object) << show shade;
obj2 = dt << Fit Life by X(
Relationship( Arrhenius Celsius ),
Nested Model Tests( Regression ),
Distribution( Exponential ),
Y( :Hours ),
X( :x ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
);
flbxrpt1 = obj2 << report;
flbxrpt1["Scatterplot"] << Close( 1 );
flbxrpt1["Nonparametric Overlay"] << Close( 1 );
flbxrpt1["Comparisons"] << Close( 1 );
test = Try( fmrpt1["Separate Location and Scale"] << get journal, "Invalid" );
legend = fmrpt1["Separate Location"][Legend Box( 1 )] << get items;
Code Explanation:
- Open data table.
- Select row 1.
- Exclude selected row.
- Fit parametric survival model.
- Set frequency to Count.
- Set response variable to Hours.
- Add effect x.
- Specify censor variable.
- Set censor code to 1.
- Set frequency to Weight.
- Choose Exponential distribution.
- Generate distribution plot.
- Show shaded area in plot.
- Fit life by X using Arrhenius Celsius.
- Use nested model tests.
- Specify Exponential distribution.
- Set response variable to Hours.
- Set predictor variable to x.
- Specify censor variable.
- Set censor code to 1.
- Set frequency to Weight.
- Close Scatterplot.
- Close Nonparametric Overlay.
- Close Comparisons.
- Try to get Separate Location and Scale report.
- Get items from Legend Box.
Example 2
Summary: Fits and creates reports for a parametric survival model with distribution plot, and subsequently fits life by X model to analyze the data.
Code:
dt = Open("data_table.jmp");
r = dt << Select Rows( [1] );
r << Exclude;
obj1 = dt << Fit Model(
Freq( :Count ),
Y( :Hours ),
Effects( :x ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
Personality( "Parametric Survival" ),
Distribution( "Exponential" ),
Run( Distribution Plot by Level Combinations( 1 ) )
);
fmrpt1 = obj1 << report;
(fmrpt1["Distribution Plot by Level Combinations"] << get scriptable object) << show shade;
obj2 = dt << Fit Life by X(
Relationship( Arrhenius Celsius ),
Nested Model Tests( Regression ),
Distribution( Exponential ),
Y( :Hours ),
X( :x ),
Censor( :Censor ),
Censor Code( 1 ),
Freq( :Weight ),
);
flbxrpt1 = obj2 << report;
Code Explanation:
- Open table.
- Select row.
- Exclude selected row.
- Fit parametric survival model.
- Set frequency column.
- Set response column.
- Add effect.
- Set censor column.
- Set censor code.
- Set weight column.
- Set personality to Parametric Survival.
- Set distribution to Exponential.
- Run distribution plot.
- Get report object.
- Show shade on plot.
- Fit life by X.
- Set relationship to Arrhenius Celsius.
- Set nested model tests.
- Set distribution to Exponential.
- Set response column.
- Set predictor column.
- Set censor column.
- Set censor code.
- Set weight column.
- Get report object.
Distribution using Multivariate
Summary: Executes a multivariate analysis using Hotelling's T² Test, extracting relevant statistics and calculating probability from F Ratio.
Code:
dt = Open("data_table.jmp");
obj = dt << Multivariate( Y( 1 :: 4 ), Hotelling's T² Test( 5.8, 3, 3.7, 1.1 ) );
rpt = obj << report;
meanHotel = rpt[Outline Box( "Hotelling's T² Test" )][Number Col Box( "Mean" )] << get as matrix;
meanHypo = rpt[Outline Box( "Hotelling's T² Test" )][Number Col Box( "Hypothesized Mean" )] << get as matrix;
testStat = rpt[Outline Box( "Hotelling's T² Test" )][Number Col Box( "Test Statistic" )] << get as matrix;
fRatio = rpt[Outline Box( "Hotelling's T² Test" )][Number Col Box( "F Ratio" )] << get as matrix;
probF = rpt[Outline Box( "Hotelling's T² Test" )][Number Col Box( "Prob > F" )] << get as matrix;
_mat = dt << Get As Matrix;
nRows = N Row( _mat );
oneMat = J( N Row( _mat ), 1, 1 );
ident = Identity( N Row( _mat ) );
ybar = Transpose( _mat ) * oneMat / N Row( _mat );
s = Transpose( _mat ) * (ident - oneMat * Transpose( oneMat ) / N Row( _mat )) * _mat / (N Row( _mat ) - 1.0);
t2Cal = N Row( _mat ) * Transpose( ybar - meanHypo ) * Inv( s ) * (ybar - meanHypo);
fCal = (N Row( _mat ) - N Col( _mat )) * t2Cal / N Col( _mat ) / (N Row( _mat ) - 1);
df1 = N Col( _mat );
df2 = N Row( _mat ) - N Col( _mat );
prob = 1 - F Distribution( fCal, df1, df2 );
obj << Univariate Simple Statistics( 1 );
Code Explanation:
- Open data table;
- Perform multivariate analysis.
- Apply Hotelling's T² Test.
- Extract test report.
- Retrieve mean vector.
- Fetch hypothesized mean vector.
- Get test statistic.
- Obtain F Ratio.
- Calculate probability from F Ratio.
- Compute univariate statistics.
Distribution using Expr
Summary: Runs the fitting and refitting of a parametric survival model to analyze the relationship between temperature, hours worked, and censoring in a data table.
Code:
dt = Open("data_table.jmp");
parmSurv = Expr(
dt << Fit Model(
Freq( :Weight ),
Y( :Hours ),
Effects( Arrhenius( :Temp ) ),
Personality( Parametric Survival ),
Distribution( LogNormal ),
Censor( :Censor ),
Run( Likelihood Ratio Tests( 1 ), {Estimate Survival Probability( Temp = 40.9853, [30000, 10000], Alpha( 0.05 ) )} )
)
);
dt:Hours << Set Property( "Missing Value Codes", {1298, 1390, 3187} );
ps1 = Eval( Name Expr( parmSurv ) );
rv1 = Report( ps1 )["Parameter Estimates"][Table Box( 1 )] << get as matrix;
dt:Hours[2 :: 4] = .;
ps2 = Eval( Name Expr( parmSurv ) );
rv2 = Report( ps2 )["Parameter Estimates"][Table Box( 1 )] << get as matrix;
dt = dt << Revert;
dt:Temp << Set Property( "Missing Value Codes", {40} );
ps1 = Eval( Name Expr( parmSurv ) );
rv1 = Report( ps1 )["Parameter Estimates"][Table Box( 1 )] << get as matrix;
dt:Temp[dt << get rows where( Col Stored Value( :Temp ) == 40 )] = .;
ps2 = Eval( Name Expr( parmSurv ) );
rv2 = Report( ps2 )["Parameter Estimates"][Table Box( 1 )] << get as matrix;
(dt << select where( Is Missing( :Temp ) )) << delete rows;
ps3 = Eval( Name Expr( parmSurv ) );
rv3 = Report( ps3 )["Parameter Estimates"][Table Box( 1 )] << get as matrix;
dt = dt << Revert;
dt:Censor << Delete Formula;
dt:Censor[2 :: 4] = 3;
dt:Censor << Set Property( "Missing Value Codes", 3 );
ps1 = Eval( Name Expr( parmSurv ) );
rv1 = Report( ps1 )["Parameter Estimates"][Table Box( 1 )] << get as matrix;
dt:Censor[dt << get rows where( Col Stored Value( :Censor ) == 3 )] = .;
ps2 = Eval( Name Expr( parmSurv ) );
rv2 = Report( ps2 )["Parameter Estimates"][Table Box( 1 )] << get as matrix;
Code Explanation:
- Open data table.
- Define parameter survival model.
- Set missing value codes for Hours.
- Fit model with specified parameters.
- Extract parameter estimates.
- Introduce missing values in Hours.
- Refit model with updated data.
- Extract new parameter estimates.
- Revert data table to original state.
- Set missing value codes for Temp.
- Introduce missing values in Temp.
- Refit model with updated data.
- Extract new parameter estimates.
- Delete rows with missing Temp.
- Refit model with updated data.
- Extract new parameter estimates.
- Revert data table to original state.
- Remove formula from Censor.
- Introduce missing values in Censor.
- Set missing value codes for Censor.
- Refit model with updated data.
- Extract new parameter estimates.
- Introduce missing values in Censor.
- Refit model with updated data.
- Extract new parameter estimates.
Distribution using Preferences
Summary: Creates and displays a life distribution object, fitting Weibull distributions by cause and showing remaining life distribution.
Code:
Preferences( Profiler Graph( Prediction Profiler( 1 ) ) );
dt = Open("data_table.jmp");
obj = dt << Life Distribution( Y( :Time Cycles ), Failure Cause( :Cause Code ), Failure Distribution by Cause( Weibull ) );
obj << Show Remaining Life Distribution( 1 );
Preferences( Profiler Graph( Prediction Profiler( 0 ) ) );
Code Explanation:
- Set profiler graph preferences.
- Open data table;
- Create life distribution object.
- Fit Weibull distribution by cause.
- Show remaining life distribution.
- Reset profiler graph preferences.
Distribution using For Each Row
Summary: Runs life distribution analysis for a dataset, utilizing Weibull failure distribution and AICc comparison criterion to model time-to-failure data.
Code:
dt1 = Open("data_table.jmp");
For Each Row(
If( :Causes == "cord short",
:Time Cycles = .
);
If( :Causes == "stripped gear",
Censor = .
);
If( :Causes == "none",
Row State() = Excluded State( 1 )
);
);
Row() = 1;
:Time Cycles = .;
Row() = 13;
:Censor = .;
Row() = 25;
Row State() = Excluded State( 1 );
Row() = 39;
:Censor = 1;
plat1 = dt1 << Life Distribution(
Y( :Time Cycles ),
Failure Cause( :Causes ),
Censor( :Censor ),
Failure Distribution by Cause( Weibull ),
Comparison Criterion( AICc ),
<<Set Scriptables(
{Distribution( Profiler( 1, Term Value( Time Cycles( 1438 ) ) ) ), Quantile( Profiler( 1, Term Value( Probability( 0.5 ) ) ) ),
Hazard( Profiler( 1, Term Value( Time Cycles( 1438 ) ) ) ), Density( Profiler( 1, Term Value( Time Cycles( 1438 ) ) ) )}
)
);
r = Report( plat1 );
val = Num( r["Distribution Profiler"][Text Box( 2 )] << GetText );
val = Num( r["Quantile Profiler"][Text Box( 2 )] << GetText );
val = Num( r["Hazard Profiler"][Text Box( 2 )] << GetText );
val = Num( r["Density Profiler"][Text Box( 2 )] << GetText );
Code Explanation:
- Open data table.
- Loop through each row.
- If cause is "cord short", set Time Cycles to missing.
- If cause is "stripped gear", set Censor to missing.
- If cause is "none", exclude row.
- Set Time Cycles to missing for specific rows.
- Set Censor to missing for specific row.
- Exclude specific row.
- Set Censor value for specific row.
- Perform life distribution analysis.
Distribution using Fit Life By X
Summary: Runs a Fit Life By X analysis to estimate parameters for Lognormal and Weibull distributions, utilizing Arrhenius Celsius relationship and Likelihood confidence interval method.
Code:
dt = Open("data_table.jmp");
flbx = dt << Fit Life By X(
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Freq( :Weight ),
Censor Code( 1 ),
Relationship( Arrhenius Celsius ),
Distribution( Lognormal ),
Confidence Interval Method( Likelihood )
);
rept = Report( flbx );
vals = rept["Lognormal Results"]["Estimates"][Table Box( 1 )] << get as matrix;
expv = [-13.4686494207914 2.88719528811923 -20.115421105384 -8.40164654332845,
0.627879029025705 0.0828422376782867 0.483719950487492 0.819837492564984,
0.977823307328087 0.132646841196788 0.76452969113322 1.30516913454126];
flbx << Fit Weibull;
vals = rept["Weibull Results"]["Estimates"][Table Box( 1 )] << get as matrix;
expvals = [-13.316832462371 3.31312940329621 -21.0250991684272 -7.6426366282871,
0.633824716846977 0.0968913104593384 0.468985933564815 0.860474536730713,
0.706983657381102 0.102881886790494 0.540817889223946 0.95965794530639];
flbx << Confidence Level( .99 );
vals = rept["Weibull Results"]["Estimates"][Table Box( 1 )] << get as matrix;
expvals = [-13.316832462371 3.31312940329621 -24.0998396031075 -6.11739751110351,
0.633824716846977 0.0968913104593384 0.425206996178278 0.951371066116189,
0.706983657381102 0.102881886790494 0.500349112337829 1.06627963804919];
Code Explanation:
- Open data table;
- Perform Fit Life By X analysis.
- Set Y variable to "Hours".
- Set X variable to "Temp".
- Define censor variable as "Censor".
- Use "Weight" as frequency.
- Set censor code to 1.
- Choose Arrhenius Celsius relationship.
- Select Lognormal distribution.
- Use Likelihood confidence interval method.
Distribution using N Col
Summary: Fits a life by X analysis to a data table, extracting statistics and saving probability, quantile, and hazard estimates.
Code:
dt = Open("data_table.jmp");
bc = N Col( dt << get as matrix );
fx = dt << Fit Life by X(
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Freq( :Weight ),
Distribution( Exponential ),
Relationship( Arrhenius Celsius )
);
ob = Report( fx )["Statistics"] << Get Scriptable Object;
ob << Save Probability Estimates;
ob << Save Quantile Estimates;
ob << Save Hazard Estimates;
mt = (dt << get as matrix);
Code Explanation:
- Open data table.
- Count columns in table.
- Fit life by X analysis.
- Specify response variable.
- Specify predictor variable.
- Define censoring variable.
- Include frequency weights.
- Choose exponential distribution.
- Apply Arrhenius Celsius relationship.
- Extract statistics report.
Distribution using Words
Example 1
Summary: Fits a lognormal distribution to data using an Arrhenius-Celsius relationship, censoring values with code 99 and weighting by frequency.
Code:
dt = Open("data_table.jmp");
check = Words(
Log Capture(
dt << Fit Life by X(
Relationship( Arrhenius Celsius ),
Distribution( Lognormal ),
Y( :Hours ),
X( :Temp ),
Censor( :Censor ),
Censor Code( 99 ),
Freq( :Weight )
)
),
"\!N"
)[1];
Code Explanation:
- Open data table.
- Perform log capture.
- Fit life by X analysis.
- Use Arrhenius Celsius relationship.
- Apply Lognormal distribution.
- Set Y variable as Hours.
- Set X variable as Temp.
- Define Censor variable.
- Set Censor Code to 99.
- Use Weight for frequency.
Example 2
Summary: Runs life distribution analysis on a data table, capturing log output and extracting the first word to check for censoring.
Code:
dt = Open("data_table.jmp");
check = Words( Log Capture( dt << Life Distribution( Y( :Hours ), Censor( :Censor ), Censor Code( 99 ), Freq( :Weight ) ) ), "\!N" )[1];
Code Explanation:
- Open data table;
- Perform life distribution analysis.
- Set Y variable to "Hours".
- Specify censoring variable "Censor".
- Define censor code as 99.
- Use frequency variable "Weight".
- Capture log output.
- Split log into words.
- Extract first word from split result.
- Assign extracted word to "check".
Distribution using Subset
Summary: Runs life distribution analysis and Bayesian estimation on a subset of data, utilizing Lognormal fit and automatic recalculation.
Code:
dt = Open("data_table.jmp");
dt2 = dt << Subset( All Rows( 1 ), All Columns( 1 ) );
Random Reset( 123456789 );
dt << Select Randomly( 0.1 ) << Hide and Exclude();
dt << Clear Select;
Random Reset( 123456789 );
obj = dt << Life Distribution( Y( :Hours ), Censor( :Status ), Freq( :Weight ), Censor Code( "Censored" ) );
obj << Fit Lognormal;
Random Reset( 123456789 );
obj2 = dt2 << Life Distribution( Y( :Hours ), Censor( :Status ), Freq( :Weight ), Censor Code( "Censored" ) );
obj2 << Fit Lognormal;
obj2 << Automatic Recalc( 1 );
Random Reset( 123456789 );
dt2 << Select Randomly( 0.1 ) << Hide and Exclude();
dt2 << Clear Select;
Close( dt, nosave );
Close( dt2, nosave );
dt = Open("data_table.jmp");
obj = dt << Life Distribution( Y( :Time Cycles ), Censor( :Censor ), <<Fit Lognormal, );
rpt = obj << report;
scptObj = rpt["Parametric Estimate - Lognormal"] << get scriptable object;
scptObj << Bayesian Estimates;
txt = rpt["Bayesian Estimation - Lognormal"][Text Box( 1 )] << get text;
name = rpt["Bayesian Estimation - Lognormal"][String Col Box( "Name" )] << get;
Close( dt, No Save );
Random Reset( 1111111111 );
dt = Open("data_table.jmp");
lCap = Log Capture(
dt << Life Distribution(
Y( :Time Cycles ),
Censor( :Censor ),
Censor Code( 1 ),
Failure Cause( :Causes ),
Failure Distribution by Cause( Weibull ),
Comparison Criterion( AICc ),
Allow failure mode to use Bayesian models( 1 ),
<<Fit Model(
{{"bearing seal", Bayesian Weibull, 0}, {"belt", Bayesian Weibull, 0}, {"circuitry", Bayesian Weibull, 1}, {"container throw",
Bayesian Weibull, 0}, {"cord short", Bayesian Weibull, 0}, {"engine fan", Bayesian Weibull, 0}, {"none", Bayesian Weibull, 0},
{"power switch", Bayesian Weibull, 0}, {"stripped gear", Bayesian Weibull, 0}, {"switch, other", Bayesian Weibull, 1}}
)
)
);
Code Explanation:
- Open data_table data
- Create subset of all rows and columns.
- Set random seed.
- Randomly select and hide 10% of rows.
- Clear row selection.
- Reset random seed.
- Fit Lognormal life distribution on main data.
- Reset random seed.
- Fit Lognormal life distribution on subset.
- Enable automatic recalculation.
- Reset random seed.
- Randomly select and hide 10% of subset rows.
- Clear row selection.
- Close both datasets without saving.
- Open data_table data
- Fit Lognormal life distribution.
- Extract report object.
- Get scriptable object for Parametric Estimate.
- Perform Bayesian estimates.
- Extract Bayesian estimation text.
- Extract Bayesian estimation names.
- Close dataset without saving.
- Reset random seed.
- Open data table;
- Capture log output for life distribution analysis with detailed settings.
Distribution using Run Script
Example 1
Summary: Analyze survival data by running a script, extracting logrank and Wilcoxon test results, and generating a life distribution report.
Code:
dt = Open("data_table.jmp");
obj1 = dt << Run Script( "Survival" );
rpt1 = obj1 << report;
lr1 = (rpt1["Tests Between Groups"][Table Box( 1 )] << get as matrix)[1, 0];
wil1 = (rpt1["Tests Between Groups"][Table Box( 1 )] << get as matrix)[2, 0];
obj2 = dt << Life Distribution(
Perspective( Compare Groups ),
Y( :days ),
Grouping( :Group ),
Censor( :Censor ),
Censor Code( 1 ),
Confidence Interval Method( Wald ),
Select Distribution( Distribution, Nonparametric ),
Select Scale( Nonparametric ),
Tabbed Report( 0 )
);
rpt2 = obj2 << report;
ght2 = (rpt2["Group Homogeneity Tests"][Table Box( 1 )] << get as matrix);
Code Explanation:
- Open data table;
- Run script "Survival".
- Get report from Survival.
- Extract Logrank test result.
- Extract Wilcoxon test result.
- Create Life Distribution object.
- Set perspective to Compare Groups.
- Set Y variable to days.
- Set grouping variable to Group.
- Set censor variable to Censor.
Example 2
Summary: Runs reliability forecasting by running a script, defining forecast expressions, and configuring forecast options in JMP.
Code:
dt = Open("data_table.jmp");
rf = dt << Run Script( "Reliability Forecast" );
rfrpt = Report( rf );
rf forecast expr = Expr(
rf << Forecast( _expr_ )
);
frs expr = Expr(
Future Risk Set(
[3026, 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026],
[3139862400, 3142540800, 3145219200, 3147811200, 3150489600, 3153081600, 3155760000, 3158438400, 3160944000, 3163622400, 3166214400,
3168892800, 3171484800, 3174163200, 3176841600, 3179433600, 3182112000]
)
);
Eval( Substitute( Name Expr( rf forecast expr ), Expr( _expr_ ), Name Expr( frs expr ) ) );
rf << Forecast Options( Show Interval( 1 ) );
rf << Forecast( Alpha( 0.01 ) );
rf << Forecast( Contract( 1, year ) );
rf << Forecast( Forecast Type( Cumulative ), Distribution( Frechet ) );
dist = (rfrpt["Forecast"][Panel Box( 3 )][Combo Box( 1 )] << get items)[rfrpt["Forecast"][Panel Box( 3 )][Combo Box( 1 )] << get];
ftype = (rfrpt["Forecast"][Panel Box( 4 )][Radio Box( 1 )] << get items)[rfrpt["Forecast"][Panel Box( 4 )][Radio Box( 1 )] << get];
rf << Forecast( Forecast Type( Incremental ) );
rf << Forecast( Forecast To( 01Jan2006 ) );
rf << Forecast( Interval Type( Plugin Interval ) );
script = rf << get script;
Random Reset( 392929 );
rf << Forecast( Group( "" ), Risk Set( J( 36, 1, Random Integer( 100 ) + 1975 ) ) );
Eval( Substitute( Name Expr( rf forecast expr ), Expr( _expr_ ), Name Expr( frs expr ) ) );
rf << Forecast Options( Use Contract Length( 0 ) );
rf << Forecast Options( Use Failure Cost( 1 ) );
rf << Forecast Options( Set Failure Cost( 3.5 ) );
Code Explanation:
- Open data table.
- Run reliability forecast script.
- Get report object.
- Define forecast expression.
- Define future risk set expression.
- Substitute expressions for forecasting.
- Show forecast interval.
- Set forecast alpha level.
- Set forecast contract period.
- Set forecast type and distribution.
Example 3
Summary: Runs the opening and processing of multiple data tables, creating new projects and setting window titles, while also generating a tabulate with age grouping.
Code:
dt1 = Open("data_table1.jmp");
dt2 = Open("data_table2.jmp");
dt1 << Run Script( "Bivariate" );
p1 = New Project();
p1 << run script( dt1 = Open("data_table1.jmp") );
p1 << run script( dt2 = Open("data_table2.jmp") );
p1 << run script( dt3 = Open("data_table3.jmp") );
p1 << run script( objTab = Tabulate( Add Table( Row Table( Grouping Columns( :Age ) ) ) ) );
p1 << Set Window Title( "Test" );
p1 << Close Window();
p1 = New Project();
p1 << run script( Open( "$SAMPLE_DATA/data_table.jmp", ) );
p1 << run script( Open("data_table1.jmp") );
p1 << run script( Open("data_table2.jmp") );
p1 << run script( Tabulate( Add Table( Row Table( Grouping Columns( :Age ) ) ) ) );
p1 << Set Window Title( "Test 1" );
p2 = New Project();
p2 << run script( Open("data_table3.jmp") );
p2 << Set Window Title( "Test 2" );
p1 << Close Window();
p2 << Close Window();
p1 = New Project();
p1 << run script( dt1 = Open("data_table1.jmp") );
p1 << run script( Open("data_table2.jmp") );
p1 << run script( Open("data_table3.jmp") );
p1 << run script( Tabulate( Add Table( Row Table( Grouping Columns( :Age ) ) ) ) );
p1 << Set Window Title( "Test 1" );
p2 = New Project();
p2 << run script( Open("data_table2.jmp") );
p2 << Set Window Title( "Test 2" );
p3 = New Project();
p3 << run script( Open("data_table3.jmp") );
p3 << Set Window Title( "Test 3" );
p4 = New Project();
p4 << run script( Open("data_table.jmp") );
p4 << Set Window Title( "Test 4" );
dt1 = Open("data_table1.jmp");
dt2 = Open("data_table2.jmp");
biv = dt1 << Distribution( Continuous Distribution( Column( :miles ) ) );
Code Explanation:
- Open data table;
- Open data table;
- Run Bivariate script on data_table.jmp.
- Create new project p1.
- Open data table;
- Open data table;
- Open data table;
- Create Tabulate with Age grouping in p1.
- Set p1 window title to "Test".
- Close p1 window.
Distribution using Fit Curve
Example 1
Summary: Fits and creates reports for a Probit 2p curve to dissolution data, extracting estimates, standard errors, correlation matrix, and model comparison, followed by the removal of the fit and subsequent nonlinear modeling.
Code:
dt = Open("data_table.jmp");
fc = dt << Fit Curve( Y( :Y ), X( :X ), Fit Probit 2p );
rfc = fc << report;
est1 = Matrix( rfc[Number Col Box( "Estimate" )] << get );
std1 = Matrix( rfc[Number Col Box( "Std Error" )] << get );
corr1 = rfc[Outline Box( "Correlation of Estimates" )][Matrix Box( 1 )] << get;
modComp1 = Matrix( rfc[Outline Box( "Model Comparison" )][Table Box( 1 )] << get )[3 :: 8];
fc << (Fit["Probit 2p"] << Remove Fit);
nlin = dt << Nonlinear( Y( :Y ), Model( Parameter( {a = 0.03, b = 11}, Normal Distribution( a * (:X - b) ) ) ), Newton, Finish );
rpt = nlin << report;
est2 = Matrix( rpt[Number Col Box( "Estimate" )] << get );
std2 = Matrix( rpt[Number Col Box( "ApproxStdErr" )] << get );
corr2 = rpt[Outline Box( "Correlation of Estimates" )][Matrix Box( 1 )] << get;
sol2 = Matrix( rpt[Outline Box( "Solution" )][Table Box( 1 )] << get );
Code Explanation:
- Open data table.
- Fit Probit 2p curve.
- Retrieve fit report.
- Extract estimates.
- Extract standard errors.
- Extract correlation matrix.
- Extract model comparison.
- Remove Probit 2p fit.
- Fit nonlinear model.
- Retrieve nonlinear report.
Example 2
Summary: Fits a generalized linear model using Fit Curve and Nonlinear platforms, retrieving reports, and extracting estimates and standard errors from the data table.
Code:
dt = Open("data_table.jmp");
fc = dt << Fit Curve( Y( :Algae density ), X( :Days ), Group( :Treatment ), Fit Probit 3P( Test Parallelism ) );
rfc = fc << report;
est1 = Matrix( rfc[Number Col Box( "Estimate" )] << get );
std1 = Matrix( rfc[Number Col Box( "Std Error" )] << get );
nlin = dt << Nonlinear(
Y( :Algae density ),
Group( :Treatment ),
Model(
Parameter(
{a_COOShaking = 3.4, b_COOShaking = 3.4, c_COOShaking = 3.4, a_CO2 = 4.57, b_CO2 = 4.57, c_CO2 = 4.57, a_Control = 7.2,
b_Control = 7.2, c_Control = 7.2, a_Shaking = 0.2, b_Shaking = 5.6, c_Shaking = 4},
a = Match( :Treatment, "CO0 & Shaking", a_COOShaking, "CO2", a_CO2, "Control", a_Control, "Shaking", a_Shaking, . );
b = Match( :Treatment, "CO0 & Shaking", b_COOShaking, "CO2", b_CO2, "Control", b_Control, "Shaking", b_Shaking, . );
c = Match( :Treatment, "CO0 & Shaking", c_COOShaking, "CO2", c_CO2, "Control", c_Control, "Shaking", c_Shaking, . );
c * Normal Distribution( a * (:Days - b) );,
),
),
Newton,
Finish
);
rpt = nlin << report;
est2 = Matrix( rpt[Number Col Box( "Estimate" )] << get );
Code Explanation:
- Open data table.
- Fit curve model.
- Retrieve fit curve report.
- Extract estimates from fit curve.
- Extract standard errors from fit curve.
- Perform nonlinear regression.
- Retrieve nonlinear regression report.
- Extract estimates from nonlinear regression.
Distribution using Tick Seconds
Summary: Fits a normal distribution to the PMS1 column in a data table, recording start and end times for timing purposes.
Code:
dt = Open("data_table.jmp");
before = Tick Seconds();
obj = dt << Distribution( Continuous Distribution( Column( :PMS1 ), Fit Distribution( Normal ) ) );
after = Tick Seconds();
time = after - before;
Code Explanation:
- Open data table;
- Record start time.
- Create distribution object.
- Fit normal distribution to PMS1.
- Record end time.
- Calculate elapsed time.
Distribution using Get Window List
Summary: Process of extracting window titles, sorting them, and removing duplicates from a JMP project.
Code:
currWindows = Get Window List() << Get Window Title;
For( ii = 1, ii <= N Items( currWindows ), ii++,
currWindows[ii] = Words( currWindows[ii], "." )[1]
);
currWindows = Sort Ascending( currWindows );
cleanList = Function( {list},
{ii},
For( ii = 1, ii <= N Items( list ), ii++,
list[ii] = Words( list[ii], "." )[1]
);
list = Sort Ascending( list );
For( ii = N Items( list ), ii > 0, ii--,
If( Contains( currWindows, list[ii] ),
Remove From( list, ii )
)
);
Return( list );
);
p1 = New Project();
dt1 = p1 << Run Script( dt1 = Open("data_table.jmp") );
dt2 = p1 << Run Script( dt2 = Open("data_table.jmp") );
dt3 = p1 << Run Script( dt3 = Open("data_table.jmp") );
obj3 = p1 << Run Script(
obj3 = dt3 << Distribution( Continuous Distribution( Column( dt3:Chest decel ) ), Continuous Distribution( Column( dt3:Wt ) ) )
);
p1 << Save( "$TEMP/testProj1.jmpprj" );
dt4 = Open("data_table.jmp");
obj4 = dt4 << Run Script( "Scatterplot 3D" );
p2 = New Project();
dt5 = p2 << Run Script( dt5 = Open("data_table.jmp") );
obj5 = p2 << Run Script( obj5 = dt5 << Run Script( Distribution( Continuous Distribution( Column( dt5:ABRASION ) ) ) ) );
p2 << Show Log( 1 );
p2 << Save( "$TEMP/testProj2.jmpprj" );
obj1 = If( Host is( "Windows" ),
Get Window( Project( p1 ), "Animals" ),
Get Window( Project( p1 ), "Animals.jmp" )
);
obj2 = Get Window( "Iris - Scatterplot 3D" );
p1 << close window();
p2 << close window();
Code Explanation:
- Get list of window titles.
- Extract first word from each title.
- Sort the list of window titles.
- Define function
cleanList. - Create new project
p1. - Open data table;
- Open data table;
- Open data table;
- Create distribution for "Chest decel" and "Wt" in
dt3. - Save project
p1as "testProj1.jmpprj". - Open data table;
- Run "Scatterplot 3D" on "Iris.jmp".
- Create new project
p2. - Open data table;
- Create distribution for "ABRASION" in
dt5. - Show log for
p2. - Save project
p2as "testProj2.jmpprj". - Get window "Animals" from
p1. - Get window "Iris - Scatterplot 3D".
- Close project
p1. - Close project
p2.
Distribution using Name
Summary: Analyze and extract distribution statistics for a continuous column 'ZN-E' in a JMP data table, including setting missing value codes and generating a report with outline boxes.
Code:
dt1 = Open("data_table.jmp");
dt1:Name( "ZN-E" ) << {Set Property( "Missing Value Codes", {0.1, 33.5} )};
dist1 = dt1 << Distribution( Continuous Distribution( Column( :Name( "ZN-E" ) ) ) );
matrix = Report( dist1 )[Outline Box( 3 )][Table Box( 1 )][Number Col Box( 1 )] << get as matrix;
Code Explanation:
- Open data table;
- Set missing value codes for "ZN-E".
- Create distribution analysis for "ZN-E".
- Extract outline box 3 from report.
- Extract table box 1 from outline box.
- Extract number column box 1 from table box.
- Convert extracted data to matrix.
Distribution using Censor
Summary: Runs life distribution analysis by opening a data table, performing censoring, and configuring platform preferences for confidence interval method.
Code:
dt = Open("data_table.jmp");
lifedistribution( Censor( :Censor ) );
wn = Window( "Life Distribution" );
selval1 = (wn[Combo Box( 1 )] << get items)[wn[Combo Box( 1 )] << get];
selval2 = (wn[Combo Box( 2 )] << get items)[wn[Combo Box( 2 )] << get];
wn << close window;
Preference( LifeDistribution( Confidence Interval Method( Likelihood ) ) );
prefcode = Arg( Arg( Arg( Get Preferences( LifeDistribution( Confidence Interval Method ) ), 1 ), 1 ), 1 ) || "";
lifedistribution();
wn = Window( "Life Distribution" );
selval1 = (wn[Combo Box( 1 )] << get items)[wn[Combo Box( 1 )] << get];
selval2 = (wn[Combo Box( 2 )] << get items)[wn[Combo Box( 2 )] << get];
wn << close window;
Code Explanation:
- Open data table.
- Perform life distribution analysis.
- Retrieve window reference.
- Get selected value from first combo box.
- Get selected value from second combo box.
- Close window.
- Set platform preference for confidence interval method.
- Retrieve preference code.
- Perform life distribution analysis again.
- Retrieve updated window reference.