Announcement

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

  • Fixed effect with 2 time points

    I would like to examine the effect of the COVID-19 outbreak on social isolation using panel study (data from 2016 and 2020 wave).
    However, it is my first time to use STATA, that's why I need your help.

    Anyway, to do this, I created a long format of data set.
    Social isolaiton (named "si") was measured through a continuous variable, and there are two variables "si16" and "si20"
    Also, the COVID-19 outbreak (named "year") was measured through time (0=2016, 1=2020) because there was no pandemic in 2016.
    Other control variables are not time variant.

    Here, I have no idea how to conducted fixed effect model and make appropriate syntax.
    Do you have any advice?

  • #2
    Yes, we do. Show us a small subsample of your data using -dataex- so that we can be most helpful.

    But basically you -xtset id year-, and there you have panel data declarer.

    Comment


    • #3
      You shouldn’t have two variables for si in the long format. It should just be called si. But it looks like why you’re doing is just seeing if the average changed across the two years.

      Comment


      • #4
        Originally posted by Joro Kolev View Post
        Yes, we do. Show us a small subsample of your data using -dataex- so that we can be most helpful.

        But basically you -xtset id year-, and there you have panel data declarer.
        See additional help here: Linear fixed- and random-effects models | Stata. Note that you can also use xtmixed to fit a multilevel model with unique id as a cluster. Results will be fairly the same.

        Comment


        • #5
          Originally posted by Joro Kolev View Post
          Yes, we do. Show us a small subsample of your data using -dataex- so that we can be most helpful.

          But basically you -xtset id year-, and there you have panel data declarer.
          Thank you. But I don't know how to show you the subsample of my data. Is it enough to just copy and paste after using -dateex-?

          Comment


          • #6
            Originally posted by Jeff Wooldridge View Post
            You shouldn’t have two variables for si in the long format. It should just be called si. But it looks like why you’re doing is just seeing if the average changed across the two years.
            That's right! I created many data files. As you say, I would like to see the changes in average scores acress the two waves.
            Also, in the long format dataset, there is one "si" variable.

            Comment


            • #7
              Joonyup:
              welcome to this forum.
              Just put all the stuff concerning your Stata session between CODE delimiters, that you can call by clicking on the #-shaped toggle available from the advanced editor bar.
              Kind regards,
              Carlo
              (Stata 19.0)

              Comment

              Working...
              X