Subsetting matrix by column number or name

38 Views Asked by At

I've been trying to subset a matrix that I created in Stata using matrix A = e(b) but I only want to use the coefficients of a specific dummy, specifically from column 6 until column 29. They have similar names (1.dummy1, 2.dummy1, 3.dummy1, ... etc.) but I still am not sure how I can create a new matrix that only contains those values (needed to create a plot)

1

There are 1 best solutions below

0
Nick Cox On
. mat b = J(1,40,runiform())

. mat b2 = b[1, 6..29]

See help matrix extraction.