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
panel data with cross sectional dependence and autocorrelationI have a panel data with N>T (N=157, T=15). Have taken log of a few variables to make it Heterosc…
Regarding Interval data (generating more years and duplicating values)Dear, Can anyone help me to manage the data? I have interval data. Since the data are only availabl…
How to graph the moderating effect(moderator: dummy variable) of a quadratic model?Dear specialists, I really thank everyone here sparing no efforts to help me. I have a censored da…
Table command in Stata 17: add column name to first columnHi, I'm exploring the new table and collect commands in Stata 17, and find that it has many useful …
floatplot -legend- optionDear Nick Cox , I have started using your -floatplot- from SSC program. I really like to use it more…
Subscribe to:
Post Comments (Atom)
0 Response to create a matrix
Post a Comment