You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用miceadds包mi.anova函数遇'assignment is deprecated'警告求助

解决miceadds::mi.anova的弃用警告问题

问题原因

你错误地将formula参数以带"formula="前缀的字符串形式传入,这种写法属于被弃用的赋值方式,mi.anova的formula参数需要直接接收公式对象,而非包含赋值语句的字符串。

修正代码

直接通过命名参数传递公式对象(无需引号包裹):

SWManova <- mi.anova(mi.res=imputed_Data, formula=outcome~person+age+sex+level_of_education, type=3)

或者先定义公式对象再传入:

my_formula <- outcome~person+age+sex+level_of_education
SWManova <- mi.anova(mi.res=imputed_Data, formula=my_formula, type=3)

说明

以上两种写法都能正确传递公式参数,避免触发"assignment is deprecated"的弃用警告,符合mi.anova函数的参数要求。

内容的提问来源于stack exchange,提问作者DW1310

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.10 02:01:18