R code of Output of Model 11