ここに私の問題があります。混合効果モデルを実行する必要がある R のデータ セットがあります。コードは次のとおりです。
data <- read.csv("D:/blahblah.csv")
analysis.data <- lmer(intdiff ~ stress_limit * word_position * follows + (1|speaker), data)
summary(analysis.data)
スクリプトを実行しようとすると、次のエラーが返されます。
Error in mer_finalize(ans) : Downdated X'X is not positive definite, 15.
「follows」パラメーターまでエラーを追跡しました。これは、stress_limit と word_position を使用するだけで正常に動作するためです。「follows」のデータは、n または l、子音、母音の 3 つの文字列のみです。スペースを _ に置き換えてみましたが、成功しませんでした。この場合、「フォロー」の使用を妨げている lmer() 関数の内部動作について何かありますか? どんな助けでも素晴らしいでしょう!
詳細情報: intdiff には数値が含まれ、stress_limit は文字列 (Stressed または Unstressed) であり、単語の位置も文字列 (Word Medial または Word Initial) です。
編集: エラーを再現するデータ サンプルを次に示します。
structure(list(intdiff = c(11.45007951, 12.40144758, 13.47898367,
6.279497762, 18.19461897, 16.15539707), word_position = structure(c(2L,
2L, 2L, 1L, 1L, 1L), .Label = c("Word Initial", "Word Medial"
), class = "factor"), follows = structure(c(4L, 4L, 4L, 1L, 2L,
4L), .Label = c("Consonant", "n or l", "Pause", "Vowel"), class = "factor"),
stress_limit = structure(c(2L, 1L, 1L, 2L, 2L, 2L), .Label = c("Stressed",
"Unstressed"), class = "factor"), speaker = structure(c(2L,
2L, 2L, 2L, 2L, 2L), .Label = c("f11r", "f13r", "f15a", "f16a",
"m09a", "m10a", "m12r", "m14r"), class = "factor")), .Names = c("intdiff",
"word_position", "follows", "stress_limit", "speaker"), row.names = c(NA,
6L), class = "data.frame")
lme() 関数も試しましたが、次のエラーが返されました。
Error in MEEM(object, conLin, control$niterEM) :
Singularity in backsolve at level 0, block 1
元の投稿のコードは、私が使用している正確なコードから library(lme4) 呼び出しを除いたものであるため、考えられる情報を省略していません。
私のRバージョンは2.15.2です