generate a dummy variable using gen
Dear Statalisters, This might be a foolish question. I was using Code: bysort year industry: egen med_hhi=median (hhi_sic3) * generate for each industry year group, the median ratio of hhi_sic3 - which...
View Articlezero inflated instrumental variables poisson regression
Hi, I am doing a poisson regression with instrumental variables. My data also contains disproportionately many zeros and I might have to do do a zip regression. But how to combine the zero inflation...
View ArticleMean by group and set as new column
Hello again, I'm getting deeper and deeper with Stata/Statistics and love it more and more. :-) I come from the classical programming area like c++/java/python and know how to solve problems with lists...
View Articlecount and unique commands
Hello statalist users, can anybody explain me the difference between the two commands ? I tried both commands but the results are different **with unique Code: unique index if inrange(year,2004,2012)...
View ArticleHeckman Variation for Categorical Dependent Variabe
Hi everyone, I am trying to find a variation of heckman model in which I could use a categorical variable as dependent variable. I am new to research and to stata, hence I am having a tough time trying...
View ArticleMin/Max
Hey guys, i am completely new to Stata and i got a little problem, maybe someone can help me out I got Data with a person_id and an application_year. It kinda looks like this: person_id...
View Articleprobit not converging
Hi folks. I'm using Stata 13 with Windows 10 OS. I'm running some probit regressions but one is not converging. After the 5th iteraction I keep getting a (Backed up) error. I don't think the problem is...
View ArticleInterpolation two questions
Dear Stata users, In one of the variables in my data I just have values in each five years, so what I want to do is interpolation. I used the following command: bysort country: ipolate educ year,...
View ArticleCombining date interval data from two separate datasets
I have two datasets, one containing the start and end time of work shifts throughout a year, and another containing rain event data, with the start and end times of various weather events. I would like...
View Articlegenerate variable for baseline - last visit change
I am trying to generate a new variable that calculates the difference between baseline and end of study visit. For example I have body weight (bdywt) for visit 1 and visit 5. I want to name my new...
View Articleusing squared terms like age & age squared, farm expereince &...
After using squared terms like age and age squared in a probit model and testing for multicolinearity, if the vif for the two terms is above 10, should one of them be dropped say age squared and remian...
View Articlecomputing industrial medians based on conditions
I am creating median industrial CG Index using the following code: bysort Industry : egen Industry_Median = median( CG_Index ) I want to add another condition to this code. when computing industry...
View ArticleConfused with factor variable interactions
Hello everyone, consider the following Code: sysuse auto, clear gen byte heavy = weight > 3000 regress price mpg i.foreign##i.heavy lincom 1.foreign + 1.foreign#1.heavy gen byte nonhvyfor = (!heavy...
View ArticleDoes subpopulation size matter?
Hi, I've been analyzing the survey which is General Social Survey (n=23,093) in Canada. While I'm interested in a small subpopulation (n=214), I'm wondering if I can use this small subpopulation for...
View ArticleQuestion about post estimation commands in Stata after firthlogit (SSC)
Dear All, I would like advice on specifying my model and commands to do post estimation in Stata with the user-written program firthlogit (available from SSC). I have 3850 units in my dataset and my...
View ArticleNegative Binomial Regression with Fixed Effect
Dear Statalist Forum, I'm currently trying to model the effect of environmental expenditure on firm patent activity. My dataset entails 10 automotive companies in Europe, with observations from 2000 to...
View ArticleGetting listcoef to display marginal effects for cross categorical comparison...
Hello everyone, I'm working with a multinomial logit model with three possible outcomes and clustered standard errors. My goal is to obtain the marginal effects at mean for a cross categorical...
View Articlecomputing within variance - panel data with serial correlation
Dear community, I have some questions and would be glad about your help! I have a strongly unbalanced panel data set. It consists of accounting data of many firms over 10 years. It also covers the time...
View ArticleCount how often each household member was mentioned per activity
Dear Statalist, within my survey data set, I asked each respondent who in the household was responsible for specific activities and I would like to know for each household member, how often that...
View Articleeventstudy2 to conduct an event study
Hi, Stata users, Has anyone tried to use the user-written program eventstudy2? I would have some questions, especially on how the data should be organized. I have a panel dataset (I attach the .dta...
View Article