Treatment Effect in Panel Data with Many Time Periods and Various Treatment...
Dear Statalist, I have a question regarding the identification of a treatment effect in a large panel dataset (800.000 observations), spanning many time periods (monthly values for each pixel for 17...
View ArticleNelson aalen cumulative hazard function
Hi all! Hope you are doing good. I have a question about the Nelson aalen cumulative hazard function. I made a graph about chance of discharge after a certain surgery. As you can see in the exported...
View Articlestandard deviation of a variable
Hi everyone, I have a set data for 10 years. I want to calculate the standard deviation of one variable during year y-2 to y (three years) in Stata 16. Can anybody say which command I have to use?...
View ArticleProducting publication tables for loneway command
Dear Stata users, I computed different intraclass correlations using the loneway command. Which command can I use to produce publication-quality tables for these results? Best, Anne
View ArticleCounting up within ID
Hi everyone, Quick question that may be quite simple to answer but I am having trouble wrapping my head around it. Below I have pasted some example data. We have our participant ID and a variable...
View Articleestimating sample size for cohort studies
I am trying to compute the sample size of a cohort study, pregnant women beyond 20 weeks of gestation with normal blood pressure <130/80 mmhg versus pregnant women beyong 20 weeks of gestation with...
View ArticleHow to organise my data, Im a beginner!
Hi I would like to know what commands to use to organise my data, I currently have a dataset with over 1000 observations and would like to condense it all. My data varies by country and there are many...
View Articlewildcard in string variable
I'm trying to link different business locations to appropriate zip codes using a do-file. I have business names in a name variable and created a new variable to hold the zipcode. Some of the business...
View ArticleHow to import several excels
Dear Statalist, I need to create a database using several (hundreds) of excels like the one I show below. The problem is that I do not know how to do it since the name of each file does not follow a...
View ArticleLimitation of arguments in mata
Cheers together, currently, I am trying to find the internal rate of return or cost of equity for companies over time. So I have many companies and for each company a time series of data. Hence, I am...
View Articlextreg Y X1 X2...Xn i.country, fe- Is it possible/ correct/ feasible?
Declared panel data as xtset year (instead of xtset panelid year) xtset YEAR panel variable: YEAR (balanced) . xtreg logXijt logGDPitGDPjt logPCGDPitPCGDPjt logPCGDPDijt TRGDPit TRGDPjt logDistanceij...
View ArticleDesscriptive Statistics and Matrices
I have the code below. I want to export the result from the code below to excel and also want to add standard deviations for the two groups SCTP and NonSCTP. Code: local vars "HAZ WAZ WHZ Female...
View ArticleCalculate share for similar table values
Dear members, I have a question regarding the correct treatment of data for my master thesis. My table looks as follows: YearCompany ID Female 20073M no 20073M no 20073M yes 20073M no 20073M no 20083M...
View ArticleStata syntax question
I would like to I have 4 sources of data (too big to output using dataex, I have MUCH more than 4 in actuality) date S1_data S2_data S3_data S4_data 1991 2 * 4 5 1992 2 2 * 5 1993 1 1 2 2 With *=...
View ArticleIs "xls2dta" compatible with the option...
Hi, I am using xls2dta (from SSC) to convert all Excel files available in a folder to Stata datasets. I would like to import the first row as variables and I would like to start importing starting from...
View ArticleSvy commands into new variables/box plots/other graphs
I have the following commands which I'm struggling to create into box plots (or into a new variable with which I can then run a graph command). Array Array Array
View ArticleThreshold regression min. observations
Is there a way of overcoming the minimum amount of observations in order to perform a threshold regression? Currently it seems that at least 60 observations are needed in case you want to run a...
View ArticleTrouble with twoway legend
Dear All, I am trying to make a twoway graph using the following command: Code: # delimit ; twoway (lowess `Y' week if race==1 & year==2020, mcolor(black) lwidth(medthick) lcolor(cranberry)...
View ArticleDealing with correlated outcomes variables
Hi, This question is not Stata related, but I hope someone might know the answer. In my study, I've three dependent variables that are mildly correlated. Now the reviewer is asking how did I deal with...
View ArticleHow to use outreg2 to report 2sls results from ivreghdfe?
I need to use outreg2 for reporting both 1st and 2nd stage estimates, as well as 1st stage F-test (weak instrument test) result. This combination seems to be used more nowadays because datasets are...
View Article