# Compute the Huber mean identification function.
df <- data.frame(
x = c(-3, -2, -1, 0, 1, 2, 3),
y = c(0, 0, 0, 0, 0, 0, 0),
a = c(2.7, 2.5, 0.6, 0.7, 0.9, 1.2, 5)
)
df$hubermean_if <- hubermean_if(x = df$x, y = df$y, a = df$a)
print(df)
Run the code above in your browser using DataLab