A version controlled -save- command
In a recent announcement, Michael Stepner discusses the problem of different dta-file formats when collaborators working with different versions of Stata. Although the new saveold command can write...
View Articlemodify charlson.ado to add new codes
dear all, im trying to use the charlson program to find renal patients in a database, but the program dont identify all the codes that i need... or perpaphs im using the program in wrong way. I have to...
View Articleshading areas on a graph
Array I am using Newson's -eclplot- (from SSC) to show confidence intervals; I want to include a shaded area showing the CI for the "combined" data; here is the command I am using: Code: eclplot cat ll...
View ArticleLooping over the same GDP variable over vintages of time
Hi all I have Gross Domestic Product, gdp, data that are in vintages (i.e. the gdp variable is revised over time, so gdp65Q4 below is the gdp data revised at a vintage date of year 1965 quarter 4....
View Articleproblem to summarize my variables by year
I am new to stata, i need your help, i am trying to summarize all my variables by year (from 2002 to 2015) but i only know how to summarize for one year in particular like this : sum if year ==2002 but...
View ArticleTwoway graph with defined x scale and x label still clusters into small...
Hi there, I am using Stata 14. The title pretty much explains my problem. My code is as follows: twoway (scatter PTemp ABC if wave==5, mlabel(ccode) mcolor(green) mlabcolor(green)) /* */ (scatter PTemp...
View ArticleBeginner's tutorial
Hi all, I'm not sure if this is the correct place to come with a general curiosity about learning STATA, but it's hit me a couple of times over the past few weeks that I'd like to start picking up on...
View Article2 dimensional clustering
Hello, I am following a methodology of one of the papers. According to this I want to estimate OLS regression using 2 dimensional cluster at firm and year level. Now STATA allows me to cluster by only...
View ArticleWorking life tables
Dear Statalist Users, Am currently generating some Labor Statistics report using Stata. Am using Stata 13 on Windows 7 and was inquiring if there is a Stata command that can generate tables of working...
View ArticleWarning Message when trying to implment Propensity Score Matching using PSMATCH2
Dear Statalisters, I keep on getting a warning message when try to implement Propensity score matching using psmatch2 . The following is the error message ***There are observations with identical...
View ArticleAverage of a dummy variable
Hi All, let's say I want to control for gender effect in a given market. Then I set up a binary variable "Male" which takes on value 1 for males and 0 otherwise. Does it make any sense to average the...
View ArticleHow to aggregate an ordinal variable
Dear Stata Forum, I have an ordinal variable on teacher's experience t_exp: 1 2 3 4 5 6 Considering that one school has many teachers, I need to aggregate this variable at school level. Calculating the...
View Articlemetandi and 0 false positives
Dear Statalist, I'm having trouble with metandi from SSC in Stata 13.1. From reading previous posts about this, it seems that the trouble arises from the zero-values in two of the studies. Can I...
View Articlemax(n, . ) = n? Why is that a reasonable behaviour?
For example: . display max(-5, . ) -5 I had assumed if one of the arguments was missing, the max function would also return missing. I would certainly prefer that behavior, at least in my current...
View ArticleGraph: Many Stata graphs in one document (PDF)
Hello, I have done some research on this but could find a concrete solution. I created 4 graphs resulting in 4 single PDF documents. Code: graph bar (max) preUOFtotr (max) inUOFtotr (max)...
View ArticleSimulation question: fit logit model on 90% of sample and test on 10%--how to...
I am trying to run a simulation that fits a logit model on 90% of the sample and then tests it on the remaining 10%. Next, I want to compare the predictions with the actual outcomes. I'm not sure how...
View Articledon't display missing dates in twoway line graph
I am creating a line graph with the variable ratio. I would like my graph to show no line when data for that month is missing. twoway (line ratio date if treated == 1) (line ratio date if treated ==...
View ArticleBest practices for using tempfiles
I was wondering if anyone has a good sense of when it is better (for efficiency and to avoid errors) to use a tempfile vs. a .dta file. If there are resources you can point me to, I would appreciate...
View ArticleMultiple Imputation - Truncreg leads to missing imputations and error
Hi all, I am using multiple imputation on a dataset. Of the ~220 observations, ~40 require imputation for three active variables and a handful of passive variables. I transform these variables to...
View ArticleUsing egen, seq and cond together to create a list of days in each month
I have used expand so that my monthly data is repeated for each day in the given month. So there are 30 repeated observations for September and 31 for October. I would like to create a variable "day"...
View Article