I have the following data set:
Parent Subsidiary Variable Value
US UK revenue 10
US FRA revenue 15
. . . .
. . . . .
US ESP profit 5
US UK profit 2
. . . .
. . . .
FRA US revenue 20
FRA UK revenue 15
. . . .
. . . .
FRA ESP profit 2
FRA LUX profit 10
I want to calculate the share of revenue that US parent companies have in the UK, FRA, and other countries. The figure for the UK then would be 10/(10+15+...). I want to do likewise for profits (and other variables).
I also want to do this for all countries - ie the share of French parent companies´ revenues that is generated in Spain, Luxembourg and other countries.
I´m guessing I might have to do loops, which I´m not really familiar with.
Related Posts with Generate variable (maybe needs a loop)
Query about command "arima"Hello I am using the arima command to estimate an ARMA process. My query is about the the constant …
Parallel foreach?To improve speed I would like to parallelize a loop of this kind: Code: global myvars v1 v2 v3 fo…
Help ReshapingHi, I am trying to reshape the data so I have just four columns, name code year and Alevels. My data…
Local dependency test for Latent Class AnalysisDear Stata users, I was looking for Stata materials on methods to test local dependency between item…
Create a rank variable mpg rank 12 1 12 1 14 2 14 2 14 2 15 3 15 3 16 4 17 5 I want to create a ran…
Subscribe to:
Post Comments (Atom)
0 Response to Generate variable (maybe needs a loop)
Post a Comment