有关于communality的介绍在此不加展开,采用的计算思路是源于此篇文章的supplement materials:
Livingston G, Huntley J, Sommerlad A, et al. Dementia prevention, intervention, and care: 2020 report of the Lancet Commission. Lancet 2020; published online July 30. http://dx.doi.org/10.1016/S0140-6736(20)30367-6.
以下为纯代码分享:
# step1. input data on all risk factors in the model
# my original dataset: pca_set
my_matrix<-as.matrix(pca_set)
# step2. calculate tetrachoric correlation to generate correlation coefficients and

该文介绍了使用PCA(主成分分析)计算communality的过程,包括数据矩阵化、计算四分相关系数、执行PCA生成特征向量、绘制特征值散点图以确定保留的组件数量,以及计算因子载荷的平方和作为communality的步骤。
最低0.47元/天 解锁文章
205

被折叠的 条评论
为什么被折叠?



