User Tools

Site Tools


other:inspect3d:tutorials:perform_principal_component_analysis

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
other:inspect3d:tutorials:perform_principal_component_analysis [2025/01/17 15:15] wikisysopother:inspect3d:tutorials:perform_principal_component_analysis [2025/01/17 15:24] (current) wikisysop
Line 61: Line 61:
 The plot that is produced will not be very informative if the traces are not coloured by group, which is the comparison we are interested in. If this is the case, open the {{:I3DShowOptions.png?20}} **Show Options** dialog from the application tool bar and under **Plotting options** set the **Display Styles from** to "Group". The plot that is produced will not be very informative if the traces are not coloured by group, which is the comparison we are interested in. If this is the case, open the {{:I3DShowOptions.png?20}} **Show Options** dialog from the application tool bar and under **Plotting options** set the **Display Styles from** to "Group".
  
-{{:NC_Workspace_Style.png}}+{{:inspect3d_oa-NC_Workspace_Style.png}}
  
 Once this is done, inspecting the plot shows that although participants from the two groups walk very differently, obvious when watching them in-person, their knee flexion angles are quite similar. Because the traces overlap significantly between the groups throughout the entire gait cycle, conventional statistics will likely not be useful for describing the differences between these two groups. Once this is done, inspecting the plot shows that although participants from the two groups walk very differently, obvious when watching them in-person, their knee flexion angles are quite similar. Because the traces overlap significantly between the groups throughout the entire gait cycle, conventional statistics will likely not be useful for describing the differences between these two groups.
  
-{{:NC_Group_Style.png}}+{{:inspect3d_oa-NC_Group_Style.png}}
  
 This is one of the motivations behind PCA: by transforming our original data into a coordinate system based on principal components we will end up with a few dimensions that explain most of the variance in the data set. This, in turn, will help us to explain and detect the differences between the groups. This is one of the motivations behind PCA: by transforming our original data into a coordinate system based on principal components we will end up with a few dimensions that explain most of the variance in the data set. This, in turn, will help us to explain and detect the differences between the groups.
Line 83: Line 83:
 6. The results of these calculations will automatically populate the PCA graphs. If these aren't already displayed, click {{:I3D_PCAShowGraphs.png?20}} **Show PCA Graphs** in the {{:I3D_PCAOptions2.png?20}} **PCA Options** dropdown menu. 6. The results of these calculations will automatically populate the PCA graphs. If these aren't already displayed, click {{:I3D_PCAShowGraphs.png?20}} **Show PCA Graphs** in the {{:I3D_PCAOptions2.png?20}} **PCA Options** dropdown menu.
  
-{{:NC_PCA_Complete.png}}+{{:inspect3d_oa-NC_PCA_Complete.png}}
  
  
Line 94: Line 94:
 The Variance Explained window, which displays the variance explained by each principal component as well as the cumulative variance for each principal components. It is important to verify that the calculated principal components do explain a significant amount of the data set's variability. A good heuristic to use is that you want enough principal components to explain 95% of the data set's variety, otherwise there will be at least a moderate amount of variation that your analysis has not captured. In this example, our 4 principal components explain 96% of the data set's variability, which is sufficient and we can continue the exploration. If there less than 95% of the data set's variance was explained then we should re-run the analysis with more principal components. The Variance Explained window, which displays the variance explained by each principal component as well as the cumulative variance for each principal components. It is important to verify that the calculated principal components do explain a significant amount of the data set's variability. A good heuristic to use is that you want enough principal components to explain 95% of the data set's variety, otherwise there will be at least a moderate amount of variation that your analysis has not captured. In this example, our 4 principal components explain 96% of the data set's variability, which is sufficient and we can continue the exploration. If there less than 95% of the data set's variance was explained then we should re-run the analysis with more principal components.
  
-{{:NC_Variance_Explained.png}}+{{:inspect3d_oa-NC_Variance_Explained.png}}
  
 Clicking on a bar will display the exact variance explained by that principal component. In this example, the second principal component explains 17.6% of the variation in the original data set. Clicking on a bar will display the exact variance explained by that principal component. In this example, the second principal component explains 17.6% of the variation in the original data set.
