Save and reuse settings of an analysis, example of Principal Component Analysis
Datasets for saving and reusing VBA codes
Two Excel workbooks with both the data and the results can be downloaded by clicking here. The data used is the process of food measurements samples.
Generating the settings to reuse
We are going to create a Principal component analysis template on one dataset and use it on the second.
Open the first file called Automation_1.xls.
Enabling advanced options
Once XLSTAT-Pro is activated, go to the menu Options, and in the tab Advanced enable the option the option named Show the advanced buttons in the dialog boxes.
Setting up an analysis - example of Principal Component Analysis
Then select the XLSTAT / Analyzing data / Principal components analysis command, or click on the corresponding button of the Analyzing Data toolbar (see below).
In the General tab, set the following:
* Observations/variables table: Columns B to G
* Data format: Observations/variables table
* PCA type: Pearson (n)
* Variable labels: enabled
* Observation labels: ticked and select the column A for the sample name
* Sheet: chosen to display the results in a new sheet
Go to the next tab Options. For the option Filter factors, choose Maximum number and set the value to six. This way all the components will be calculated.
Go to the tab Outputs. Here we want to get a synthetic report so we will only select the following:
* Factor Loadings,
* Variables/Factors correlations,
* Factor scores.
Finally we are going to use all three plots that can be selected in the Charts tab:
* Correlation charts
* Observations charts
Now we have specified all the settings we will save the code to be reused.
Generating and saving the settings to be reused
Click on the red button at the bottom left of the dialog box.
Save the code under a name that is easy for you to remember, for example in this case we use "PCArecipe1".
Press OK to launch the analysis.
Results of the Principal Component Analysis
Elect the plot for the axes F1 and F2 by clicking Select, then change the selection to Abscissa F3 andOrdinates F4. Once you have completed this, simply click again on Select and then press Done.
Take a look at the biplot (shown below).
This process is usually to be stable so we can expect little variation. You can see that all the samples are centered tidily around the middle of the center of the plot.
Reusing the settings
Now open the second file Automation_2.xls
Go to the menu Analyzing data / Principal Component Analysis and when the dialog box is open click on the blue button to load the code.
Select the code "PCArecipe1.txt".
The settings are automatically established. So now simply click on Continue and have a look at the biplot.
This time one of the samples seems to be further away that the other samples. The sample 13 may be an outlier.
Have a look at this video to see how to save and reuse the parameters of an analysis in XLSTAT.
Click here for other tutorials.