How to compare parameter distributions using Prism
The two examples above showed the general approach to comparing distributions. Here are step-by-step instructions for comparing parameter distributions using Prism, using the exponential decay example.
1. Generate simulated data with random error
1. Create a new file. From an empty data table, click Analyze, choose built-in analyses, and then choose to simulate a theoretical curve.
2. Click More equations, and enter the first equation, for example. Y=Start*exp(-Krate*X)
3. Enter the ideal values. Choose values that are similar to those you would expect to see with real data. For this example, we enter Start = 100 and Krate = 0.3. These values will simulate a dissociation curve that starts at 100 units and decays exponentially towards 0 with a rate constant (koff) of 0.3 min-1 and a half-life of a bit more than 2 minutes (ln(2)/koff).
4. Choose to generate 10 data points (line segments) starting at 0 and ending at 20 (minutes).
5. Check the option box to add Gaussian "noise" with a standard deviation (SD) of 10. Choose a value that is similar to the scatter you expect to see with real data. Click ok and Prism will generate a simulated data set.
Click on the Graphs folder tab to see a graph of these data (plotted as line segments). Change to data points by clicking Change... Symbols and lines. Now click Change.. analysis parameters to bring up the dialog for simulating curves. Don't change any of the parameters, but simply click ok. Prism will generate new random values, and you'll see that the graph has changed.
2. Analyze the simulated data
The next step is to analyze the simulated data to determine the best-fit values. Follow these steps.
While still on the Results page with the simulated data, click Analyze, and select nonlinear regression.
Select the same built-in equation used to generate the theoretical points. Click Initial values and enter the ideal values. Start=100, Krate=0.3. Click ok twice to fit the curve.
Note the best-fit values.
3. Simulate thousands of data sets using a Prism script
Create a script to instruct Prism to generate and analyze 5000 sets of data, and record the best-fit values. To learn details about scripting, read the chapter on scripts in the Prism User's Guide.
Using Notepad or some other text editor, create a file with the following script. Enter the lines shown in the left column. The right column explains what each command does, and should not be typed. Give the file a name with the extension pzc.
| Script line |
Explanation |
| Shortlog |
Don't add a line to the log for each iteration. |
| Setpath c:\sims |
Use this folder. You'll want to change the folder name from "sims" to something else. |
| Open disskin.pzm |
Open a Prism file. You'll want to change the file name. |
| OpenOutput kinfit.txt |
Create a text file to hold the best-fit values. |
| ForEach 5000 |
Loop 5000 times. |
| Goto R 1 |
Go to the first results page. |
| Regenerate |
Create new random numbers. |
| Goto R 2 |
Go to the second results page. |
| WCell 4,1 |
Write the value in the fourth row of the first column into the output file. This is the best-fit value of the rate constant. |
| Next |
Loop again. |
Run this script from Prism, by choosing the Run Automation File command from the Tools menu. Selecting the script you just created, and click Run to execute it. Depending on the speed of your computer, this task should take a few minutes to execute.
4. Create a frequency distribution of the best-fit values
Now lets look at the distribution of best-fit values.
1. Create a new data table, formatted with no X column and a single column of values for Y.
2. Click in the first cell of the first data column on the table.
3. From the File menu, choose to Import. Choose the file with the best-fit values (the example script created kinfit.txt).
4. Click ok to accept all the defaults in the Import dialog.
5. You'll see the 5000 best-fit values in the data table.
6. To construct a frequency distribution of the data, click Analyze and select the Frequency distribution option in the Statistical Analyses section. You may need to adjust the bin width.
7. Inspect the graph. To show the graph with histogram "spikes", choose one of the bottom four choices of symbol shape.
8. To assess whether the best-fit values follow a Gaussian distribution, choose Analyze and then select Column Statistics from the Statistical Analyses option. From the Column Statistics dialog, choose to test whether the distribution is Gaussian.
9. To superimpose a Gaussian distribution, press Analyze and choose nonlinear regression. Choose the equation for a Gaussian distribution, the last choice in the list of classic equations.
5. Repeat with other forms of the equation
You can now repeat all the steps, but enter the equation in a different form. For this example, we switched from a rate constant to a time constant or log(rate constant).
|