Line 103: Line 103:
 Next, the Group Scores window helps us to determine if there is a significant differences between the groups for any individual principal component. This is established by looking at each principal component's mean score and their standard errors, where if the mean scores for a principal component +/- their standard errors do not cross the x-axis then there are significant differences in the scores for this principal component. In this tutorial principal components 1 and 2 show significant differences for the groups and will therefore be the focus of the remaining investigation. Next, the Group Scores window helps us to determine if there is a significant differences between the groups for any individual principal component. This is established by looking at each principal component's mean score and their standard errors, where if the mean scores for a principal component +/- their standard errors do not cross the x-axis then there are significant differences in the scores for this principal component. In this tutorial principal components 1 and 2 show significant differences for the groups and will therefore be the focus of the remaining investigation.
  
-{{:NC_Group_Scores.png}}+{{:inspect3d_oa-NC_Group_Scores.png}}
  
 As with the Variance Explained window, hovering over a point will display a tooltip with precise values for that group score. As with the Variance Explained window, hovering over a point will display a tooltip with precise values for that group score.
Line 110: Line 110:
 === Workspace Scores === === Workspace Scores ===
  
-{{:NC_Workspace_Scores.png}}+{{:inspect3d_oa-NC_Workspace_Scores.png}}
  
 Having identified our principal components of interest, switch to the Workspace Scores window and plot the chosen principal components against one another (i.e., for this tutorial, plot PC1 versus PC2). We are looking to be able to distinguish our groups and in this case there is a pretty clear separation between the groups in this 2D space. Although PC1 may describe more of the data set's variability than PC2, PC2 can discriminate between the groups better (this isn't mathematically shown here, but can be seen if the visual inspection is followed by a cluster analysis). Of course, PC1 and PC2 can discriminate between the groups even better if they are used together instead of separately. Having identified our principal components of interest, switch to the Workspace Scores window and plot the chosen principal components against one another (i.e., for this tutorial, plot PC1 versus PC2). We are looking to be able to distinguish our groups and in this case there is a pretty clear separation between the groups in this 2D space. Although PC1 may describe more of the data set's variability than PC2, PC2 can discriminate between the groups better (this isn't mathematically shown here, but can be seen if the visual inspection is followed by a cluster analysis). Of course, PC1 and PC2 can discriminate between the groups even better if they are used together instead of separately.
 If you want to investigate the original data for a particular workspace, click on the workspace's scatter point and the corresponding data will be highlighted in the original Queried Data plot. Similarly, if you click on a trace in the original Queried Data plot then the corresponding workspace is highlighted in the Workspace Score widget. This can be useful to identify outliers. If you want to investigate the original data for a particular workspace, click on the workspace's scatter point and the corresponding data will be highlighted in the original Queried Data plot. Similarly, if you click on a trace in the original Queried Data plot then the corresponding workspace is highlighted in the Workspace Score widget. This can be useful to identify outliers.
  
-{{:NC_Workspace_Scores_Selected.png}}+{{:inspect3d_oa-NC_Workspace_Scores_Selected.png}}
  
  
Line 124: Line 124:
 For the **Plot Type** drop-down menu, select the Mean and Slider option. Leave the **PC Number** set to 1 and then click **Play**. The mean reconstruction (gray in the figure below) will remain static while the other reconstruction (blue in the figure below) will vary in the range Mean +/- 2 Standard Deviations. Watching this animation demonstrates that PC1 is capturing variability as an offset in the signal. Vertical offsets in gait data can occur for a variety of reasons, including differences in standing calibration posture. Therefore, PC1 may explain a significant amount of variability that is not very helpful for answering our question. For the **Plot Type** drop-down menu, select the Mean and Slider option. Leave the **PC Number** set to 1 and then click **Play**. The mean reconstruction (gray in the figure below) will remain static while the other reconstruction (blue in the figure below) will vary in the range Mean +/- 2 Standard Deviations. Watching this animation demonstrates that PC1 is capturing variability as an offset in the signal. Vertical offsets in gait data can occur for a variety of reasons, including differences in standing calibration posture. Therefore, PC1 may explain a significant amount of variability that is not very helpful for answering our question.
  
-{{:NC_Extreme_Plot.png}}+{{:inspect3d_oa-NC_Extreme_Plot.png}}
  
 Now select **PC Number** 2 and click **Play** again. This PC shows a different story, with the largest differences in this animation occurring during late stance and mid-swing. Now select **PC Number** 2 and click **Play** again. This PC shows a different story, with the largest differences in this animation occurring during late stance and mid-swing.
other/inspect3d/tutorials/perform_principal_component_analysis.1737126945.txt.gz · Last modified: 2025/01/17 15:15 by wikisysop