Hi all,
I am trying to create a vector of cross price elasticities so that I can see their distribution (look at median and percentiles).
I have run into the problem that the matrix expression is too long.
At the moment my code looks like:
Here I get the error that the expression is too long. This vector is going to be quite long (I imagine it will be on the order of 1 million elements)
Having the vector in Stata would be best, but if I can export it to csv that would be alright too.
Is Mata the right option here?
All the best,
Eric
I am trying to create a vector of cross price elasticities so that I can see their distribution (look at median and percentiles).
I have run into the problem that the matrix expression is too long.
At the moment my code looks like:
Code:
local alpha = 3 foreach market in `markets' { foreach firm in `firms' { // this is not exactly what I'm doing, but close enough for example purposes qui sum mkt_shr if market == `market' & firm == `firm' local s = `r(mean)' // get statistic and add it to local macro local elasts `elasts' \ `alpha'*`s' } } // get rid of first \ local elasts: subinstr local elasts "\" "' mat def elasticities = (`elasts')
Here I get the error that the expression is too long. This vector is going to be quite long (I imagine it will be on the order of 1 million elements)
Having the vector in Stata would be best, but if I can export it to csv that would be alright too.
Is Mata the right option here?
All the best,
Eric