Loop through each observation of a string variable located in another dataset
Hi all, I need to loop through each observation of a (string) variable of another dataset. What is the best way of doing this? I am trying to do: foreach x in var_ext { replace var1 = strpos(var2,x) }...
View ArticleBonferroni-corrected correlation matrix to Excel
Dear all, I want to create a couple of correlation matrices (with Bonferroni correction) and include these into MS word. I want to use Bonferroni adjustments since I have around 20 variables. Stata's...
View Articlextoprobit, how to solve the missing command fe
Hi, Stata users! I have panel data and I have ordinal dependent variables, so the best econometric model to use is ordered probit. Unfortunately, Stata does not have the fixed effects option. Does...
View ArticleMulti-level model (xtmelogit) vs. adjusting for PSU and strata (svy: logit)?
What is the appropriate way to specify models that incorporate two levels of clustering (if that is the right term)? I initially used xtmelogit (level 1=child, level 2=sibling groups, level...
View ArticleStata cutting off first letter in string for observations for 1 variable
Hi everyone, For whatever reason, Stata is cutting off the first character in my county variable (which is my first variable, if that makes any difference): ex. Baldwin County shows up fine in my CSV,...
View ArticleCreate variable with distinct prices
Dear all, In my data set I have the variable “board”, which counts the size of boards of directors, with prices 4-34. I want to create the variable “board_sizeC” which will have the prices: S if...
View ArticleZero-inflated negative binomial models taking forever
Dear Stata users, Help would be much appreciate if you could help with figuring out what's wrong with my ZINB models. Here's the syntax I'm using: zinb DV controls (16 of them) c.IV1##c.IV2,...
View ArticleTransforming negative values in order to solve heteroskedasity
Hi all, Just a question regarding heteroskedasity. I am using the level of interest rates, which appear to be negative for some countries during my sample period. The problem is that my dependent...
View ArticleVery different results between Heckman Maximum likelihood vs. Twostep
I ran the Heckman selection model, using both ML and twostep to estimate the returns to education, but i get completely different results. For ML method, my t-stat is stat.sig.different from zero, but...
View ArticleForeach command help
Hi all I have a table in long format that has a municipality descriptor and a column representing the year of observation and a income variable I would like to have generate a column having the average...
View Articleheckman selection model
heckman lwage educ exper expersq nwifeinc age, select( inlf= educ exper expersq age faminc ) heckman lwage educ exper expersq nwifeinc age, select( inlf= educ exper expersq age faminc ) twostep (inlf=...
View ArticleMinimum value of remaining observations
I have a dataset with panel observations of patients' tests result and I want to mark patients who meet certain two criteria:Two consecutive tests, with at least two weeks apart, both fall under 60....
View ArticlePropensity Score Matching on Panel Data
Hi all, I'm currently looking to perform a propensity score matching (PSM) estimator on panel data. My study consists of 39 countries over a 23 year period (1990 - 2012), and I'm trying to ascertain...
View ArticleHEGY Seasonal Unit root
Hi, Just as a suggestion, It would be very useful a routine to perform seasonal unit root tests for monthly time series. Thanks.
View ArticleReshape Help
Hello Statalist Users, I am using Stata 13.1 and am trying to organize county level data. I was able to reshape my data into a long form so that the year data is a variable; however, I need to reshape...
View Articlecould not calculate numerical derivatives -- flat or discontinuous region...
Hello Statalist Users, I am encountering a problem while estimating double hurdle model using <craggit> command, I receive <could not calculate numerical derivatives -- flat or discontinuous...
View ArticleCalculate the asset growth rate for quarterly panel data
Dear Statalists, My main target here is to calculate the asset growth rate over the last quarter for a specific firm, the data is quarterly panel, for example: firm_id year quarter assets 37 1997 1...
View ArticleLine plot 2 Y axis
Dear all, Imagine I have groups of 5 variables called gdp1 gpd2 gdp3 gdp4 gdp5, population1 population2 population3 population4 population5.... with many observations in each variable, corresponding to...
View ArticleLSDVC - too many instruments
I have a problem with the implementation of LSDVC method on Stata software. I have two panels ( N=8 and T= 120 and N=16 and T=180), but when I am trying to implement the command the software say that...
View ArticleHow to get an overall p-value for an independent categorical variable using...
Hello, I would like to know how to get an overall p-value for an independent categorical variable using binary logistic regression ? When I run the binary logistic regression model I just get p-values...
View Article