Scatterplot question
Hello all, I'd like to do something on a scatterplot, but I'm not sure if it is possible, since the "x" variable in this case is not numeric. Here is a snippet of my data Code: Sector HS SS US FBT 10 8...
View ArticleEndogenous Selection/Treatment Models
Hi, all I am estimating an endogenous selection models. The model is estimated using Stata command " etreg", which I believe implements a two-stage Heckman procedure. I understand that a Heckman...
View ArticleTransformation of variable to log in panel data
I want to transform a variable in my panel data set to a log variable. The common thing to do is gen logvar = log(var). However, I am working with panel data and am not sure if this is the right...
View Articlehow to change regression output from scientific notation to decimal notation
Hi everyone, when I run a regression (xtreg - stata 14) it produces the coefficient estimates in scientific notation (because they are really small), i want it to be in decimal notation. This is...
View ArticleIf in foreach
Good day all, I have three files named A B C and four variables named time, timeA, timeB and timeC. I regress variables X Y and Z for file A with time variable timeA, X Y and Z for file B with time...
View ArticleInterpret eydx, eyex in margins, Stata
Suppose the regression is y=beta_0+beta_1*x + epsilon. I obtain the eydx=.295 by magins eydx(x) command. What does Stata really do? Does Stata actually regress logy on x? If so, can I interpret the...
View ArticleManually calculating predictions after estimating "nbreg"...
Dear all, I have estimated a negative binomial model with "linear spline terms" for one predictor. Code: mkspline aadt1 9 aadt2 22 aadt3 55 aadt4 = total_aadt_1000s, displayknots //mkspline sl1 1 sl2 =...
View Articlehow to Generate 5 digit id
Dear all i had some id like 1 to 2400 and i need to make them all 5 digit ID like id 1 will be 10001, id 5 will be 10005 and 1226 will be 11226, 2120will be 12120 regards Raeed
View Articlecgmreg and cgmwildboot
I have relatively small data (1500 observations) and number of clusters is 6. I understand that I should do cgmwildboot.....but while I get an output when I do cgmreg, with the same variables but...
View ArticleCreating a new composite categorical variable from the set of categorical...
Hello! I would appreciate your advice on creating a new categorical variable to sum the responses from the existing variables. I use the Stata IC 11 for Windows. Have tried the egen command with...
View ArticleTime series table - in first columns contain dates and first row contain...
I am courently working with a time series table as the attached one. The Table expalein the variation of one variable in diffrent dates for multi companies. I find difficulties to matin the label of...
View Articledownloading files using copy, invalid file specification error
Dear all, I'm trying to write a loop downloading a series of zip files online. Based on what I read I thought that "copy" had this capability. However each of my efforts is met with the "invalid file...
View ArticleAutomating an stcox command in a loop and outputting the result to another file.
I am fairly new to Stata. I have survival data for 60 patients. I have asked a large number of physicians to evaluate each of the patients and say whether they think the patient has a killer disease -...
View ArticleExporting Estimates to word file after running SQREG command
Hi. I would like to know if there is any way to export quantile-wise estimates to a word document after performing SQREG command. For example, the one given below: sqreg y x1 x2 x3, quantiles (.05 .10...
View Articlerun several regressions with same group of controls
Hi guys, I'm using stata 13 with OS Windows 10. I want to run several regressions using the same controls for different dependent variables or with the same dependent variable but including or changing...
View ArticleFor Loop for iterating through multiple .dta files
Hello, I'm a student and new STATA user. I have 30 or so separate STATA .dta data files that are identically formatted. I hope to sum the values of just a single column in each data file ("Value" is...
View ArticleCalculate distance for many observations
Hello, I have 521 gas stations in one dataset with their longitudes and lattitudes. I want to caculate the distances between these so I can have the smallest/longest distances. Also separate these...
View Article2SLS regression question
Hello all. I am running 2SLS regression to control for endogeneity. I have identified an instrument. My model looks like as follows: ivregress 2sls y x2 x3 (x1 = instrument1) I have following two...
View ArticleGraph export PDF with right-to-left font
There is a problem to export the right-to-left font as PDF in Stata graphs. This is a sample graph exported in PNG which is fine. Array Here you can see its exported version in PDF format...
View ArticleTabstat to Excel
Good day all, I have a table of summary statistics which I would like exported in the exact same form as shown below but I can't seem to manage with putexcel. Does anyone know how I can best do this?...
View Article