CH 1
CH 1
CH 1
Introductory Tutorials
You may wish to familiarize yourself with some of the basic features in Origin 8. The following tutorials
are a good way to get started:
Tutorials:
Importing
2D Plotting
3D Plotting
ANOVA
Linear Fitting
Nonlinear Fitting
LabTalk Scripting
Origin GUI
Contents
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 2 of 57
1 Summary
3 Projects
4 Windows
4.1 Workbook
4.2 Graph
4.3 Matrix
5 Project Explorer
Summary
This tutorial will introduce you to the Origin workspace. You will learn about the different kinds of Origin
Windows that make up a Project, and how to manipulate these windows with Project Explorer.
Manipulate Workbooks
Projects
The Origin Project File is a convenient container for all of your data whether it be loose or associated with
child windows - workbooks, graphs, and matrices. It also contains results saved in the Results Log.
Only one project file can be open but you can append the contents of one project onto another.
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 3 of 57
Windows
Origin has numerous windows and workspaces available for completing various tasks. You can see all
types of windows from the New dialog (File: New). The most frequently used windows are Workbook,
Graph, and Matrix.
Workbook
The Origin workbook is the primary structure for organizing your data. Each workbook is composed of
one or more Origin worksheets. And each worksheet, in turn, is composed (usually) of one or more
worksheet columns or datasets. Columns in Origin have different types, such as X, Y, Z, yError, etc,
which represent the plot designation for graphing.
1. Select File: New from the menu and choose Workbook to create a new workbook.
2. Select File: Import: Simple ASCII to bring up the Open dialog. Browse to the \Samples\Curve
Fitting subfolder of the Origin program folder. Highlight the file Gaussian.dat and click the OK
button to import the data into the Origin worksheet.
3. On import, sparklines were automatically turned on, allowing you to quickly view the shape of the
data; the sheet name became the name of the file; and as needed an additional column was added to
the worksheet. You can see from the Long Name that the 3rd column represents data error. To set
this column as an Error Column, click the column title to highlight it, right-click to bring up a fly-
out menu, and then select Set As: Y Error.
4. Plotting data in Origin is now easy; highlight all three columns and select Plot: Symbol: Scatter
from the menu to create a scatter plot.
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 4 of 57
Graph
The Graph window is a container for graphical depictions of your experimental data and your analysis
results. Graph windows may contain a single plot in a single graph layer or they may contain multiple
plots in multiple graph layers.
The graph layer is the fundamental unit of the Origin graph. The layer is comprised of a set of axis scale
values, one or more data plots, and any included text labels, drawing objects, graph legends/color scales,
button objects, etc. Graph layers can be created, sized, and moved independently of one another, allowing
you a great deal of latitude in charting your data.
1. Create a new workbook, and import the file Linear Fit.dat from the \Sample\Curve Fitting folder.
You can see that there are three Y columns and one X column after import; each Y column will use
the left-most X column as its X coordinates.
2. Highlight columns B and C, and select Plot: Multi-Curve: Vertical 2 Panel to plot the curves. This
is a two layer graph. While a graph can have multiple layers, only one layer is active at any given
time. You can perform operations on the active layer, such as resizing, changing the plot color, etc.
When working on a layer, the active layer is denoted by a depressed layer n icon in upper left corner
of the graph window.
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 5 of 57
1. To rearrange these two layers, with the graph window active, select the menu item Graph: Layer
Management to bring up the dialog. Activate the Arrange tab, on the middle panel, enter 2 in the
Column edit box; enter 1 in the Row edit box and click the Arrange button. After you click the OK
button, the graph layers are arranged horizontally.
2.
Most often you will use the worksheet for tabulating and manipulating your data, while you will use the
graph window for plotting your data. However, if you are making 3D surface or contour plots of XYZ
data, you will need to become familiar with another window type ? the Origin Matrix.
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 6 of 57
Matrix
The Origin matrix window is a container for one or more Origin matrices. Each matrix window contains
one or more matrix sheets, and each matrix sheet can contain one or more matrix objects. The matrix
object itself, is a vector of Z values. These Z values are related to one another in the X and Y dimensions
by their relative row and column positions in the matrix. Matrices are a precursor to constructing Origin's
3D graph types such as contour graphs and color-mapped surfaces, and since they are used in depiction
and manipulation of 3D data, they are used by Origin in image processing and analysis. For more
information on creating 3D graphs please visit Plotting 3D.
Project Explorer
Typically, users amass quite a lot of data in an Origin project file. If you anticipate building a project file
that contains dozens of worksheets, graphs, notes windows, etc., you will probably want to use Project
Explorer (PE) to help you manage your Origin workspace. Project Explorer helps to organize your
workspace so that you see only data that is relevant to the task at hand. In addition, you can use Project
Explorer to create new project files from a portion of an existing project file or to append the contents of
another project file to your current file. The Project Explorer workspace can be hidden or restored as
needed.
When you first start Origin, Project Explorer displays docked to the edge of the workspace. You can dock
it to any other edge or float it in the workspace. Because Project Explorer uses some of your workspace,
you may want to close Project Explorer, even if you have already created a folder structure. To close/open
Project Explorer, press Alt + 1 or select menu item View: Project Explorer.
There are two panels in Project Explorer: the folders panel and the contents panel, which displays all
objects in the active folder. When you start a new Origin session, you can click the new workbook ,
new graph or new matrix button to create some blank windows, and then you can see these
window's icons in the contents panel. Double-click the icon to hide/view the window.
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 7 of 57
To create a new folder, right-click on the project folder (or a subfolder) in the folder panel, and select New
Folder from the shortcut menu.
Once you have created one or more subfolders, you can move child windows between folders by dragging
& dropping them within the Project Explorer workspace.
Importing
Contents
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 8 of 57
1 Summary
3 Steps
Summary
The File: Import: Single ASCII menu allows you to automatically import a simple ASCII file where the
data columns are delimited orderly and it consists of few header lines (maybe just a short description for
the file and then names and units for the columns).
The Import Wizard allows you to preview your file to help with importing of more complicated ASCII
files. This is useful for files with many lines of header where you may wish to extract variables from both
the import file name and the file header to later use for annotation on your graph.
The wizard can be used to create custom filter files for each of your file types. Once you've created your
filter(s), subsequent files are easily imported by drag-and-drop onto the Origin workspace.
Steps
Import Simple ASCII
Using Windows Explorer, browse to the \Samples\Import and Export subfolder of the Origin program
folder (by default installed in the Program Files folder). Open the file S15-125-03.dat in Windows
Notepad. You can see that this file includes header lines and data lines. For simple ASCII files, Origin can
auto detect file header/subheader and extract this information to the worksheet headers, such as Long
Name, Units, etc.
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 9 of 57
Note: Header lines are lines of text that are not part of the data and do not share the same delimiter
formatting as the data. Subheader lines also are not part of the data, but share the same delimiter
formatting and therefore correspond to particular columns of data.
1. Select File: Import: Single ASCII from the menu to open the File Import dialog. Browse to the
\Samples\Import and Export subfolder of the Origin program folder. Highlight the file S15-125-
03.dat.
2. If you double-click this file or click the Open button, Origin will import the file automatically. To
view the settings for how Origin will import the file, check the Show Options Dialog checkbox at
the botton of the dialog and then click Open. This will bring up the impASC X-Function dialog.
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 10 of 57
By default, Origin auto detects the subheader, and data will be imported from subheader. In this example,
Origin automatically set the first line,
TimeDelta Temperature Magnetic Field Position
as the worksheet column Long Name and the second line,
(sec) (K) (Oe) (mm)
as Units.
Import Wizard
The import wizard allows you to import complicated ASCII files, extract variables from the import file
name and header (for reuse in Origin), specify custom delimiters and date formats, or handle post-
processing of your imported data using a custom LabTalk script. In addition, another chief advantage of
using the Wizard to import your data files is that you can save your custom settings to a filter that can be
used repeatedly to import the same or similarly-structured files.
1. Create a new workbook. Select File: Import: Import Wizard to open the Import Wizard dialog.
Click the browser button right beside File box. Browse to the \Samples\Import and Export folder
and open the file F1.dat, and then click the Next button to navigate to File Name Options page.
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 11 of 57
2. Make sure the worksheet with file name box is checked to rename worksheet by imported file
name. Click Next to navigate to Header Lines page.
3. This page enables you to easily customize the worksheet headers. For example, to specify the
worksheet long name, put your cursor to the following line, and then click the button beside Long
Name.
4. Similarly, specify the Unit line and select <None> for Comments.
5. Skip the next Variable Extraction page and go to the Data Columns page. Select
XYYErrXYYErr from the Column Designations drop-down and click Apply.
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 12 of 57
6. Skip the Data Selection page, and go to the Save Filters page. To use these settings again, you can
save this import procedure as a filter. Check the Save filter box and give a proper filter name in the
Filter file name edit box (MyFilter in this example).
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 13 of 57
Use Filter
If you already have a filter, you can import similar files using this filter. For example, create a workbook
and open the Import Wizard again. Click the browser button and browse to \Samples\Import and Export
folder, select F1.dat, F2.dat, F3.dat and click the Add File(s) button. On the Import Filters for current
Data Type drop-down list, select MyFilter. Now click Finish button directly to import these three files
simultaneously.
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 14 of 57
Plotting 2D
Contents
1 Summary
3 Steps
3.3 Plot into graph template with the Plot Setup dialog
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 15 of 57
Summary
Origin provides flexible ways to create 2D plots. You can easily customize plot attributes, arrange layers,
and select different datasets for each layer. This tutorial will teach you the basic plotting skills.
Steps
1. Start with an empty worksheet, select File: Import: Single ASCII... to open the Import Single
ASCII dialog, browse to the \Samples\Curve Fitting subfolder of the Origin program folder, and
import the file Dose Response - No Inhibitor.dat.
2. Highlight columns 2 through 4 and select Statistics: Descriptive Statistics: Statistics on Rows.
Make sure to check the Mean and Standard Deviation check boxes on Quantities to Compute >
Moments branch to output these results.
3. After you click the OK button, two new columns, Mean(Y) and SD(yErr) are added to the source
worksheet. Here, yErr means that this is an error column and the data in this column can be used to
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 16 of 57
Note: To simplify plotting, each column in an Origin worksheet has a plotting designation. To
change a columns's plotting designation, select the column and click on the Column menu.
Alternatively, right-click on the column and choose Set As from the context menu.
1. Highlight the Mean(Y) and SD(yEr-) columns and select Plot: Line+Symbol: Line+Symbol to
create the plot:
2. To change the X scale to Log, double-click on the X axis to bring up the X Axis dialog. On the
Scale tab, change the axis Type to Log10:
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 17 of 57
3. Select Graph: Rescale to Show All from the menu, which will rescale the X and Y axes of the
graph. :
4. To edit the curve, double-click on any plot symbol to bring up the Plot Details dialog. Alternatively,
right-click inside the graph and choose Plot Details from the contect menu. On the Line tab of right
panel, select B-Spline as connect line to get a smoother curve.
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 18 of 57
5. When all modifications have been made and the graph looks the way you want it, you can use this
graph to create a template, to be used in the future with similar data. Select File: Save Template as
to open the Save Template dialog. In the Category drop-down list, select UserDefined; and then
type a proper Template Name. In this example, we use MyTemplate. Click OK to save the
template.
1. Click the button to open a new workbook, and import the file \Samples\Curve Fitting\Dose
Response - Inhibitor.dat as above. Perform Statistics on Rows, calculating the Mean and SD of this
worksheet as you did above and by following the same steps.
2. Select Plot: Template Library to open the Template Library. Select MyTemplate from the
UserDefined category.
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 19 of 57
Click the Plot Setup button to select the data from which to create the plot. If you click the Plot button,
Origin will plot whatever data is highlighted in the worksheet.
3. In the Plot Setup dialog, you can choose which columns are to be plotted. (There are three panels in
Plot Setup dialog, click the or button to expand them) To finish creating the plot from your
template, please follow the steps a - e outlined on the picture below.
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 20 of 57
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 21 of 57
Plotting 3D
Contents
1 Summary
3 Steps
Summary
In Origin, most 3D plots -- including 3D surface, wire frame/wire surface, 3D bar plot and 2D contour --
are created from an Origin matrix. In most cases, the raw data is XYZ data and you should convert it to a
matrix first, using one of Origin's built-in gridding routines.
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 22 of 57
Steps
2. Highlight the 3rd column, right-click, and select Set As: Z from the context fly-out menu.
3. To convert the worksheet XYZ data into a matrix, select Worksheet: Convert to Matrix: XYZ
Gridding to bring up the XYZ Gridding dialog. On the right preview panel, you can see that the
XY data are randomly distributed, so a random gridding method should be used.
If you can't see the preview panel, click the button to expand it.
4. Use the following settings and click OK to convert the XYZ columns of data into a matrix of data.
The TPS gridding method will generate a smooth surface.
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 23 of 57
5. Set as active the new generated matrix and select Plot: 3D Wires and Bars: Wire Frame from the
menu to plot a 3D mesh:
6. In order to plot the original data points on the graph, you can use the Layer Contents. Right-click
on the layer icon and select Layer Contents.
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 24 of 57
In the Layer Contents dialog, select the worksheet Z column (In this example, book1_c) and add it into the
Layer Contents list.
After you click OK, the source data points will be added to the layer.
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 25 of 57
7. You can now use the Plot Details dialog to modify the appearance. Double-click on the graph to
bring up the Plot Details dialog. On the left panel, select the 3D scatter data:
And then go to the Symbol tab on the right panel, adjust the symbol type, size and color, etc.
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 26 of 57
Contents
1 Summary
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 27 of 57
3 Steps
Summary
In Origin 8, analysis procedures can be controlled by Themes. Themes are actually XML files which save
settings in the analysis dialog. For example, when you open the dialog for the first time, Origin will bring
up the Built-in <Factory Default> theme which has preset some basic options. After performing the
analysis, there will now be a <Last Used> theme for this dialog which has saved the most recently used
settings. You can also assign a proper name for the theme and use it in the future.
For this tutorial, the Statistics on Columns dialog will be used to demonstrate how to create and use an
analysis theme. This analysis provides descriptive statistics about the data such as mean, standard
deviation, minimum, maximum, and more. For visualization, a histogram or box chart can also be created
in the Analysis Result Sheet.
Steps
2. Highlight column C and use the menu item Statistics: Descriptive Statistics: Statistics on
Columns to open the dialog.
3. Expand the Moments tree node, and check the N Total, Mean, Standard Deviation, SE of Mean and
Sum box.
4. Expand the Plots tree node, and check the Histograms and Box Charts check boxes. You will then
get the corresponding histogram as well as box chart graphs.
5. Your selections in this analysis dialog can be saved as your theme, so that you may easily repeat the
procedure. Click the "Save Theme as..." button:
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 28 of 57
7. Click the OK button. You will see the result in a new worsheet named DescStatsOnCols1.
Once you save a theme, there are many ways to use it. For example, you can highlight column E and
perform the same statistics on it.
Open the Statistics on Columns dialog from the Most Recently Used menu. Most of the menu
accessible dialogs can be found from MRU.
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 29 of 57
When you open the dialog from MRU, the default theme is <Last Used>. To use the MyTheme theme,
select MyTheme from the Dialog Theme drop-down list. The settings from that theme will then be
displayed in the dialog. Click the OK button to do the analysis.
Another way to apply the analysis theme is to use the cascaded menu item. Once you use an analysis
dialog, or save a theme for a dialog, there will be one more menu level added. You can choose the
MyTheme menu.
When selecting, Open Dialog..., the dialog will open to the <Factory Default> theme. To change the
settings of your theme, you can select your theme name from the Dialog Theme drop-down list, make
changes, and resave the theme. Alternatively, press the Shift key while selecting your theme directly from
the cascaded menu. Instead of the analysis running, the dialog will open with your theme selected. You
can now view the settings of the theme, make any changes, and resave the theme.
ANOVA
Contents
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 30 of 57
1 Summary
3 Steps
Summary
There are two main modes of datasets in Statistics - indexed and raw. When you perform an analysis, you
do not need to use the whole dataset, so Origin provides several ways to select data. For example, you can
use the interactive Regional Data Selector button to graphically select the data or you can use the Column
Browser dialog to make your selection.
In this tutorial, you'll use the Analysis of Variance (ANOVA) statistical test, to learn how to use these two
different modes of data to perform analysis and how to select data by using the Column Browser dialog.
ANOVA is a kind of parametric method for means comparison and is an extension of t-test. When there
are more than two groups to be compared, pairwise t-test is not appropriate and ANOVA should be used.
ANOVA requires normality and equal variance. Otherwise, non-parametric analysis should be used.
Steps
Origin can calculate ANOVA in indexed as well as raw data mode. For One-Way ANOVA, when using
indexed mode, data should be organized in two columns : one for Factor and the other for data.
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 31 of 57
When using Raw data mode, the different levels are in different columns.
Nitrogen content has been recorded in milligrams for 4 kinds of plant, and we are interested in whether
different plants have different nitrogen content. We will perform One-Way ANOVA using index data
mode for this example.
1. Start with a new workbook and import the file \Samples\Statistics\nitrogen.txt. Make sure you
select .txt from the drop-down menu files of type. First, we should perform a normality test on each
group of data to determine if they are from a normal distribution.
2. Highlight the first column, right-click and select Sort Worksheet from the Worksheet menu nnd
choose Ascending.
3. Highlight the second column from row 1 to row 20 - which belongs to "Plant1" - and open the
Normality Test dialog by choosing the menu item Statistics: Descriptive Statistics: Normality
Test.
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 32 of 57
4. Use the default setting of the dialog and click OK. From the p-value of result, we can see "Plant1"
follows a normal distribution.
5. In a similar way, you can highlight the range of data "Plant2", "Plant3" and "Plant4" and test for
Normality. Our sample data has normal distribution for all plants.
6. With our nitrogen data worksheet active, open the ANOVAOneWay dialog by using the menu item
Statistics: ANOVA: One-Way ANOVA. Set the Input Data mode as Indexed, assign the plant and
nitrogen column as Factor and Data respectively using the right-arrow buttons. Click the + to
expand the Means Comparison node, set Significance Level as 0.05 and check the Tukey Means
Comparison method. Check Levene | | from Tests for Equal Variance branch. Click the OK button
to perform One-Way ANOVA.
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 33 of 57
From the "Homogeneity of Variance Test" table of one-way ANOVA result, we can see that the four
groups have equal variance, since the p-value is bigger than 0.05.
From the result of Overall ANOVA we can conclude that at least two groups of the four have
significant different means, since the p-value is smaller than 0.05.
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 34 of 57
Here we see that PLANT4 has significantly different means when compared to each of the other three
groups.
1. Select File : Open and choose WorkBooks from Files of type drop-down list, and browse to
\Samples\Statistics folder and open the file Body.ogw
2. Select menu item Statistics : ANOVA : One-Way ANOVA to bring up the ANOVAOneWay
dialog. Choose Raw as Input Data mode. Enter the Level1 Name and Level2 Name as Male Weight
and Female Weight respectively.
3. Now we will use the Data Browser to select data in the Data branch. Click the triangle icon beside
Male Weight edit box, in the fly-out menu, select Select Columns... to open the Column Browser
dialog.
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 35 of 57
4. In the Column Browser dialog, you can select in Current Book from List Datasets drop-down list to
see all available worksheet columns in the current book. Select Weight in the sheet [Body]Male and
click Add and OK to add it to Male Weight edit box. Similarly, assign Weight from [Body]Female
to Female Weight edit box.
5. Accept other default settings in the ANOVAOneWay dialog and click OK. From the output report
footnote, we can conclude that at the 0.05 level, the population weight means between male and
female are not significantly different.
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 36 of 57
Fit Linear
Contents
1 Summary
3 Steps
Summary
An outlier is typically described as a data point or observation in a collection of data points that is "very
distant" from the other points and thus could be due to, for example, some fault in the measurement
procedure. Identification and removal of outliers is often controversial, and is typically "more acceptable"
in situations where the model used to describe the data is well known and well accepted.
Use the Recalculation mechanism to automatically update the result after outlier removal
The procedure described in this tutorial is also applicable to other fitting tools such as Polynomial and
Nonlinear Fitting
Steps
1. Start with a new workbook and import the file \Samples\Curve Fitting\Outlier.dat.
2. Click and select the second column and use the menu item Plot: Symbol: Scatter to create a scatter
plot.
3. With the graph active, use the menu item Analysis: Fitting: Fit Linear to bring up the Linear Fit
dialog. Note that if you have used the Linear Fit dialog before, there will be a fly-out menu and you
need to select the Open Dialog? sub menu. In the dialog, the Dialog Theme drop-down will be set
to <Factory Default>
4. Expand the Residual Analysis tree node in the dialog, and check the Standardized check box.
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 37 of 57
5. Change the Recalculate drop-down at the top of the dialog to Auto and press the OK button at the
bottom of the dialog. The dialog will close and linear regression will be performed on the data.
6. Select the FitLinearCurves1 result sheet in the data workbook and scroll to the right side to view
the Standardized Residual column. You will note that the value in row 6 in this columns is -
2.54889:
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 38 of 57
7. Make the graph active and then click and hold down the mouse left button on the "Regional Mask
Tool" button in the Tools toolbar. Select the "Add Masked Points to Active Plot" submenu which
will be the first item in the fly-out menu:
8. With the above submenu selected, go to the graph and click on the 6th data point to mask the point.
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 39 of 57
This changes the input data to the linear fit operation and the auto update mechanism will trigger. The
linear fit will be repeated with this particular masked point left out. The fit curve in the graph and the
pasted parameters will automatically update. Your result graph should then look like below:
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 40 of 57
Fit Nonlinear
Contents
1 Summary
3 Steps
Summary
The NLFit dialog is an interactive tool which allows you to monitor the fitting procedure during the non-
linear fitting process. This tutorial fits the Michaelis-Menten function, which is a basic model in Enzyme
Kinetics, and shows you some basic features of the NLFit dialog. During the fitting, we will illustrate how
to perform a Global Fit, which allows you to fit two datasets simultaneously and share some parameter
values.
Steps
Click the Import Single ASCII button to bring up the Open dialog. Browse to \Samples\Curve
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 41 of 57
Fitting folder and select the file Enzyme.dat. Make sure to check the Show Options Dialog
checkbox at the bottom of the dialog, and then click Open.
In the impASC dialog, expand Import Options: Header Lines nodes, and select 3 from Comments
From drop down.
Highlight columns B & C and plot as a scatter plot by clicking the button.
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 42 of 57
v=\frac{V_{max}[S]}{K_m+[S]}
is a basic model in enzyme kinetics study, where v is the reaction velocity, [S] is the substrate
concentration, Vmax is the maximal velocity and Km represents the Michaelis constant. We can determine
the Vmax and Km value, which are important enzyme properties, by fitting M-M function on v vs. [S]
curve.
There is no M-M fitting function in Origin; however, we can use a more general model, the built-in Hill
function to fit:
v=V_{max}\frac{x^n}{k^n+x^n}
where n means the cooperative sites. For single-substrate model, we can just fix n = 1 during fitting and it
will become the simplest form, the M-M function.
There are two curves, reaction without Inhibitor and reaction with Competitive Inhibitor in the graph, and
the NLFit tool can fit these two curves simultaneously. Since for competitive inhibition reaction, the
maximum velocity is the same with no inhibition reaction, we can share the Vmax value during the fitting
procedure, which can be implemented by a Global Fit.
With the graph active, select the menu item Analysis: Fitting: Nonlinear Curve Fit to bring up the
NLFit dialog. Select Hill function from Growth/Sigmoidal category on the Settings: Function
Selection page.
Select Global Fit from Multi-Data Fit Mode drop-down list on the Settings: Data Selection page.
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 43 of 57
Switch to the Parameters tab, check the Share box on the row Vmax. These Share check boxes are
only available when using Global Fit mode. Check the Fixed box for n and n_2, and make sure their
values are 1.
You can control the fitting procedure from the set of middle buttons and monitor the result using the
lower dialog panel. For example, click the Fit till converged button to perform the fit. Check
whether the result is OK on the Parameters tab. The fitted curve will also be drawn on the lower
Fit Curve panel. Note that Origin also provides the fit status in the middle of the dialog.
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 44 of 57
When you are satisfied with the result, click the OK button to generate reports. The fit result
will also be pasted on the original graph. (We just show the parameter values in the following
figure.)
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 45 of 57
From the fit result, we can conclude that the maximum velocity is about 2160 μM / min. and Km for
no inhibitor and competitive inhibitor model is 1.78μM and 4.18μM, respectively.
As we know, the model parameters can also be estimated by the Lineweaver?Burk or double-reciprocal
plot. The Lineweaver?Burk plot takes the reciprocal of both sides of the M-M function and plots by 1/v
vs. 1/[S]:
\frac{1}{v}=\frac{1}{V_{max}}+\frac{K_m}{V_{max}[S]}
We will use the No Inhibitor data to illustrate how to calculate Km and Vmax by L-B plot.
Go back to the raw data worksheet and add two more columns by clicking the button. Right-
click on column D and select Set As: X from the context fly-out menu to set it as an X column.
Right-click on column D again and select Set Column Values to bring up the Set Values dialog. In
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 46 of 57
the dialog edit box, enter: 1/Col(A) and set the Recalculate mode as None, since we don't need to
auto update the reciprocal values in this example.
Similarly, set column E's values as 1/Col(B). Enter the long name for column D & E as 1 / [S] & 1 /
V, respectively. And then we have:
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 47 of 57
From the above equation, we know there is a linear relationship between 1/v and 1/[S], so we can
use the NLFit tool to fit a straight line on this plot. (You can also use the Fit Linear tool from
Analysis: Fitting: Fit Linear)
Bring up the NLFit dialog again, select Line function from Polynomial category, and then click the
Fit button directly to generate results.
From the plot, one may doubt that this is the best fit curve since there is a point located far away.
Actually, the right side of L-B plot is low substrate concentrations area, the measurement error may
be large, so we'd better exclude these points during fitting.
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 48 of 57
Click the lock icon on the graph upper-left corner, and select Change Parameters to bring back
NLFit dialog.
In Settings: Data Selection page, click the button on Input Data node, and then choose Reselect
All Data from Graph from fly-out menu.
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 49 of 57
Then the NLFit dialog rolls up and your cursors become when you move to the graph page.
Click and draw a rectangle to select data points you want to fit.
Then the input range is labeled by up-and-down arrows. You can also click-and-move these arrows
to change the input range.
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 50 of 57
Click the button on Select Data in Graph window to go back to NLFit dialog.
Click the Fit button on the NLFit dialog to recalculate the result. You can see from the graph that
the report table was updated.
Since the intercept of the fitted curve is 1 / Vmax, it is equal to 4.76191E-4 in this example. To get
the Vmax value, select Window: Command Window to open the command window, type
1/4.76191E-4 =
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 51 of 57
Origin returns the value 2099, which is close to what we got above, 2160. (When fitting the hill
function above, we shared Vmax when fitting two datasets. If you fit the No Inhibitor data only, this
value will be closer.)
Script
Contents
1 Summary
3 Command Window
4 Examples
4.1.3 Functions
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 52 of 57
Summary
Many of Origin's analysis tools and other data processing tools have been implemented using X-Functions.
The Command Window provides a convenient way to run these functions.
Another important use for the Command Window is to send LabTalk script commands to Origin. Script
commands can range from simple math and data operations, to user-created X-Functions or Origin C
functions.
This tutorial will introduce you to the Command Window and show you how to:
Access X-Functions
Command Window
The Command Window consists of two panels: the Command Panel and History Panel:
The Command Window is normally located at the bottom right corner of the screen, but if it is not visible,
you can access it by pressing Alt+3 or by selecting View: Command Window.
When typing in the Command Panel, the Auto Complete support allows you to choose among X-Function
script commands and OGS files in the current working folder. The command and OGS file name will be
respectively preceded by Xf and LT. You can move up and down the list using the arrow keys; pressing
Enter selects the item. After your selection, press the space bar and the Auto Complete now shows you the
available options for the command.
Examples
Perform Calculations
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 53 of 57
The Command Window can be used as a calculator or to access any of Origin's mathematical functions.
See the examples below.
Single Line
One of the more basic uses for the Command Window is as an interface to perform simple calculations.
For example, type the following:
2+2=
2+2=4
Multiple Lines
If you are typing multiple lines of scripts, first edit it in Code Builder (View:Code Builder) or any text
editor, such as Windows Notepad, ending each line with a semi-colon, and then Copy + Paste the script in
the Command Window, and press ENTER to execute. For example, paste the following script in the
Command Window and ENTER:
sum = 0;
loop(ii, 1, 10)
{
sum += ii;
}
sum = ;
Origin returns:
SUM=55
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 54 of 57
Functions
Any mathematical function, built-in as well as user-created, can be executed from the Command Window.
For example, type:
ln(10) =
You can also use the Command Window to read and write worksheet values, or to perform math
operations on datasets.
To return the value in the first cell of the first column, type the following:
Col(A)[1] =
COL(A)[1]=1
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 55 of 57
Col(B) = 2 * Col(A)
If the columns you work with are in different worksheet/workbook, you should use the range variables to
represent the worksheet columns. For example, this script calculates the sine value on Book1, column A,
and puts the result in Book2, column A:
range a = [Book1]Sheet1!Col(A);
range b = [Book2]Sheet1!Col(A);
b = sin(a);
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 56 of 57
Access X-Functions
Origin 8 provides a large collection of X-Functions for performing a wide variety of data processing tasks.
Of this collection, many of the X-Functions are accessible from LabTalk script. The functions accessible
from script provide a powerful environment for users to create custom script code for their routine tasks.
X-Functions that are accessible from script can be listed in the Command Window, and you can also
obtain help on the command syntax as well as make use of auto completion of commands for such
functions.
X-Functions accept data range string or range variable for specifying source and destination data for the
operation. For example, the smooth X-Function under signal processing can be accessed from the
Command Window as follows:
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011
Introduction to Tutorials Page 57 of 57
When you press ENTER, the result will append to the source worksheet.
help smooth
file://C:\Users\RPO\AppData\Local\Temp\~hh224F.htm 11/24/2011