Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Creating a new index changing the index base and looping

    Hello,
    I'm pretty new on Stata and I would appreciate your help on the following problem, on which I've been stuck for several hours.

    I have a dataset on yearly british output (agricolture, industry, services, mining etc...) from 1700 to 1870. All variables are indexes and the base year is 1700 (1700=100). For each variable, I would like to create 3 new indexes, with a different base year, in particular 1725=100, 1789=100 and 1870=100.
    I know how to create every single new index 'manually', but it would require a lot of typing... and i can't really figure out how to loop such a command.

    Can someone help me with this?

    Here you can find the dataset:
    british output for stata forum.dta

    Thank you.

    PS: sorry if my english is not perfect


  • #2
    Andrea Poles welcome to Statalist! Please go through the FAQ (especially section 12) for advice on how to post effective questions. In particular, instead of posting the Stata datafile (which many will hesitate to open from an unknown external source), please post an extract of your data using the dataex command in Stata. Also, it would be helpful to post your code for creating an individual index. Please do so using CODE delimiters (use the # button on the toolbar) so it looks well-formatted.

    Comment


    • #3
      This topic continues with an updated post at

      https://www.statalist.org/forums/for...rs-and-looping

      Comment

      Working...
      X