Announcement

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

  • How to work with matrix-like data in STATA

    Dear all,

    At this moment I am working on my thesis on a (for me) whole new method in STATA. My data is organized as a matrix, where every observation is unique for a geographical region (vertical axis) and classification (horizontal axis), displayed for 7 time periods in seperate CSV files. Now my question is how to let STATA know it deals with matrix-like data. Can someone help me with the commands needed?

  • #2
    Hi Gerwin,

    It sounds like you have a panel data set. You may want to import each CSV file (see help import) using a loop (see help foreach, for example) by changing variable names each time to add a counter at the end of the variable names (using rename), and then use reshape to change the data structure from wide to long (see help reshape), if you would like to run panel estimation commands.

    Having said that, whether or not this works depends on what you would like to do with the matrix-like data. My suggestion above is assuming that you are trying to estimate something using panel estimation techniques.

    By the way, this question does not actually belong to Mata forum, and rather belongs to General forum. Mata is a matrix-based computation platform like Matlab or so, in my understanding.

    Best wishes on your thesis,
    Futoshi

    Comment

    Working...
    X