Please enable JavaScript to view this site.

This guide is for an old version of Prism. Browse the latest version or update Prism

Navigation: Scripts > Example scripts

Script example 2. Monte Carlo analysis

Scroll Prev Top Next More

This is an example of Monte Carlo analysis. We'll simulate 500 data sets with random variation and fit a dose-response curve to each. This script creates a table containing the logEC50 and HillSlope from all 500 fits. Before running this script, you must create a file that has the first data table formatted for a one-grouping variable data set (no X, No Y subcolumns). The first results sheet must be one that simulates data with error. The second results sheet must be a nonlinear regression that fits a dose-response curve to the data.

Script command

Comments

Table Prism 1 Clear

Designate the first data table in your file to contain the results of this script. Delete all the contents of that table now (clear). Note this script requires that the first data table be formatted for one grouping variable data, with no X column.

ForEach 500

Loop 500 times.

 GoTo R 1

Go to the first results sheet, which is a simulation.

 Regenerate

Regenerate the simulation with new random numbers.

 GoTo R 2

Go to the second results sheet. Since this sheet contains nonlinear regression results, Prism will automatically refit the data for each loop.

 Wtable “logEC50”, 5,1

Write the value from the first Y column in row 5 to the first column of the output table, and label that column “logEC50”.

 Wtable “Hill Slope”, 6,1

Write the value from the first Y column in row 6 to the next (second) column of the output table, and label that column “Hill Slope”.

Next

Loop back to the ForEach statement.

 

When the script is done, table 1 will have two columns and 500 rows. Each row will have the logEC50 and Hill Slope from one of the simulated experiments.

 

 

 

© 1995-2019 GraphPad Software, LLC. All rights reserved.