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)
--collect export-- takes a really long timeHi, I like the idea of the new -collect- functions, but in my first application it take >5 minute…
How to extract numbers from string with combination of text and number?How do I extract 801011001, 801011002, 801011003, etc from the variable 'parm'. Example dataset is b…
"Command ysca is unrecognized" - from help graph_combineHi, I am currently looking at the graph_combine help file to solve the problem that I have posted h…
Help choosing Fixed effect vs Random effect for a binary panel data regressionHello everyone, I am working on a binary panel data regression. I did the Hausman test to see if I…
no constant in XTSURI'm just wanting to know why the noconstant option is in place for the XTSUR command? Should I set u…
Subscribe to:
Post Comments (Atom)
0 Response to Generate variable (maybe needs a loop)
Post a Comment