Skip to content
Prev 17729 / 398502 Next

Matrix multiplication problem

Gavin Simpson <gavin.simpson at ucl.ac.uk> writes:
...
You're multiplying a 4x1 matrix with a 4x4 and they don't conform. 

...
...


Either

a) use S <- t(df) %*%...
b) use df <- matrix(rep((1/(n-1)), times=n), 1)

or

c) just forget about df and use  S <- (t(Yhat) %*% Yhat)/(n-1)