Announcement

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

  • Creating a panel dataset using STATA

    Hello colleagues

    I am analysing the impact of COVID 19 on firms. I want to use two waves of the World Bank Enterprise Surveys (One collected in 2019 and a follow up collected in 2020 after the Covid19 out break. How can I create a panel dataset for from these two waves so that I can analyse the data using propensity score matching. The variable names are different. I have attached the pictures of the datasets.

    Joseph
    Attached Files
    Last edited by Joseph Lubuto; 17 Oct 2020, 04:07.

  • #2
    Joseph:
    you should first -rename- the variables that you want to use as -panelid- and -timeid- in your would-be panel dataset, so that they share the same name..
    Then you can use -append- to create the panel.
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Hi Carlo

      Thank you for the feedback. Would you by any chance have the syntax for doing that. I am still learning the STATA language.

      Kind regards
      James

      Comment


      • #4
        Joseph/James:
        the name of the -panelid- (-idstd-) seems already OK.
        What you should do is -rename- ing the -timevar- in the second wave (ie, in the second dataset that you're going top -append- to the first one):
        Code:
        rename a14d COVa20d
        rename a14m COVa20m
        rename a14y COVa20y
        Then you can go -append-.
        Kind regards,
        Carlo
        (StataNow 18.5)

        Comment


        • #5
          Thank you very much Carlo. I have actually renamed all the variables of interest so that they match in both files.

          With warm regards
          Joseph James Lubuto

          Comment


          • #6
            After appending the second wave of the enterprise survey I have noticed that there are missing values/observations on the dataset from the second wave (follow-up survey). I have a categorical variable (a6a) and a continuous variable a6c having missing values/observations. Since they have the same id, I was expecting to have labels or values on the dots (.). For example
            idstd a6a a6c
            680991 small 5
            680991 . .
            680992 large 456
            680992 . .
            680993 small 5
            680993 . .
            680994 medium 56
            680994 . .



            Considering that it was a follow up and the id (idstd) variable is the same, I want the dataset to look like this:



            idstd a6a a6c
            680991 small 5
            680991 small 5
            680992 large 456
            680992 large 456
            680993 small 5
            680993 small 5
            680994 medium 56
            680994 medium 56


            DETAILED TABLES

            Table From First Wave

            Click image for larger version

Name:	stata1.PNG
Views:	2
Size:	31.7 KB
ID:	1579828






            Table From Second Wave


            Click image for larger version

Name:	stata2.PNG
Views:	2
Size:	26.2 KB
ID:	1579829





            Comment

            Working...
            X