File Exchange > Data Analysis >    Principal Component Analysis for Spectroscopy

OriginLab Technical Support
Date Added:
Last Update:
Downloads (90 Days):
Total Ratings:
File Size:
1896 KB
Average Rating:
File Name:
File Version:
Minimum Versions:

Perform principal component analysis on spectroscopy data.

Screen Shot and Video:

This tool performs principal component analysis for spectra (IR, Fluorescence, UV-Vis, Raman, etc.).
Features include:

  • Study relations of individual samples.
  • Find important wavelengths/frequencies in the spectra.
  • Detect outliers in samples.
  • Create Loading with Reference Spectrum Plot, 2D/3D Loading Plot and Score Plot.

Download the file PCASpec.opx, and then drag-and-drop onto the Origin workspace. An icon will appear in the Apps Gallery window.
NOTE: This tool requires OriginPro.


  1. Click the Principal Component Analysis for Spectroscopy icon in the Apps Gallery window to open the dialog.
  2. In the Input tab, choose input data for Spectra Data.
    Each column should represent a sample's spectrum.
    You can also optionally choose a column for Frequency/Wavelength, which will be used for labels in Loading Plot, choose Spectra Names for labels in Scor Plot, and Group Info can be used to divide samples in Score Plot.
  3. In the Settings tab, Analyze option determines whether to standardize rows (Correlation Matrix) or not. 
    Number of Components to Extract is used to control outputs of loadings, scores and their plots. 
    Standardize Scores option will standardize scores of each component to set their variance to be 1.
  4. In Quantities to Compute tab, check options to control which results to output in Report Data sheet.
  5. In Plots tab, specify whether to create Scree PlotLoading with Reference Spectrum Plot (Vertically stacked multiple panels plot of loading along with a sample's spectrum), Loading PlotScore Plot and Biplot. All except Scree Plot support to show two components or three components in the plot. The last two can allow whether to show confidence ellipse and labeling outliers.
  6. Click OK button, a report sheet, a report data sheet and a plot data sheet will be created. If Show Confidence Ellipse option is checked in Plots tab, a Matrix book will also be created.

Sample OPJ File
This App provides a sample OPJ file.  Right click on the Principal Component Analysis for Spectroscopy icon in the Apps Gallery window, and choose Show Samples Folder from the short-cut menu. A folder will open. Drag-and-drop the project file PCASpecEx.opj from the folder onto Origin. The Notes window in the project has a link to a blog page for detailed steps.
Note: If you wish to save the OPJ after changing, it is recommended that you save to a different folder location (e.g. User Files Folder).


  1. If you have XYYY data, choose all Y data for Spectra Data, and X data for Frequency/Wavelength in the Input tab.
  2. If a row in Spectra Data contains one or more missing values, the entire row will be excluded in the analysis.


v1.3 8/23/2019 Updated to make it compatible with Origin 2020.
v1.2 3/20/2019 Updated function for 2D Confidence Ellipse.
v1.1 12/3/2018 Fixed Standardize Scores bug.

Reviews and Comments:
12/08/2023mazengiaI need to have the upgraded OriginPro.





03/20/2023SamOA2023Great app

01/17/2023OriginLabHi, nancysingla

The minimum version required is Origin 2017. Origin 8.6 does not support app yet.

OriginLab Technical Services


01/13/2023nancysinglaI have installed PCA for spectroscopy but i am not able to locate it in my origin.I have origin 8.6. I have searched in view option but there is no option of app gallery in it. kindly help