Hello,
I have a dataset and i need to define quarterly time variable and declare data to be a panel data. "datadate" variable - contains the calendar date of the fiscal year end of a firm. So what i did is generated a quarter variable and then declare data to be a panel data. I am not sure if my code is correct.
g quarter = qofd(datadate)
format quarter %tq
xtset permno quarter
But is it possible to use a shorter code? Will this code have the same result?
g quarter = qofd(datadate)
xtset permno quarter, format(%tq)
THank you in advance
Related Posts with panel data and time variable format
Calling a block of code within a DO fileHello All, I am running a DO file to create a table of summary statistics for a large number of var…
Running Bootstrap program to Implement Control Function ApproachHello, I am trying to implement Wooldridge's control function approach and bootstrap both the first…
IV regressions with different weights in the 1st and 2nd stageDear Statalist users, I would like to run an IV regression using different weights in the first and…
Need to call a block of code within a Do fileHello All, I am running a DO file to create a table of summary statistics for a large number of var…
Person-Item Map in Stata?Dear StataList Users Is there a command to generate a Person-Item Map in Stata, after running the ir…
Subscribe to:
Post Comments (Atom)
0 Response to panel data and time variable format
Post a Comment