{"id":7005,"date":"2016-10-25T11:46:01","date_gmt":"2016-10-25T15:46:01","guid":{"rendered":"http:\/\/blog.originlab.com\/?p=7005"},"modified":"2016-10-26T12:27:59","modified_gmt":"2016-10-26T16:27:59","slug":"performing-principal-component-analysis-for-chemometric-spectra-using-origins-app","status":"publish","type":"post","link":"https:\/\/blog.originlab.com\/ja\/performing-principal-component-analysis-for-chemometric-spectra-using-origins-app","title":{"rendered":"Performing Principal Component Analysis for Chemometric Spectra Using Origin&#8217;s App"},"content":{"rendered":"<h3>\u306f\u3058\u3081\u306b<\/h3>\n<p>For\u00a0Origin 2017, a\u00a0<a href=\"http:\/\/www.originlab.com\/FileExchange\/details.aspx?fid=326\">Principal Component Analysis for Spectroscopy<\/a>\u00a0App is available. The App is specifically designed to perform principal component analysis for spectra (IR, Fluorescence, UV-Vis, Raman, etc.).\u00a0\u00a0In chemometric\u00a0analysis, researchers want to know which variables (frequency, wavelength or time) are important in\u00a0distinguishing samples by\u00a0their spectra, which samples can be allocated to a group, and to detect outliers in\u00a0these samples. This App can help resolve these issues.<\/p>\n<p>Before using the\u00a0<strong>Principal Component Analysis for Spectroscopy<\/strong>\u00a0App, spectra data for samples must be arranged in a worksheet, each column representing a sample spectrum. Frequency, wavelength or time for the spectra can be in the X column. Sample names and group info for samples can be set in column headers of samples, e.g. Long Name or Comments in each Y column.<\/p>\n<h3>Example<\/h3>\n<p>This App provides a built-in sample. Once you install the App, right-click on the\u00a0<strong>Principal Component Analysis for Spectroscopy<\/strong>\u00a0icon in the <strong>Apps Gallery<\/strong> window, and choose <strong>Show Samples Folder<\/strong> from the short-cut menu. This opens the folder for the sample project file. Open the project file\u00a0<em>PCASpecEx.opj<\/em> in the folder. You will see that it includes a Workbook and a Notes window. Book1, Sheet1 contains the input data, and the Notes window shows the input data&#8217;s source.<\/p>\n<h4>Input Data<\/h4>\n<p>The input data consists of\u00a020 samples from 120 samples in the original source data. The 20 samples consist of 10 olive oil samples, 5\u00a0non-olive vegetable oil samples and 5\u00a0non-olive vegetable oils mixed with olive oil samples. The first column in the sheet (A(X))\u00a0holds\u00a0time data for spectra. Other columns (B(Y) &#8211; (U(Y)) are spectra data, and group info for 20 samples are saved in Comments for\u00a0each Y column. When plotted as a line plot, the spectra for 20 samples look like the following:<\/p>\n<p><a href=\"http:\/\/blog.originlab.com\/wp-content\/uploads\/2016\/10\/PCASpecData.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-7013 size-full\" src=\"http:\/\/blog.originlab.com\/wp-content\/uploads\/2016\/10\/PCASpecData.png\" alt=\"pcaspecdata\" width=\"547\" height=\"445\" \/><\/a><\/p>\n<h4>Steps<\/h4>\n<ol>\n<li>Open the sample project file <em>PCASpecEx.opj<\/em>.<em>\u00a0<\/em>Click the\u00a0<strong>Principal Component Analysis for Spectroscopy<\/strong>\u00a0icon in the <strong>Apps Gallery<\/strong> window to open the dialog.<\/li>\n<li>In the dialog&#8217;s <strong>Input<\/strong> tab, select the (first) X column in Sheet1 as <strong>Frequency\/Wavelength<\/strong>. Select the\u00a0other Y columns as <strong>Spectra Data<\/strong>. Set\u00a0<strong>Long Name<\/strong>\u00a0for <strong>Spectra Names<\/strong>, and use <strong>Comments<\/strong> as <strong>Group Info<\/strong>.<a href=\"http:\/\/blog.originlab.com\/wp-content\/uploads\/2016\/10\/PCASpecInput.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-7076 size-full\" src=\"http:\/\/blog.originlab.com\/wp-content\/uploads\/2016\/10\/PCASpecInput.png\" alt=\"pcaspecinput\" width=\"452\" height=\"340\" \/><\/a><\/li>\n<li>In the <strong>Settings<\/strong> tab, choose the\u00a0<strong>Covariance Matrix<\/strong> for<strong> Analyze<\/strong> option. If the\u00a0<strong>Correlation Matrix<\/strong> option is chosen, each row for\u00a020 samples would\u00a0be normalized.<a href=\"http:\/\/blog.originlab.com\/wp-content\/uploads\/2016\/10\/PCASpecSet.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-7083 size-full aligncenter\" src=\"http:\/\/blog.originlab.com\/wp-content\/uploads\/2016\/10\/PCASpecSet.png\" alt=\"pcaspecset\" width=\"380\" height=\"307\" srcset=\"https:\/\/blog.originlab.com\/wp-content\/uploads\/2016\/10\/PCASpecSet.png 380w, https:\/\/blog.originlab.com\/wp-content\/uploads\/2016\/10\/PCASpecSet-300x242.png 300w\" sizes=\"auto, (max-width: 380px) 100vw, 380px\" \/><\/a><\/li>\n<li>In the <strong>Plots<\/strong> tab, choose Sample 6 for the <strong>Reference Spectrum<\/strong>\u00a0in <strong>Loading with Reference Spectrum Plot<\/strong>, and check the\u00a0<strong>Loading Plot<\/strong> \u3001 <strong>Score Plot<\/strong> options.<a href=\"http:\/\/blog.originlab.com\/wp-content\/uploads\/2016\/10\/PCASpecPlot.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-7084 size-full aligncenter\" src=\"http:\/\/blog.originlab.com\/wp-content\/uploads\/2016\/10\/PCASpecPlot.png\" alt=\"pcaspecplot\" width=\"414\" height=\"580\" \/><\/a><\/li>\n<li>Click the\u00a0<strong>OK<\/strong> button and a report sheet, a result\u00a0sheet and a plot data sheet are\u00a0created.<\/li>\n<\/ol>\n<h4>Results<\/h4>\n<ol>\n<li>Looking at the Report Sheet, the<strong> Eigenvalues<\/strong> table shows that the first four principal components explained 96% of total variance.<a href=\"http:\/\/blog.originlab.com\/wp-content\/uploads\/2016\/10\/PCASpecRep.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-7088 size-full\" src=\"http:\/\/blog.originlab.com\/wp-content\/uploads\/2016\/10\/PCASpecRep.png\" alt=\"pcaspecrep\" width=\"650\" height=\"707\" srcset=\"https:\/\/blog.originlab.com\/wp-content\/uploads\/2016\/10\/PCASpecRep.png 650w, https:\/\/blog.originlab.com\/wp-content\/uploads\/2016\/10\/PCASpecRep-276x300.png 276w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><\/a><\/li>\n<li>In the\u00a0<strong>Loading with Reference Spectrum Plot<\/strong> (note that you can double-click on the plot to pop up the embedded graph), the first layer shows the sixth (reference) sample&#8217;s spectrum; the second layer illustrates loading for the first component; and the third layer for the second component. The graph below shows that times\u00a07.95 and 8.47\u00a0are\u00a0important variables in\u00a0PC1, while times 3.96 and 5.92 have\u00a0more influence in PC2. The vertical annotation lines in the graph were\u00a0added using the\u00a0<strong>Vertical Cursor<\/strong> gadget in Origin (<strong>Gadgets: Vertical Cursor<\/strong>).<a href=\"http:\/\/blog.originlab.com\/wp-content\/uploads\/2016\/10\/PCASpecRef.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-7089 size-full\" src=\"http:\/\/blog.originlab.com\/wp-content\/uploads\/2016\/10\/PCASpecRef.png\" alt=\"pcaspecref\" width=\"978\" height=\"808\" \/><\/a><\/li>\n<li>The<strong> Loading Plot<\/strong> shows coefficients of each variable (time) in PC1 and PC2. You can use the\u00a0<strong>Data Reader <\/strong>(<strong>Tools <\/strong>toolbar) in Origin to find variables of larger coefficients (important times) in PC1 and PC2. Note that the sign in loading of a principal component doesn&#8217;t matter, and can be multiplied by -1.<a href=\"http:\/\/blog.originlab.com\/wp-content\/uploads\/2016\/10\/PCASpecLoad.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-7092 size-full\" src=\"http:\/\/blog.originlab.com\/wp-content\/uploads\/2016\/10\/PCASpecLoad.png\" alt=\"pcaspecload\" width=\"596\" height=\"484\" srcset=\"https:\/\/blog.originlab.com\/wp-content\/uploads\/2016\/10\/PCASpecLoad.png 596w, https:\/\/blog.originlab.com\/wp-content\/uploads\/2016\/10\/PCASpecLoad-300x244.png 300w\" sizes=\"auto, (max-width: 596px) 100vw, 596px\" \/><\/a><\/li>\n<li>The<strong> Score Plot<\/strong> illustrates scores of 20 samples in PC1 and PC2. The 20 samples were\u00a0divided into three groups as specified in <strong>Group Info<\/strong>. It is clear from the\u00a0graph that olive oils and non-olive oils can be divided easily in principal component space, while mixed oils intersect with the other two. Confidence ellipses of scores for\u00a0the\u00a0three groups\u00a0of samples are also shown, and some extreme points are labelled. If the number of samples is large, you can turn off labels by unchecking the\u00a0<strong>Enable<\/strong> option in the\u00a0<strong>Plot Details<\/strong> dialog&#8217;s <strong>Label<\/strong> tab (to open Plot Details, double-click on the pop-up plot or choose <strong>Format: Plot Properties<\/strong>).<a href=\"http:\/\/blog.originlab.com\/wp-content\/uploads\/2016\/10\/PCAScore.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-7093 size-full aligncenter\" src=\"http:\/\/blog.originlab.com\/wp-content\/uploads\/2016\/10\/PCAScore.png\" alt=\"pcascore\" width=\"800\" height=\"639\" \/><\/a><\/li>\n<li>This App can create 3D component plots. Click the green lock in the upper-left corner of the graph and choose <strong>Change Parameters<\/strong>. In <strong>Plots<\/strong> tab, choose 3 for<strong> Number of Components to Plot<\/strong> (you may have to go to<strong> Settings <\/strong>and increase<strong> Number of Components to Extract <\/strong>to 3 or more. You can also change the\u00a0<strong>Reference Spectrum<\/strong>\u00a0on the\u00a0<strong>Plots<\/strong> tab to see other samples.<\/li>\n<\/ol>\n<h3>\u307e\u3068\u3081<\/h3>\n<p>Principal component analysis is an effective method to find important frequency or wavelength regions from a group of samples, and help classify samples in the principal component space. It can also be used to determine number of compounds from spectra of mixtures, and it can be incorporated with the partial least squares method to solve quantitative problems. The\u00a0result can also be used for further classification, e.g. hierarchical cluster analysis and discriminant analysis.<\/p>","protected":false},"excerpt":{"rendered":"<p>Introduction For\u00a0Origin 2017, a\u00a0Principal Component Analysis for Spectroscopy\u00a0App is available. &hellip; <\/p>","protected":false},"author":822,"featured_media":7231,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[69,4],"tags":[],"class_list":["post-7005","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-latex-maps","category-data-analysis"],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7DvU2-1OZ","jetpack_likes_enabled":true,"jetpack_featured_media_url":"https:\/\/blog.originlab.com\/wp-content\/uploads\/2016\/10\/Performing_Principal_Componet_Analysis_for_Chemometric_Spectra_Featured_Image.png","post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/blog.originlab.com\/ja\/wp-json\/wp\/v2\/posts\/7005","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.originlab.com\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.originlab.com\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.originlab.com\/ja\/wp-json\/wp\/v2\/users\/822"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.originlab.com\/ja\/wp-json\/wp\/v2\/comments?post=7005"}],"version-history":[{"count":16,"href":"https:\/\/blog.originlab.com\/ja\/wp-json\/wp\/v2\/posts\/7005\/revisions"}],"predecessor-version":[{"id":16048,"href":"https:\/\/blog.originlab.com\/ja\/wp-json\/wp\/v2\/posts\/7005\/revisions\/16048"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.originlab.com\/ja\/wp-json\/wp\/v2\/media\/7231"}],"wp:attachment":[{"href":"https:\/\/blog.originlab.com\/ja\/wp-json\/wp\/v2\/media?parent=7005"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.originlab.com\/ja\/wp-json\/wp\/v2\/categories?post=7005"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.originlab.com\/ja\/wp-json\/wp\/v2\/tags?post=7005"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}