Announcement

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

  • Unbalanced Panel data

    Hi all,
    I am trying to run a panel data and it ends as unbalanced, its for the years 2009 to 2016 and by the code below i made it monthly for three saving rural banks (CAJA) so its 96 observations for each rural saving bank and by looking at the data there is no missing value, but Stata 14.1 reports 65 thousand missing values. I have searched in this forum and found that there is no need for the data to be balanced but I still don't know if it is the right way to proceed.

    Code:
    . gen edate = mdy(MONTH, DAY, YEAR)
    (65,247 missing values generated)
    
    . gen mdate = mofd(edate) 
    (65,247 missing values generated)
    
    . format mdate %tm
    
    . xtset CAJA mdate 
           panel variable:  CAJA (unbalanced)
            time variable:  mdate, 2009m1 to 2016m12
                    delta:  1 month
    Searching the forum I applied this code to know if there is any missing value for my database but it results as 0 missing values.

    Code:
    . do "C:\Users\20122\AppData\Local\Temp\STD00000000.tmp"
    
    . egen myrowmiss = rowmiss()
    
    . 
    end of do-file
    
    . do "C:\Users\20122\AppData\Local\Temp\STD00000000.tmp"
    
    . drop if myrowmiss >0
    (0 observations deleted)
    
    . 
    end of do-file
    Thanks in advance,

    César Romero

  • #2
    César:
    the code you ran will lead you astray unless you type between brackets the variables you're interested in searching the missing values, as you can see from the following toy-example:
    Code:
    . use "C:\Program Files (x86)\Stata15\ado\base\a\auto.dta"
    (1978 Automobile Data)
    
    . egen mymiss=rowmiss( rep78)
    
    . tab mymiss
    
         mymiss |      Freq.     Percent        Cum.
    ------------+-----------------------------------
              0 |         69       93.24       93.24
              1 |          5        6.76      100.00
    ------------+-----------------------------------
          Total |         74      100.00
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Dear Carlo ,
      I put between brackets variable mdate dropped myrowmiss and Stata reported my panel data as strongly balanced,
      Thank you very much for your help.

      Comment

      Working...
      X