creacion de Matrices

matriz y

#generacion de la matriz y 
matriz_y<-matrix(data = c(30,20,36,24,40),
                 nrow = 5,
                 ncol = 1,byrow = TRUE)
colnames(matriz_y)<-c("y")
print(matriz_y)
  y

[1,] 30 [2,] 20 [3,] 36 [4,] 24 [5,] 40 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

matriz_xx<-t(matriz_x)