tag any repetitive values in multiple variables
Hi all, I have following variables in my data set with random integer values: INA INB INC IND INE In the variables mentioned above no value should repeat more than once. I want to check and point out...
View ArticleStacked Bar, Blabel: How to remove intervening categories except final...
Hi I use the following code to generate stacked bar-chart. In each bar, the intervening cumulative numbers are shown (e.g. for column 2 (mpg= 14), each cumulative count : 1,3,5 are shown, for mpg=18...
View ArticleSampling
Hi Forum I have searched the forum for a possible answer to the following question but to no avail. If I have a dataset with some rare events, often the case when dealing with mortgage defaults, say...
View ArticleSurvival Analysis
Hi everyone, I am going to perform a survival analysis (cox proportional hazard model) for an outcome (Y) that can occur each month from the starting point (discrete). I have several independent...
View ArticleSimulation & Random variable generation
Hello dears I have two questions concerning the simulation and random variable generation Q1: How can I generate a normlay distributed random variable that have specific mean, sd ,skewness and...
View ArticleFixed Effects
Dear All, I have the following model Investment_it=a + b*X_it + c*Treatment_i + d*After_t + e*Treatment_i*After_t + Industry f.e. + error (1) where "i" is an index for firm, "t" is an index for...
View ArticleMarginal effects after Heckman
Dear Stata users, I have estimated a Heckman two step selction model and want to get the probit regression with marginal effects. The Stata code that I have used is: heckman drrspending_total flrisk_l...
View ArticleMaximization problem -
Hi, I would like to maximize the "item_price" (the variable of interest) of each "item". Each item appears in different "pack" with different quantity ("qty"). Here is the data that I have (small...
View ArticleCreating a unique value after aggregating data
Hello Stata users, My goal is to run xtreg on monthly data. 1. The original data set is at the hourly level. In this set, there are four columns for time: year month day hour. I have created a...
View Article2spls CHECK IDENTIFICATION (i.e. Exclusion criteria)
"Dear Statalist Users I am estimating a set of simultaneous equations as below: Y=a0 + a1E+ a2X + e E= b0 + b1Y+ b2X+v Where E is a dichotomous variable and Y is a continuous variable. X is a set of...
View ArticleHow to make Graph for Seasonality Data
Dear Statlist, I am trying to make figure for seasonality data. I have households cross-section data over 5 quarters of two years, e.g. two quarter of 2012 and three quarter of 2013 ( each quarter...
View ArticleReplacing dates manually (
Hello, Wondering if anyone could help me. I've got an int variable "datesxonset" in format %td. The dates look like "09jan2015". However, some observations are missing that information so "datesxonset"...
View ArticleQuantile Regression for Panel Data
Hi, I am trying to estimate a quantile regression with panel data following Ivan A Canay (2011) A simple approach to quantile regression for panel data, Econometrics Journal, volume 14, pp. 368–386....
View ArticleRolling and xtreg return only missing values for beta estimate
Dear all, I am new to Stata so apologies in advance if my questions are basic. I have been working on this problem for hours and can't find a solution so any help would be welcome. I have a panel data...
View ArticleIs there an option to use all defined constraints in a regression?
I am trying to run a regression using sureg, and I have defined my constraints such that the program is flexible to changes in the variables I wish to use and there are no constraints that I do not...
View Articlelabel values from a "dictionnary"
Hi Statalist I use Stata 14 on Mac (and more frequently Stata in batch mode from shell) I have two datasets (examples below) THE FIRST ONE: ID CODE1 CODE2 1 10 11 2 12 12 3 13 14 and the SECOND ONE:...
View Articleperfect prediction in -heckman, select()-
Do heckman / heckprob attempt to identify perfect prediction in the selection equation? From the output, it does not seem like they do; logit or probit output would have said something like "blah...
View ArticleGini decomposition grouped data
Dear Statalists, I'm new to the forum. I'm using Stata 13 to estimate Gini coefficients for grouped data. My data is organized as follows: I have the number of farms (varname "farms") and the number of...
View ArticleProblems with parmest using loop
Hi. I am trying to run models using loops, and I want to store estimates and p-values in stata so that I can select which model I want to keep/discard. I did some research on statalist, and I found...
View Article