開始使用免費開始

繪製個體因素分數的差異

在 EFA 和 CFA 的結果中,差異的不只有因素負荷。當以 EFA 或 CFA 的參數來計算時,個體的因素分數也會不同。為了示範這點,我們將檢視 bfi_EFA 資料集中各個體的因素分數,分別用 EFA 模型與 CFA 模型計算,並比較這些分數的機率密度圖。

本練習屬於課程

R 中的因素分析

檢視課程

練習說明

  • 先把 EFA_model 物件中名為 scores 的清單元素存成一個新物件。由於此模型是以 bfi_EFA 資料集建立,因素分數也來自該資料集。
  • 接著,使用 fscores(),以相同的 bfi_EFA 資料集與 CFA 模型物件來計算並擷取個體的因素分數。
  • 最後,使用 plot()lines() 函式,將個體在第 1 個因素上的因素分數之密度畫出來。

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Extracting factor scores from the EFA model
EFA_scores <- EFA_model$___

# Calculating factor scores by applying the CFA parameters to the EFA dataset
CFA_scores <- fscores(EFA_CFA, data = ___)

# Comparing factor scores from the EFA and CFA results from the bfi_EFA dataset
___(density(___[,1], na.rm = TRUE), 
    xlim = c(-3, 3), ylim = c(0, 1), col = "blue")
___(density(___[,1], na.rm = TRUE), 
    xlim = c(-3, 3), ylim = c(0, 1), col = "red")
編輯並執行程式碼