How do you refer to the local i of the mata for loop in a st_ function such as st_numscalar? I tried a few things in the commented section below including st_numscalar("`A'i") but nothing worked, and I couldn't find an example or solution anywhere online.
Code:
tempname A1 tempname A2 tempname mat mata st_numscalar("`A1'", 4) st_numscalar("`A2'", 5) `mat' = J(2,1,0) // This for loop doesn't work to create a 1x2 matrix with A1 and A2 values for(i=1;i<=2;i++) { `mat'[i,1] = st_numscalar("`A'i") } `mat' end
Comment