【发布时间】:2015-11-19 09:19:39
【问题描述】:
我想弄清楚poLCA::poLCA() 函数,但系统给了我这样的警告:
round(mf) 中的错误:数学函数的非数字参数
代码如下:
#Latent class models with one (loglinear independence) to three classes
f=cbind("I_like_to_drink","I_drink_hard_liquor","I_have_drank_in_the_morning","I_have_drank_in_the_work","I_drink_to_get_drunk","I_like_the_taste_of_the_alcohol","I_drink_help_me_sleep","Drinking_interferes_with_my_relationships","I_frequently_visit_bars")~1
nes1 = poLCA(f,lca1,nclass=1) # log-likelihood:
nes2 = poLCA(f,lca1,nclass=2) # log-likelihood:
nes3 = poLCA(f,lca1,nclass=3) # log-likelihood:
nes4 = poLCA(f,lca1,nclass=4) # log-likelihood:
【问题讨论】:
-
您是否按照
str(lca1)控制了您的数据? -
是的,999 个条目和 8 个变量。
-
变量的类型你控制了吗?
-
是的,我已将所有变量转换为因子类型。
标签: r