WMW GenOR
Hi, I am assessing the effect of thrombolytic treatment for stroke comparing two different stroke populations where both groups received treatment. The outcome measure is an ordinal variable (mRS)...
View Articlesubinstr local does not work
Why does this code not work to remove X from the list? The variable is still in the list.. Code: ds, has(type numeric) local r(varlist) : subinstr local r(varlist) "X" "", all foreach var of varlist...
View ArticleSocio demographic controls
Hello, I am regressing conservative party contact on the likelihood to vote conservative and using individual level panel data. I'm starting with pooled OLS and building up to individual fixed effects...
View Articlehow to use weights developed via two-stage probability and poststratification
How do I weight my data? I'm using an available data set with two weight variables: basewgt and finalwgt. Basewgt corrects for unequal probabilities and has values in the thousands: 2731.33, 1736.13...
View ArticleRearranging Columns from Multiple-Equation Model using esttab
I'm generating an output summary table from one probit and one ivprobit estimation, including the first-stage results from the ivprobit estimation. By default, esttab outputs the first-stage column to...
View ArticleHow to adapt the y-axis in a two-way graph?
Dear Stata Users, I am facing some difficulties when changing the range of values that should be displayed on the y-axis in my two-way plot. I want the y-axis to range from -0.2 to 0.2 but more zoomed...
View ArticleReplacing a value in one column with a value in another column if that value...
Hello, I am a beginner in Stata. I am trying to replace (or generate in a new column) a value in column 1 with the value for that same observation in another column. I have tried the command replace...
View ArticleHelp: how to combine information from two datasets?
Hi all, I was wondering if someone could help me with this problem: I need to combine information of two datasets mentioned below. So for example, in the dataset on NTM's there is this observation:...
View Articleexport multiple regression results.
Hello to all, I'm creating this topic because I haven't found my answer on it. I am currently stuck, I have just spent several days on my problem without success. I would like to export my results in...
View ArticleHow to write/ display label text instead of number
Hi all, I want to write some text to a text file that contains the label text, but I keep getting a numeric value back. Grateful to anyone who could help or provide some insights. A simplified version...
View Articlejwdid, estat event and exporting tables
Dear Stata users, I am using jwdid for repeated cross-section data and I need help with extracting the results to tex file. Here is my command and output: Code: jwdid l_foodexp, ivar(province)...
View ArticleByHist - to create a histogram
I would like to plot a histogram using weights. Just like Ariels' paper here. Graphical displays for assessing covariate balance in matching studies (lindenconsulting.org) He actually recommends using...
View Articleparentheses do not balance
Hello, I am trying to do a graph with confidence intervals. I got the following code: twoway (rcap low high fecha if Tratamiento == 1 & No_Paga_IVA == 0) /// (rcap low high fecha if Tratamiento ==...
View ArticleWhat is the meaning of p-value for trends?
Hello, I am working on an assignment that asks for the interpretation of a ptrend value in a regression model. I am hoping someone can explain the meaning of p-value for trends. Thanks!
View ArticleObtaining time series graphs
Hey guys, sorry if this is long, but I'm entirely new to stata. I also apologise if I don't use the right terminology or formatting for this post. I'm working with Labour force surveys for 2019-2022...
View ArticleLoop to append files using two macros
Hi, I'm appending separate country files in to one (US_1.dta, US_2.dta.........GB_1.dta,GB_2.dta). All of the files are stored in the same folder. The code I'm using currently to do this is . Code: use...
View Articlepenalized regression model (LASSO regression)
Hello, I am replicating a stufy that uses a penalized regression model (LASSO regression). I am imposing that certain controls must always be kept as the independent variables of the model (Lev Loss...
View ArticleStacking 5 columns under 5 other columns, 200 times
I have a dataset with the following structure: year Company 1 data A Company 1 data B Company 1 data C Company 2 data A Company 2 data B Company 2 data C Company 3 data A Company 3 data B ... 1 2 3 ......
View Articlegenerating a variable for counting average entries
Hi all, I had a small coding problem and was wondering if you can help me with it. I have the following data for workers and the entries they make. Each date is an entry Worker date worker_name1...
View Articlethe omitted variable problem that arises when including both a predictor...
I am working on the environmental Kuznets curve. With N:9 T:26, my dependent variable is lnco2 and my independent variables are GDP, GDP^2, and FDI (foreign direct investment). When I run a simple...
View Article