Collapse command and how to generate various percentiles for different...
Dear Stata Forum, I have individual level data and I would like to aggregate the wage data by region (250) and year (8) for the 10th percentile for both men (wage_m) and women (wage_f). For that...
View Articlemixed and time varying IV
Dear all I ran an experiment where physiological datas for participants (n=147) were taken during a stress task, as well as their level of anxiety at each occasion and a time invariant IV (negative...
View ArticleDropping values below 5 dollars of variables with openingprice in the name
In my stata data I work with opening prices of nasdaq stocks. This are more than 1000 stocks and I want to only investigate stocks with low prices. So I need to drop all the values above 5 dollars for...
View ArticleCluster longitudinal RCT power calculations with unequal number of clusters...
Hello, I want to compute power calculations for a cluster RCT with a baseline and 3 follow-ups. The number of clusters in the treatment is different to the number in the control group. Assume the...
View ArticleIncluding factor variable using dtable and collect with multiple panels
I am trying to make a table of descriptives with two panels. I am using pweights, and in the second panel a factor variable with three age groups. When run the two lines with dtable separately, the...
View ArticleKeeping all members of a group if at least one member of the group has a...
I have a yearly panel dataset of families, covering years 2019-2022. Each person has an individual id, and individuals living in a household together are linked by another variable household id. I...
View ArticleHow can I reproduce results from Mahapick and Psmatch2 commands in Stata?
Dear All, I have been trying to run Mahalanobis distance matching using Mahapick and Psmatch2 command in Stata. However, I have been facing issues to get same results albeit having same set of...
View ArticleIssues in Mahapick post estimation (Calculating mahalanobis matching quality)
Dear All, I ran a Mahalanobis matching procedure on a firm level panel data using the Mahapick command in stata. Here is the command for your reference mahapick ProportionWatchlist CEODuality CEOAge...
View Articleissue while running ppml_fe_bias
I'm trying to correct for a three-way bias using ppml_fe_bias, but Stata is returning an error. Does anyone have any suggestions? Code: . ppmlhdfe trade fta_other fta_other_lead_2 fta_other_lag_4...
View ArticleSTATA & Sharepoint
Hello, My company is moving towards using Microsoft Sharepoint/Teams for file sharing. Historically, I export xlsx files (usually raw data or data that's been wrangeled) from STATA to a shared drive...
View Article2SLS using ivreghdfe
Hi, I’m using ivreghdfe, and I’ve noticed that the constant term is not appearing when I run my regressions. Is there a way to display the constant in the output? actually it is important to display it...
View ArticleYear Fixed effects vs dropping one dummy
I am running regressions with year fixed effects, but one of my covariates is age, which is perfectly collinear with year. I’ve noticed that some papers include year dummies but drop one year to allow...
View ArticleQuery around egen function
Hello, I am re-running a Do file from my colleagues and trying to understand some of the codes they have written. However, I am struggling to understand one of them involving egen and max/min...
View ArticlePredictions using ppmlhdfe
Dear users I am trying to use ppmlhdfe command proposed by Sergio Correia, Paulo Guimarães and Thomas Zylkin ( 2019 ) to estimate a gravity model. I am interested in getting RTA driven predicted trade...
View ArticleHelp Needed Identifying Differences Between Two Datasets After Re-Creation
Hello Everyone, I created a dataset a while ago by merging several cross-sectional datasets into panel data. After receiving feedback, I redid everything from scratch, following the same steps but...
View ArticleDID- OLS vs PPML
I'm running a DID regression where my outcome is the number of crimes committed by group g for each day. I run OLS and poison regression and I get different results. I wanted to know which result...
View ArticleMediate command
Hi, I wish to know the reason why i get different mediated effect while using the Stata `mediate` command with the following specifications: mediate (outcome cov1 cov2, logit) (mediator cov1 cov2,...
View ArticleInteraction in mixed logit
Hello, Thank you for this forum. I am a PhD student. I am writing here to be confirm one thing. I am doing mixed logit analysis with my choice data. I am using the mixlogit code (Hole, 2007). My code...
View ArticleWhich regression form to use
Hi all, I have an independent variable which ranges from 0 - 1 in theory, but has a practical range of 0.18 to 0.67. When using a normal linear regression, it calculates the effect of a one unit...
View ArticleBar graph coloring with two over categories
I have two categories and want to plot the means as bars. I want to use different colors for the category "treat" and then different shading the category "post". However, I am failing to even get the...
View Article