# Compute the mean - variance identification function.
df <- data.frame(
y = rep(x = 0, times = 6),
x1 = c(2, 2, -2, -2, 0, 0),
x2 = c(1, 2, 1, 2, 1, 2)
)
v <- as.data.frame(mv_if(x1 = df$x1, x2 = df$x2, y = df$y))
print(cbind(df, v))
Run the code above in your browser using DataLab