Hi, all.
I have a data set with variable "town_id" indicating town id (such as 160, 155, 178, etc.).
I want to create a set...
Announcement
Collapse
No announcement yet.
196 results in 0.0121 seconds.
foreach
x
You can also choose from the popular tags.

How to rename dummy variables based on category names?
 6 posts

Problem with merging multiple csv files using merge 1:1
Hi,
I am a beginner in Stata (using Stata 16) and after going through many of the posts regarding merging multiple files from a folder, I...Last edited by Shreya Dutt; 30 Dec 2019, 16:01.
 8 posts

Nader Mehri started a topic replacing values of a newly generated variable by the values of previous variables using "foreach var of varlist"in Generalreplacing values of a newly generated variable by the values of previous variables using "foreach var of varlist"
Hi everyone,
Using the below codes, I am trying to generate a new variable (long_X6 to long_X13) and replace its values by the values of the preceding...
 5 posts

looping regressions with different interaction terms each time
Dear all,
I am still a Stata novice and first post on statalist, I have tried to follow all rules, but please bear with me if I got something wrong...:)...
 3 posts

HP filter in panel data
Hello,
I am working with panel data and I'd like to apply the Hodrick Prescott filter on a variable (v2x_polyarchy) for each country....Last edited by Angel Muniz; 06 Dec 2019, 12:15.
 4 posts

foreach, loops
Hi
I want to run the below code, but can't get it right.
As I have a panel data with many IDs and months. I want to run the univariate...Last edited by Aamina Khurraa; 06 Nov 2019, 12:08.
 8 posts

GARCH regressions for panels using foreach
Hi,
1. I want to estimate my risk measures using bivariate diagonal GARCH (1,1) model (DVECH) for each of my 360 panels in the data(from...Last edited by Aamina Khurraa; 04 Nov 2019, 10:52.
 2 posts

Mahmoodur Rahman started a topic expand 2x2 table by merging additional variables as columns with tabout or putexcelin Generalexpand 2x2 table by merging additional variables as columns with tabout or putexcel
Hi,
I have a data that looks like this:
Code:* Example generated by dataex. To install: ssc install dataex clear
 3 posts

Listing a series of 10 max and 10 min values of a variable in stata
Hi
I want to extract a list of my panel IDs named as "FI" and months/years named as "Time_period" having the 10 maximum...
 7 posts

Help with Looping
Good day, Statalist,
Please, I am carrying out an analysis for 5 waves of a survey data. Hence I would want to replicate the commands for...
 3 posts

sam khanna started a topic Running multiple regression models on different combinations of explanatory variablesin GeneralRunning multiple regression models on different combinations of explanatory variables
Hi,
Before I post my question, I would like to mention that I already looked through the forums here on using for loops to run multiple regression...
 6 posts

Weighted returns for the entire sector(all panels) in a panel study
Hi
I am stuck in understanding how to generate the sector_return (SR) using the average of returns (R) weighted by the Lagged Assets (LAit)...
 3 posts

Aditi Roy started a topic random treatment,50 times loop and store the estimate with p value for the variable of interest (POST) and display.in Generalrandom treatment,50 times loop and store the estimate with p value for the variable of interest (POST) and display.
Hi,
I want to randomly assign treatment and run the same regression in the loop for 50 times and then I want to see how many times my variable...
 4 posts

Christophre Dennen started a topic Using a nested foreach loop to merge and then append multiple files from multiple folders into one dataset.in GeneralUsing a nested foreach loop to merge and then append multiple files from multiple folders into one dataset.
Essentially, I have a few thousand text files, for which I have a nested foreach loop to import them to .dta files. Here is that code:
foreach...
 15 posts

Writing nested foreach loop to convert many .txt files to .dta
I'm trying to write a foreach loop to convert a few hundred text files, divided up into many folders. So far I have this:
foreach...
 3 posts