我正在嘗試使用'plspm'建立部分最小二乘路徑模型。通過本教程閱讀和格式化我的資料後,我收到掛了一個錯誤:使用plspm進行路徑分析
"Error in if (w.dif < tol || itermax == iter) break : missing value where TRUE/FALSE needed".
我認爲這個錯誤是對一些潛在的變量(例如Soil_Displaced)的缺失值的結果具有因爲這個變量只是在實驗中的一部分重複測量中測量的。有沒有辦法解決這個錯誤,並處理大量缺失值的變量。我在這裏附上了我的代碼和日期集,數據集也可以在這個保存箱文件中找到; https://www.dropbox.com/sh/51x08p4yf5qlbp5/-al2pwdCol
這是我的代碼現在:
# inner model matrix
warming = c(0,0,0,0,0,0)
Treatment=c(0,0,0,0,0,0)
Soil_Displaced = c(1,1,0,0,0,0)
Mass_Lost_10mm = c(1,1,0,0,0,0)
Mass_Lost_01mm = c(1,1,0,0,0,0)
Daily_CO2 = c(1,1,0,1,0,0)
Path_inner = rbind(warming, Treatment, Soil_Displaced, Mass_Lost_10mm, Mass_Lost_01mm,Daily_CO2)
innerplot(Path_inner)
#develop the outter model
Path_outter = list (3, 4:5, 6, 7, 8, 9)
# modes
#designates the model as a reflective model
Path_modes = rep("A", 6)
# Run it plspm(Data, inner matrix, outer list, modes)
Path_pls = plspm(data.2011, Path_inner, Path_outter, Path_modes)
在這個問題上的任何輸入將是有益的。謝謝!