Construct monthly time series
Hello there, I am using panel data in Stata. Currently, I have daily data for Return. I would like to construct monthly return by calculating the equally-weighted average of the daily return in a given...
View ArticleRanking variables (instead of observations)
The questionnaire I have data from asked respondents to rank 20 items on a scale of importance to them. The lower end of the scale contained a "bin" in which respondents could throw away any of the 20...
View ArticleUseful (and free) Stata training sources?
Dear All, I am working with Stata a lot recently, but I am still very very slow at telling the program what to do. This can be a bit frustrating if one wants to evaluate research ideas "quick and...
View Articletwo ways fix effect on industry and years.
Hello – I want to perform a two ways fix effect on industry and years. Currently I perform a two ways fix effect on firms and years (which is OK). In order to do that (the firms and years) I first...
View ArticlePanel data ttest
Hi, I'm comparing data (sales) of private equity backed companies (variable pe=1) and non-private equity backed companies (variable pe=0). I have panel data (846 companies over 6 years). I would like...
View ArticleTreating different missing data differently
Hi, If I've got a dataset containing different types of missing values: .a = unexpected missing .b = expected missing. I'm creating several variables using egen and rowtotal and have been using the...
View ArticleHelp with Error message in CMP
When I run CMP. I get the following error message Fitting full model. variable __00000E not found invalid syntax I have tried various option in CMP but this error message refuses to go away. Can...
View ArticleKeeping observations that start with specific digits
Hello, How can I keep observations that start with a certain set of numbers. Specifically, I want to keep observations that start with "3344" within a list of mostly 6-digit numbers. I found a previous...
View ArticleBar and line on same graph
I am using Stata 13. I want to get bar and line on same graph,. I tried following code: Code: twoway bar grp1 grp2 reportyear, stacj || line grdnv reportyear but it returns the error: option stack not...
View ArticleInterpretation of marginal effect and its first difference using mlincom
Hi all I have a question about interpreting results of marginal effects and its first difference correctly. I ran a three-way interaction effect of x1,x2 and x3 using "xtlogit" and estimated marginal...
View ArticleMatching variables by Name
i'm just starting out with stata, so please bear with me. I've got two data sets. the 1st is a list of a population by name and surname. the second is a portion of said population by name and surname,...
View ArticleRecognizing spells of negative and positive values
Hello, I'm having trouble identifying spells in my dataset, which is set as a timeseries. The goal is to identify observations that have had >= 3 negative value changes, followed by one positive...
View ArticleRandom parameters in bayesmh
Hello, Could you please advise how to specify the independent variable "x2" from below as a random parameter? bayesmh z x1 x2 x3 i.id, likelihood(normal({Sigma1})) /// prior({z:_cons} {z: x1} {z: x2}...
View ArticleDownload and install the frmttable package
Dear All, I need to use the frmttable package in a computer that does not have internet access. For that, I think I should download the package in another computer. However, I have not being very...
View ArticleHow to interpret my coefficients?
Hi, I have the following model: Giniit = ai + b1ln(BNPit) + b2tradeit + eit, where Giniit is the Gini-index from 0 to 100, ln(BNPit) is ln of BNP per capita, and tradeit is the sum of import and export...
View ArticleIs there a way to index a variable based on another variable?
Example: date_w ap ------------------------------ 1. 2012w42 12.99 2. 2012w43 12.31 3. 2012w44 12.14 ------------------------------ I would like to refer to ap=12.31 as ap[_2012w43], or something...
View ArticleHistogram: Include variable in xlabel
Hi all, I'm new to STATA. I just started using it for the first time yesterday. I have some experience coding in C++ and IDL. I have a small question related to inserting a variable in xlabel to...
View ArticleInteraction term w/o including one of the variables
Hi, I have a panel of firms in 8 years, categorized in two sub-samples of treated and control. I want to see the effect of treatment on an outcome variable Y by regressing Y on the treatment dummy...
View ArticleLLC test indicates stationarity; IPS indicates unit root
Dear all, I am using Stata 14.1 to analyze balanced panel dataset of 11 countries over period 2002-2014 (143 observations). As a first step, I want to check for stationarity of the series, in this...
View ArticleAdvanced if-function needed
Dear colleagues, I am working with a dataset with more than one entity per cluster. Meaning that the dataset contains one case for the main person and one for his/her partner. The partner case can be...
View Article