set more off in do file
Using any recent version of Stata for Windows, I find that "set more off" has no effect when I run it from a do file. It only does its thing if I type it on the command line. Is this a known issue? Any...
View ArticleSum across observations
I have a dataset with regions and an id for a specific sector. As an example I have region id x1 1 2361 6 1 2362 10 1 2363 11 1 2364 4 2 2361 8 2 2362 23 2 2363 6 2 2364 2 I need to sum 2361+2362 for...
View Articlextset error r(451) in panel data
Hi all, First of all, this is my first ever post on Statalist, so I apologize if I miss anything in my post! On to my problem. I am doing a research paper on microfinance and macroeconomics and the...
View ArticleRelationship between Instrumental variable regression and structural equation...
Dear all I would like to know the relationship between instrumental variable regression and structural equation modelling (SEM). I need to transform a SEM model into iv regression model to endogeneity...
View Articleivreg2h, saving the generated instruments
Dear Users, Can someone supply me with an example using gen=1 option in a command line? Note: That option should leave behind the generated instruments from the ivreg2h regression, which otherwise are...
View ArticleArellano-Bond & Difference-in-Difference
Hello. I am not sure whether I can use Arellano-Bond method together with DiD specification. Is it possible? I think it can be done, but does it make sense? Please give some comments!! The sample...
View ArticleHow to randomly select rows or cols of a matrix in Mata?
Hi all, I would like to find a function like the Matlab function randperm() in Mata, which randomly selects rows of a matrix and reorder these selected rows. sample() or bsample() are for Stata...
View ArticleCombining two datasets with non unique identifiers
Dear Members, I have a problem that pertains to combining two datasets that do not have a unique identifier. My datasets contains information on around 250 firms, their competitors and the competitors’...
View ArticleReplacing previous value for a variable when missing in a pannel
I have a pannel dataset, where each line corresponds to a hospital in a given month/year. I have variable npar with the number of procedures performed. I would like to replicate the previous month...
View ArticleAssigning values by "margin at" with covariates
Hello All, Is there any way that I can assign a set of values to a covariate with margins command by using a variable already defined in the data? More specifically I am running the following command:...
View ArticleOutreg2 for corrrelation tables
Hi! I was wondering whether there is a possibility to use outreg2 in order to output a correlation table? Kind regards, Astrid
View ArticleContinuous Integration
I was curious about how to possibly use continuous integration (where a server automatically runs tests on any changes to a code repository) with Stata. Services like Travis (for Linux) and Appveyor...
View Articlemonthly format
How can I have this variable below displayed in a monthy format? Thanks! : anomes 199301 199302 199303 199304 199305 199306 199307 199308 199309 199310 199311 199312 199401 199402 199403 199404 199405...
View ArticleGetting obs from a graph
I got a graph from stata in which my x-axis corresponds to month/year. I have some discontinuities for which I would like to know the exact month/year. Is it possible somehow? I take a lot of time...
View ArticleJava Dynamic Plugin Loader (DPL): New on SSC
The Java Dynamic Plugin Loader (DPL) is now available for download from SSC under its package name jc: http://econpapers.repec.org/software...de/S458049.htm (thanks to Kit Baum). As usual, ssc install...
View ArticleMerge and sum simultaneously
Hello, I have two data sets that I would like to merge, but I would like a summation (from Dataset 2 below) to occur before the actual merger, and that value be added on (to Dataset 1). I have attached...
View Article.sav files
Hi- I'm trying to import .sav files into Stata. Could anyone please advise on the commands I would need to open those in Stata? Thanks, Ghia
View Articlefixed effects model with dummies and sub-sample period
Dear all, I am new to stata so I do lack experience and hope to receive your help. I try to run the fixed effects model with binary industry and year dummies. My dependent variable is firm leverage and...
View Articleprobit selection with cross-sectional data
I have survey data and plan to run 3 regressions. In each regression the dependent variable is (0/1). One of these dependent variables - say Var DEE, is conditional on another variable say Var EMM....
View ArticleGenerating differences from a constant array of values in panel data
Hello all. Assume that we have a panel database of the following form: Country Year Value Diff A 1 XA1 XA1 - XC1 A 2 XA2 XA2 - XC2 A 3 XA3 XA3 - XC3 A 4 XA4 XA4 - XC4 B 1 XB1 XB1 - XC1 B 2 XB2 XB2 -...
View Article