Individual weights by date
Hi, I have monthly stock holdings data for 10 years and on each month I need to calculate weights for each stock. For example on each particular month (01/01/2008 in the example) each stock (in column...
View ArticleHow to change graph formatting
Hi Everyone, I may have an easy question, but I have already spend a lot of time trying to solve it with no success, so I now decided to ask for help, please. I am trying to do plots in STATA (Version...
View ArticleLag variable with gaps in timevar
Hi, I am currently using an unbalanced panel with gaps in the timevar (it's a panel on parties in cabinets, with timevar the start_date of the cabinet recorded in %td, hence I have no consecutive...
View ArticleImporting and converting multiple excel files
Hi everyone, I am facing quite a significant issue with cleaning some data. As such, I would appreciate any advice or guidance that anyone can offer. I thank you in advance for your time. I have...
View ArticleVariance-covariance matrix after margins and suest
Hello. I would like to to obtain the combined variance-covariance matrix from a linear regression and a probit model. However, for the latter, i would like this to refer to the marginal effect and not...
View ArticleReplacing certain characters in a string
Dear all I want to substitute every second character of a string (e.g. acustomstring) with a character from another string (hello). The final string should look like this: ahuetlmltoing Any ideas how...
View ArticleGenerate line graphs titles using loop
Hello Statalist members, I am trying to generate a line graph for each of the countries in my dataset and add the average for the rest of the countries. However, every time try to get the title and...
View ArticleCreating calendar year intervals using stsplit
I'm trying to stsplit my event data so that I get yearly intervals that can be used for logging time-varying dummy variables (like whether there is divided government in that particular year under...
View Articleregression with scfcombo
I am running some regressions starting from data coming from the Survey of Consumer Finances. The regressions are run using a (slightly modified) version of user written command scfcombo provided by...
View ArticleDiff-in-diff for matched groups
Dear Statalist community, for a research project I seek to conduct a matched diff-in-diff with stata in order to identify the impact of regulation on a treatment group by comparing it to a matched...
View ArticleMerging with many variables
Hello, I have one file that records all the industrial codes for a firm in separate variables. For example id indgroup1 indgroup2 ....... indgroup12 1 3111 -------3112-------------- 3113 2 4221...
View ArticlePosting panel based summary stats to latex
Hi I want to post summary statistics into latex in following manner Firm var1 var2 mean sd mean sd 1 2 3 4 i used following codes: by Firm: eststo: quietly estpost summarize var1 var2, listwise...
View Articleadjust column width in Excel - putexcel
Hello everyone, I would like to increase the column width in Excel when exporting results via "putexcel". I haven't found this in the options. A little piece of code: Code: sysuse auto, clear rename...
View Articlextreg fixed effects first difference or normal OLS reg with deltas
Hello everyone! I am doing a wage elasticity model, to find out if the increase in the minumum legal wage has an impact in the real wage of people earning around the minimun wage in t-1. I have a 6...
View ArticleObtaining labels - number and text
Hi everyone Suppose in some earlier code, someone else does this: la de clb 1"mouth" 2"Salivary gland" 3"Nasopharynx" ... N "This is label N" Now assume I am given this list of labels. If I say label...
View ArticleRunning error correction model on panel data (two-step)
Hi all, I am using the user written command (xtpmg) to run ecm on my panel data (N=60, T=20) to estimate the relationship between trade volume and real exchange rate. For xtpmg, it is very easy and...
View ArticleRestricting y-axis with fpfit
Dear Statalisters, I've encountered a problem where I'm trying to restrict the y axis scale to show particular range that I want. For example, I would like to restrict y-axis to be in between 15 and...
View ArticleMultiple observations and individuals in database for merge
Hey everyone ! I'm attempting to merge panel surveys database ( LSMS ). The problem I encounter is that in some database I have more than one observations per individual. exemple I'm studying the crop...
View Articleegrenger ecm coefficient interpretation
This is a result i got for egranger two tep error correction model estimation. are these short term coefficients? where are the long term coefficient?
View ArticleLoop over variable names and macro
Hello everyone! can anyone please help me create a loop for this code? My idea was to use a macro for the new var name and ylist for the other variable, of which the second part is a non-sequential...
View Article