Time-invariant independent variables in xtnbreg, fe
Hi there, I am running an xtnbreg model with fixed effects. Since in Stata it implements the Hausman, Hall and Grinches (1984) model, it actually allows time-invariant regressors. My question is, do I...
View ArticleAdvice on reshaping dataset
I am trying to reshape my dataset from: Code: * Example generated by -dataex-. To install: ssc install dataex clear input int Code str2 Subcode int Fullcode str7 Street byte(a b c) 111 "01" 11101...
View Articlenot concave, multinomial logit
I am running a multinomial logit with mostly dummy variables. These variables are constructed manually, by Code: tab x, gen (xa) [CODE]. My regression code is the following Code: mlogit cond_empleo...
View Articletukeyhsd not reporting HSD-test values
Hello Everyone, I am using "tukeyhsd" a user written command (Philip Ender) to run pairwise comparisons. When I run my code accompanied with "if" statements the output doesn't include the values for...
View ArticleDecode for numeric variables
Hello, I am running a loop to remove all value labels and leave them as string variables. Code: ds, has(vallabel) foreach v of varlist `r(varlist)'{ decode `v', gen(temp) replace temp =...
View ArticleDynamic model estimation with xtabond2
Hi everyone, I want to estimate a dynamic panel data with System GMM estimator (xtabond2 algorithm) with 25 observations form 1995-2014. After checking for unit root with IPS test, two RHS variables...
View ArticleHow to interpret nl exp2?
I have two variables, reqgrade and year. When I run a nonlinear line of best fit, by doing: nl exp2 reqgrade year I get a good, high r^2 value. Here is what STATA calls it: 2-param. exp. growth curve,...
View Articleinterpreting nl exp2
I have two variables, reqgrade and year. When I run a nonlinear line of best fit, by doing: nl exp2 reqgrade year I get a good, high r^2 value. Here is what STATA calls it: 2-param. exp. growth curve,...
View ArticleHow to interpret nl exp2?
I have two variables, reqgrade and year. When I run a nonlinear line of best fit, by doing: nl exp2 reqgrade year I get a good, high r^2 value. Here is what STATA calls it: 2-param. exp . growth curve,...
View Articleaccessing variable characteristics with Mata
Hi, all. I'm working on my first piece of Mata code, which involves modifying the -codebookout- command so that it outputs variable characteristics as well as labels, etc. I'm having a rough time...
View Articlefixed effect with endogeneity where I have no instrumental variable
Dear all, I am trying to estimate a fixed effect model where I suspect few variables have endogeneity. Unfortunately, I do not have any instrumental variable in my hand. How can I test the endogeneity?...
View ArticleMargins out of a multinomial logit
I tried to get margins out of a multinomial logit, and this shows, any ideas? Code: margins, dydx(*) predict(outcome(1)) Average marginal effects Number of obs = 160,341 Model VCE : Robust Expression :...
View ArticleSame code, result depends on whether activated by "if" or...
In defining a local macro using escape characters, I found that the result depended on whether the (same) command was activated by an if clause or an else clause. This is obviously quite puzzling. Here...
View ArticleRemove a row of variables in a non-survey data set
My non-survey dataset looks like this ID Location 1 AICU 1 BICU 1 NICU 1 4W 1 4W 1 4W 1 4W 1 4W 2 5E 2 5E 2 5E 3 NICU 3 6E 3 6E I want to remove any row of ID that has one instance of either...
View Articleimport multiple csv/xls with INVALID FILE NAMES
Hello, I am using a loop to import multiple dataset with different extensions and append them. The problem is that some of these files have invalid characters in their names (blanks, $ etc.). I am...
View ArticleGraph bar for multiple categories
Hello everyone, I am brand new to Stata, so apologies if my question seems easy to some of you. I have the following variables: School: an encoded variable ranging from 1-13 for different school names...
View Articlematch with reclink2
Dear Statalisters: I am trying to use the reclink2 to make a match between two databases that are exactly equal. I am trying to do that in order to identify schools that have a similar name and are...
View ArticleImposing Cross equation constraint on SURE model-Syntax error
I have to estimate a SURE model with cross equation constraints which looks as follows: X= a + b* L.X + c*L.Y Y = g + (0.2*b)L.X + (2+ 0.2c)*L.Y constraint define 1[Y]L.X= [X]0.2*L.X constraint define...
View ArticleQuasi-separation Logistic Regression in Panel Data
I'm working with a panel data and am facing a problem of quasi-separation logistic regression. I read some articles on the subject, among them one that indicated the use of 'firthlogit' command to...
View ArticlePanel Data: Rolling Window
Dear All, I want to calculate monthly alphas by running the Carhart 4-factor model against monthly excess returns of funds. I am working with an unbalanced panel as not every fund is observed monthly...
View Article