Stata - How to use tsset

  Рет қаралды 10,435

Steffen's Classroom

Steffen's Classroom

Күн бұрын

Welcome to my classroom!
This video is part of my Stata series. A series where I help you learn how to use Stata. In this video, we look at how to declare your data to be time series or panel data.
Mistake at 5:10
It should be: tsset compnay time
Note: What I show here is my take on the topic. I would be happy to receive comments!
Useful links:
►Twitch: / steffens_classroom
►Twitter: / steff5001
►Workpage: www.rug.nl/sta...
►Subscribe: cutt.ly/Qfu9cmV

Пікірлер: 24
@remcobos6201
@remcobos6201 3 жыл бұрын
Thanks again! I happened to notice that at <a href="#" class="seekto" data-time="310">5:10</a> you entered 'tsset time company' but shouldn't 'company' be set as the panel variable such it becomes 'tsset company time'?
@SteffensClassroom
@SteffensClassroom 3 жыл бұрын
You are of course right! That is a mistake. Nicely spotted :) Fortunately, it the example still works.
@jingnanli7325
@jingnanli7325 2 жыл бұрын
thank you very much sir. it is absolutely clear!
@mohammedalnour318
@mohammedalnour318 Жыл бұрын
Very informative dear Dr, many thanks
@kaysullivan5434
@kaysullivan5434 Жыл бұрын
Really great video. Thank you
@adilreshi2909
@adilreshi2909 2 жыл бұрын
Awesome video professor. Thanks for uploading. I have a query regarding the unbalanced panel with a lot of missing variables...Please inform me which Stata command shall I use when panel data is unbalanced....
@SteffensClassroom
@SteffensClassroom 2 жыл бұрын
Hi Adil! Thank you for your comment. An alternative to the tsset command is xtset for panel data. Go and try that one out :)
@jingnanli7325
@jingnanli7325 2 жыл бұрын
thank u sir. your final step tsset bcal_date. in my case, it shows "repeated time values in sample". how to deal with? thank you
@SteffensClassroom
@SteffensClassroom 2 жыл бұрын
Dear Jingnan. Thank you for the question. As Stata signals, I suspect that you may have multiple observations for the same date. In which case you would have to find and remove potential duplicates. You can see my video on how to do that. I hope I understood your questions correctly.
@remcobos6201
@remcobos6201 3 жыл бұрын
Does an unbalanced panel influence OLS regression in STATA? (We assume missing observations to be random)
@SteffensClassroom
@SteffensClassroom 3 жыл бұрын
What does it mean that a panel is unbalanced? In short, at least one panel member is not observed each period. When running a OLS, that observations will thus not be there. If these missing observations are random, then it should not give any problems. Further info can be found here: kzbin.info/www/bejne/i3SzlnlmZrF5rbs I discuss this early on. Hope this helps!
@ncpamulaklakin1426
@ncpamulaklakin1426 Жыл бұрын
Hello thank you for this vid, but what should I do if my data is weekly? my stata keeps saying " time variable: weekly, 28jan2018 to 26feb2023, but with gaps delta: 1 day"
@ncpamulaklakin1426
@ncpamulaklakin1426 Жыл бұрын
Stata date cannot be after Dec 31, 9999 -it says this after the bcal thing
@SteffensClassroom
@SteffensClassroom Жыл бұрын
In short. If you have weekly data then it is not a business calendar you need, you use option weekly for tsset.
@ikhlasmatloob6284
@ikhlasmatloob6284 3 жыл бұрын
When I attempt this STATA tells me that the time value is repeated even when i use the command: tsset Location Quarter. I don't suppose you know a way around this ?
@SteffensClassroom
@SteffensClassroom 3 жыл бұрын
Dear Ikhlas, There are a few things you can try and do here. First, do your time and entity identifier uniquely identify your data? Try and use isid Location Quarter. If you get nothing back, well that is good. Otherwise, you should check for duplicates, which can be done using duplicates report Location Quarter. This will give you a report to see if you have any duplicates your dataset. If that if the case, you will have to remove any of such duplicates, and then try tsset again. Hope this works! Lmk,
@ikhlasmatloob6284
@ikhlasmatloob6284 3 жыл бұрын
@@SteffensClassroom I previously used the tsset command and it worked but after filling in gaps in the panel data and duplicating my quarter variable it no longer works. I tried your suggestion and command doesn't work. Do you think using tsset, then filling in missing obvs then using tsfill will work ?
@SteffensClassroom
@SteffensClassroom 3 жыл бұрын
tsfill is generally used after tsset, so that is fine. The Stata file will also explain you this: www.stata.com/manuals/tstsfill.pdf Hope this helps
@ikhlasmatloob6284
@ikhlasmatloob6284 3 жыл бұрын
@@SteffensClassroom thank you for the help Steffen
@SteffensClassroom
@SteffensClassroom 3 жыл бұрын
Happy to help!
@cyrilfilezac8115
@cyrilfilezac8115 2 жыл бұрын
file calendar.stbcal could not be opened for output i don't understand why ...
@SteffensClassroom
@SteffensClassroom 2 жыл бұрын
I am.also not certain to be honest. Does this error appear after you use tsset?
@cyrilfilezac8115
@cyrilfilezac8115 2 жыл бұрын
@@SteffensClassroom yes but i try to change the directory with : File -> Change directory and it is good. I think it is a file problem
@SteffensClassroom
@SteffensClassroom 2 жыл бұрын
@@cyrilfilezac8115 This would be nice to figure out. Would you mind mail me about the issue (see my mail on the about page on the channel)?
Stata - Keep/Drop and Missing values
5:13
Steffen's Classroom
Рет қаралды 28 М.
Stata - How to use groups and loops
8:28
Steffen's Classroom
Рет қаралды 5 М.
The Joker wanted to stand at the front, but unexpectedly was beaten up by Officer Rabbit
00:12
小丑在游泳池做什么#short #angel #clown
00:13
Super Beauty team
Рет қаралды 39 МЛН
An Unknown Ending💪
00:49
ISSEI / いっせい
Рет қаралды 48 МЛН
大家都拉出了什么#小丑 #shorts
00:35
好人小丑
Рет қаралды 93 МЛН
Stata - How to create dummy variables in multiple ways!
9:34
Steffen's Classroom
Рет қаралды 16 М.
Fill Gaps in Timeseries or Panel Data in Stata
15:06
The Data Hall
Рет қаралды 3,8 М.
Stata - How to use gen(erate) & egen
6:17
Steffen's Classroom
Рет қаралды 14 М.
Stata Tutorial: Out of Sample Forecasts
17:12
Mike Jonas Econometrics
Рет қаралды 21 М.
Stata - How to use Do-files
8:57
Steffen's Classroom
Рет қаралды 23 М.
Introduction to Programming Loops in Stata
17:25
Mike Jonas Econometrics
Рет қаралды 18 М.
Stata - How to conduct panel data regressions
7:04
Steffen's Classroom
Рет қаралды 6 М.
Stationarity Test: ADF in STATA
16:16
Excelling with Naomi
Рет қаралды 13 М.
Collapsing Data in Stata
6:12
SebastianWaiEcon
Рет қаралды 39 М.
The Joker wanted to stand at the front, but unexpectedly was beaten up by Officer Rabbit
00:12