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...
Announcement
Collapse
No announcement yet.
182 results in 0.0140 seconds.
foreach
x
You can also choose from the popular tags.

looping isuues
Hi Everyone,
I have a dataset something like:
A_count B_count S_count.......Z_count A_percentage B_percentage S_percentage............Z_percentage...Last edited by Sitaram Sahoo; 29 Aug 2019, 07:27.
 14 posts

adding 100 rows in a matrix from different 100 matrices
Hello,
I am trying to make a column matrix (100X1) using different 100 matrices? What is the best possible way to do it?
If I write...
 5 posts

MHTEXP*Theorem 3.1 Adjusted Values Extraction
Hi everyone,
I have been trying to create a matrix of List's MHT adjusted pvalues that I get after running the mhtexp command but I can't...
 1 post

Renaming multiple variables in a loop
Hi,
How can I rename multiple variables without having to manually rename every single one of them using a loop? I am using the following...
 5 posts

Fabio Martinenghi started a topic Loop going through distinct values of variable1 and replacing distinct string in variable2 per each iterationin GeneralLoop going through distinct values of variable1 and replacing distinct string in variable2 per each iteration
Hi all,
I have this kind of reproducible code:
Code:clear set obs 10 gen str names = "" gen num = _n
 3 posts

Abdul Habib Yousufzai started a topic How can I export both variable label and variable name to excel from statain GeneralHow can I export both variable label and variable name to excel from stata
Hi everyone,
I would like to export both variable label and variable name with data to excel from stata but I cannot, could you please kindly help...Last edited by Abdul Habib Yousufzai; 17 Aug 2019, 21:30.
 3 posts

Dynamically rename variable (using "word()")
I have a dataset that looks as follows:
Code:clear input str7 index int data "EOSQ041" 42 "EOSQ041"
 5 posts

Program + Foreach
Hi there,
I am a new user here in this forum, so this is my first thread. My question:
I am trying to run the following code...Last edited by Sebastian Faundez; 07 Aug 2019, 11:07.
 3 posts

Get no. of times for loop has iterated
Is there a way that I can access the number of times a given loop is on. For example,
Code:sysuse auto foreach var in weight price
Last edited by Jack Reimer; 07 Aug 2019, 07:59.
 2 posts

Identifying coworkers in spell data
I have a dataset of worker employment spells, and I would like a general way to identify an individual's coworkers when the individual starts a job....
 3 posts

Using global variables within forvalue loops
I am trying to design a for loop that can be easily adapted for the input values but cannot work out a way to use global variables within my for loop....
 4 posts

Li Huang started a topic Create list of variables w/ different redaction patterns & dropping specific redacted variables based on other nonredacted varsin GeneralCreate list of variables w/ different redaction patterns & dropping specific redacted variables based on other nonredacted vars
Hello,
disclaimer: dataset contains PHI therefore I have recreated a replica with substituted variable names and values that are functionally...
 5 posts

April Yu started a topic How to create a loop for doing regression with multiple variables and storing each estimate with a sequential labelin GeneralHow to create a loop for doing regression with multiple variables and storing each estimate with a sequential label
Hi I'm new to Stata and have a question about using foreach for regression.
I have A as a dependent variable, B as an independent variable,...
 2 posts

Combinations of variables
Hi everyone,
I am a new Stata user and have a problem with commands.
I am working with a dataset of deaths caused by natural disasters (floods,...Last edited by Fernando Gonzalez; 18 Jun 2019, 11:50.
 3 posts