Hi everyone,
I'm trying to massproduce reports based on statistical output from using the putdocx command. Is there a way to use the putdocx...
Announcement
Collapse
No announcement yet.
136 results in 0.0125 seconds.
foreach
x
You can also choose from the popular tags.

Conditional dynamic text using putdocx
Last edited by June Parr; 10 Nov 2018, 05:23.
 3 posts

egen's anycount() incorrectly counting
I have a list of 23 variables that can have a value between 1 and 12. I would like to get the number of variables in a given row that have a certain value....
 8 posts

Using filelist to import and append several tsv files
I would like to import and then append a multitude of tsv files which are located within different subfolders of my main folder. I am trying to replicate...
 2 posts

Group values of a string variable by keywords
Dear Statalist,
I am struggling with a specific task of simplifying my data.
Basically, I am working with diseases and for my...
 4 posts

if <variable> is in <varlist>...
Hi,
I would like to write some code that runs through a list of variables using foreach and, if that variable appears in a previously specified...
 6 posts

foreach and recoding/generate new variables
Hello all,
I would like to create the macro for the repetitive work.
The following is the repetitive work:
Code:recode dr (1=2
Last edited by Yoosun Chu; 24 Sep 2018, 17:50.
 2 posts

Jim Steiner started a topic Replace dummy variable value when a variable has a numeric value somewhere in the list of all of another variable's valuesin GeneralReplace dummy variable value when a variable has a numeric value somewhere in the list of all of another variable's values
Using STATA 15.1 Windows 10
Hi All, firsttime poster.
I am attempting to replace a dummy variable (y_dummy) equal to 1 when...
 3 posts

Labeling variables with a for loop
I have a bunch of serially placed variables: Q49_1_aQ49_104_h. I am trying to label them such that the labels become something like the following:...Last edited by Taz Raihan; 21 Sep 2018, 14:49.
 3 posts

Renaming variables with a for loop
Suppose I have 8 variables named: DY, DZ, EA, EB, EC, ED, EE, EF.
I want them to be renamed to the followings:
Apple_total_harvest...Last edited by Taz Raihan; 20 Sep 2018, 15:57.
 8 posts

Reshape long for many similarly labeled variables
I have list of ~2,000 variables that I am trying to reshape from wide to long. The variables are distinguished by three separate numbers clarified below...
 4 posts

macro within macro using foreach and forvals
Dear Statalist,
I would like to use a forvalues loop where one of the numerics are derived from a macro. In turn, that macro is itself derived...Last edited by Linus Andersson; 21 Aug 2018, 01:47.
 3 posts

Summing across variables
I have data with 160 countries and 6 sectors as variable names. I tried to use the foreach command to sum the six sectors of each country so I get 160...
 17 posts

Alexandre Loures started a topic Syntax to multiply the vector of the regressors by the estimated coefficient (omitted because of collinearity)in GeneralSyntax to multiply the vector of the regressors by the estimated coefficient (omitted because of collinearity)
I have the following syntax to multiply each vector (independent variable) by the coefficient of the estimation:
forvalues i = 1(1)103 {...
 2 posts

Computing bilateral flow using function
Dear all,
This is not a statistical question (I apologize) but one for a function.
I have data for origin and destination (data...
 7 posts

How to move the prefix as the suffix?
I would like to move the prefixes to the suffixes. For example, if a variable is called tx_abc, I would like to change it as "abc_tx". The "x"...
 6 posts