Suppose I have variables
local a=10
local b=1
local c=0.25
where a necessarily is an integer. Now, how do I create an a times a matrix whose diagonal elements are all equal to b and whose off-diagonal elements are all equal to c? I’m not very familiar with matrix in Stata language, so I’m hoping anyone can help me out here. Thanks in advance.
Here
matmapmust be downloaded from SSC usingssc inst matmap.By the way, the locals are not needed here. You can just enter your constants as such.