Announcement

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

  • Cross-sectional regression for a certain date

    Hello everybody,

    I have Panel data consisting of 35 companies. For each company I have dependent values for three years.
    My question is if there is a way to tell Stata to run a cross-sectional regression for a certain date (e.g. 01/01/2013) and show the results before moving on to the next date.

    What I like to achieve:
    For each date I would like to obtain the cross-sectional regression results and then to average them. This is similar to the Fama/MacBeth approach which is afaik used by xtfmb. Unfortunately I cannot use the xtfmb command due to installation restriction on the university's Computer. It is important to achieve obtain the results for each date as I would like to compare the coefficients and the R2 per day over the time period.

    What I could imagine is to xtset the data and run xtreg for a certain date...something like that.

    I would appreciate any comment. many many thanks!

  • #2
    Maybe as an additonal info:

    It would be advantegous if there is a way to tell Stata to qreg the cross-sectional data for a certain data within the panal data

    Comment


    • #3
      Hello Panda05.
      Unless you are contacting us from a zoo or a bamboo forest I suggest you re-read the section of the FAQ on using real names etc.

      You say that you cannot use -xtfmb- because there are restrictions on your University's computer network.
      I faced a similar problem at KCL, but found a way round.

      In my case, I was not allowed to use drive C:, where Stata usually stores user-written programs; but I did have use of drive N:.
      The following script set up directories on N: and instructs Stata to use them for downloading programs. Amend as needed.
      Run it as soon as you start Stata, and if your setup is like mine, you should then find no problem .

      *************************
      * profile.do
      version 12.0

      local ado "N:\ado"

      cap mkdir "`ado'\personal/"
      cap mkdir "`ado'\plus/"

      sysdir set PERSONAL "`ado'\personal/"
      sysdir set PLUS "`ado'\plus/"
      sysdir set OLDPLACE "`ado'/"

      adopath

      **************************

      Best wishes,
      Paul T Seed, Senior Lecturer in Medical Statistics,
      Division of Women’s Health, King’s College London
      Women’s Health Academic Centre, King's Health Partners
      (+44) (0) 20 7188 3642.

      Comment


      • #4
        Many thanks Paul. That worked fine for me.

        The problem is still that running qreg for each date would be nice so I can check for the cross-sectional coeffiecents and the R2 each day. Any idea.


        Sry for the user name. I will try to change it / create a new account.
        Thanks,

        Arian

        Comment


        • #5
          Why can't you run regress with an if date == the day you want? Consider the following example

          Code:
          clear all
          set more off
          
          webuse nlswork
          levelsof year, local(dates)
          foreach d in `dates' {
              regress ln_wage tenure wks_work south collgrad age race if year == `d'
              di as text "Year: `d'"
          }
          Alfonso Sanchez-Penalver

          Comment


          • #6
            do not create a new account; click on "contact us" at the bottom of the page and request a change

            Comment

            Working...
            X