I don’t know how to proceed in the following case because the last equation doesn’t have all the 4 variables. So used the code below the equation, but this is wrong... Does anyone know the way to proceed?
Euqations:
3a + 4b - 5c + d = 10
2a + 2b + 2c - d = 5
a -b + 5c - 5d = 7
5a + d = 4
Code:
X <- matrix(c(3,4,-5,1,2,2,2,-1,1,-1,5,-5,5,0,0,1), 4, 4)
y <- matrix(c(10,5,7,4), 4, 1)
solve(X)%*%y #equivalent to solve(X, y)