Hi all,
This might be a trivial question but whatever I have tried seems not working. (e.g. looping through the values of the variable fdi using forvalues and trying to generate new variables)
I have 2000+ territorial units (variable id) and the number of foreign firms located in each territory (variable fdi). My aim is to create a matrix similar to the one below. Namely, for each id, I want to create a new variable which is equal to the number of foreign firms in that territorial unit. Put differently, a matrix 2000 by 2000 is what I need
Will you please give me some hints regarding which commands I should look at/begin with?
Many thanks!
Array
Related Posts with create a matrix
How to identify that random effect linear model is required over fixed effect linear model?I'm trying to predict a continuous variable using multiple linear regression model including various…
Ordered probit and generalized ordered probit estimatesHi! I have an ordinal variable with four level as my dependent variable. In the regression table, I…
Estimating effect size in power calculationHello all, The answer to this question is probably no, but I had a quick question after doing a qui…
How to test whether the two variables are 2 standard deviation different from each other?Dear Stata experts, I have below comments from one referee for my paper, can someone guide me how t…
Uneven length of x axis in graph combineHi, I am trying to combine 3 coefplots using graph combine in Stata 16. I have coefficient labels o…
Subscribe to:
Post Comments (Atom)
0 Response to create a matrix
Post a Comment