2
我是新來的flexmix在R,並希望有一些幫助。我爲這個混亂的格式道歉,因爲這是我的第一篇文章。改裝flexmix在R
我在數據集中有兩個DV,Y1和Y2。
summary(dataset1.nomiss$Y1)
Min. 1st Qu. Median Mean 3rd Qu. Max.
3.000 3.000 3.000 4.202 4.000 28.000
summary(dataset1.nomiss$Y2)
Min. 1st Qu. Median Mean 3rd Qu. Max.
1.000 2.000 3.000 3.838 6.000 11.000
> dataset1.nomiss$Y1
3 4 7 1 1 3 1 4 8 4 9 4 1 2 7 7 3 1 2 6 4 1 3 2 5 1 1 2 3 8 1 4 9 1 1 3 4 3 2 2 11 1 2 1 2 7 5 3 3 3 2 4 8 1 4 4
1 4 5 3 1 2 8 3 3 4 1 1 9 4 2 6 1 2 2 1 7 3 6 8 1 3 6 3 1 1 1 1 7 9 8 2 1 4 2 3 2 4 1 2 4 4 9 2 2 5 3 2 5 2 6 10
8 2 2 4 4 2 2 5 3 8 3 1 2 8 3 8 8 5 6 7 4 3 11 4 2 4 7 1 1 7 5 2 7 9 7 10 4 2 3 3 7 4 7 1 1 1 1 1 7 1 1 4 1 8 1 8
2 9 4 3 3
> dataset1.nomiss$Y1 # Guessing this was supposed to be Y2
4 3 6 3 6 3 3 3 3 3 5 4 3 4 4 3 6 3 3 6 8 3 3 3 5 3 3 3 4 3 3 5 28 3 3 3 4 3 3 3 3 3 3 3 3 3 5 6 3 3 3 3 3 3 3 28
3 3 3 6 3 3 3 3 3 8 3 3 3 6 3 3 3 3 3 3 12 3 4 3 3 9 16 3 3 3 4 4 3 3 3 4 3 3 3 3 3 5 3 3 3 3 3 5 3 3 3 3 3 3 9 3
4 3 7 3 18 4 3 8 3 3 3 3 3 7 3 7 11 3 3 3 3 3 3 3 3 3 3 3 3 6 6 3 3 11 14 3 3 3 3 3 4 3 4 3 3 3 5 3 3 3 3 3 3 3 3 3
3 3 3 3 3
我無法重新安裝Y1,如下所示。
Call:
flexmix(formula = Y1 ~ Condition + AGE + RACE + CESD + SAQ_overall + SAQ_certainty + SAQ_importance, data = dataset1.nomiss,
k = 2)
prior size post>0 ratio
Comp.1 0.266 46 46 1
Comp.2 0.734 127 127 1
'log Lik.' 3871.355 (df=21)
AIC: -7700.709 BIC: -7634.49
> model_1.refit<-refit(model_1)
**Error in solve.default(as.matrix(fit$hessian)) :
Lapack routine dgesv: system is exactly singular: U[11,11] = 0**
然而,Y2工作得很好
Call:
flexmix(formula = Y2 ~ Condition + AGE + RACE + CESD + SAQ_overall + SAQ_certainty + SAQ_importance, data = dataset1.nomiss,
k = 2)
prior size post>0 ratio
Comp.1 0.661 111 172 0.645
Comp.2 0.339 62 108 0.574
'log Lik.' -358.9611 (df=21)
AIC: 759.9222 BIC: 826.1413
> model_2.refit<-refit(model_2)
非常感謝。我會試試這個。 –