CREACION DE MATRICES

## Generacion de la matriz Y
Matriz_Y<-matrix(data = c(40,50,67,29,70),
                 nrow=5,
                 ncol=1,byrow = TRUE)
colnames(Matriz_Y)<-c('y')
print(Matriz_Y)
##       y
## [1,] 40
## [2,] 50
## [3,] 67
## [4,] 29
## [5,] 70

Matrix X

Matriz_X<-cbind(rep(1,5),matrix(data = c(4,10,3,8,6,11,4,9,8,12),nrow=5,ncol=2,byrow=TRUE))
colnames(Matriz_X)<-c('Cte','x1','x2')
print(Matriz_X)
##      Cte x1 x2
## [1,]   1  4 10
## [2,]   1  3  8
## [3,]   1  6 11
## [4,]   1  4  9
## [5,]   1  8 12

Producto de matrices Calculo de X´X (sigma matriz)

matriz_XX <-t(Matriz_X)%*%Matriz_X
print(matriz_XX)
##     Cte  x1  x2
## Cte   5  25  50
## x1   25 141 262
## x2   50 262 510