In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains how to solve the problem of "no observations" in stata. Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to solve the problem of "no observations" in stata.
When doing regression, time series analysis, and panel data analysis in stata, the problem of "no observations" often occurs, as follows:
This is the excel format data of the relevant time series of interest rates on US Treasuries from January 2009 to December 2017.
When we import the excel file through the file--import--Excel spreadsheet menu operation in stata, and name the first line as a variable, we import the excel file into stata
At this point, when we check the unit root of TB1YR (first of all, we need tsset DATE to define time variables), there will be the problem of "no observations".
By querying the relevant websites and their materials, we can find that the problem of "no observations" is not entirely the reason for the missing value of TB1YR or the character value of the variable. The main reason is that although the date variable DATE is an integer numeric (int) or numeric (float) variable here, but its data format: 1Charger 2009, does not conform to the traditional stata data format on time and date.
In order to solve this problem, many people on the Internet have put forward the method of destring DATE, replace, and the method of converting DATE into "numerical variables", but this method does not work:
DATE already numeric; no replace indicates that DATE is already numeric without conversion.
There are still many people on the Internet who have adopted a lot of methods, but they are not effective, so what should we do to solve this problem?
The author believes that since the problem lies in DATE and the attributes of DATE can not be changed by various means, we might as well regenerate a variable t about the date and give it a numerical value to solve the problem.
Because the date variable DATE or t does not participate in the actual regression or time series analysis process, but is a defined indicator variable. The process of resolution is as follows:
Generate a completely numeric time variable by egen t=group (DATE), then define it with tsset t, and finally carry on the unit root test, you can see that there will be no "no observations" problem.
At this point, the t variable is rendered as follows:
At this point, I believe you have a deeper understanding of "how to solve the problem of" no observations "in stata. You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.