我正在尝试对 R 执行 Yuen 的稳健测试,但我遇到了以下错误代码的问题:
Error in formula.default(object, env = baseenv()) : invalid formula
我使用了以下包和代码:
library(WRS2)
library(car)
library(akima)
library(MASS)
library(robustbase)
library(rrcov)
library(scatterplot3d)
library(trimcluster)
library(parallel)
PremS <- c(0.06, 0.02, 0.04, 0.03, 0.03, 0.01, 0.04, 0.02, 0.07, 0.05, 0, 0.11, 0.04, 0.02, 0.03, 0.03, 0.04, 0.01, 0.06, 0.03, 0.02, 0.03, 0.03, 0.02, 0.02, 0.03, 0.02, 0.02, 0.04, 0.03, 0.03, 0.03, 0.02, 0.04, 0.06, 0.03)
PremR <- c(0.04, 0.02, 0.05, 0.02, 0.04, 0.02, 0.01, 0.01, 0.02, 0.04, 0, 0.02, 0.01, 0.01, 0.01, 0.03, 0.02, 0.03, 0.02, 0.02, 0.02, 0.01, 0.01, 0.04, 0.01, 0.03, 0.03, 0.03, 0.02)
yuen(PremR,PremS,tr=0.2)
如果有人能够提供帮助,我将非常感激!