Answer To:
Sudhanshu answered on Feb 15 2021
y=c(1,2,3,4) #y is the dependent variable
v=matrix(c(1,1,2,1,1,1,2,3,1,1,2,1,1,1,2,3),nrow=4,ncol=3,byrow=T) #indipendent variable
tausq=c(0,0,0,0) #values of tau square
sigsq=2 #sigsq is the known value of sigma square
lm.adjusted=function(y,v,tausq,sigsq){
x=v
n=length(y) #length of vector is obtained
...