Hello,
I have two datasets. I have a Maindata which I would like to split into around 40 datasets based on a criteria in a separate dataset....
Announcement
Collapse
No announcement yet.
188 results in 0.0076 seconds.
loop
x
You can also choose from the popular tags.

For Loop Syntax Error  Subsetting Data
Last edited by Minnie Smith; Yesterday, 11:38.
 3 posts

For Loop Syntax Error
Hello,
I am trying to use a basic for loop but keep getting the error 'Invalid Syntax' which I cannot figure out. The variable id has been...
 3 posts

Foreach loop  egen function
At present, I need to generate a new variable for each value in the variable called "setting" (Int 112), which would be the sum of those values...Last edited by Tim Chambers NZ; 18 Jun 2018, 16:22.
 3 posts

Nested foreach i of num loops and output files
Hi STATA forums,
I have a somewhat simple nested foreach loop. It is importing JSON files, reformatting them, and attempting to save as...Last edited by Jeffery Sauer; 15 Jun 2018, 16:01.
 3 posts

Gerwin Pieter Colje started a topic Copy observation to blank observations within specified time framein GeneralCopy observation to blank observations within specified time frame
Dear all,
I am looking for a solution to copy an announcement date to all dates within a specified time frame. This time frame ranges from...
 2 posts

Loop or tool to replace missing components of an aggregate
I have an aggregate X that consists of components A + B + C + ...
Suppose now that C is missing. If all others are available, I can use X  A ...
 3 posts

Variable order loop
Hi all, I have a data set with 280 variables. All but ~35 of them are repeats of question of variables ordered by event. The event is numbered (event1,...
 4 posts

loop with "recursive" variable definition
Hi everyone,
I'm quite new to Stata so apologies if this question is "basic".
I have a panel with the following variables:...
 5 posts

Looping Through Wide Data to Create Indicators
Hi All,
This question will probably seem simply inefficient, but it's necessary for an analysis I'm doing. I had to reshape data from long...Last edited by Kelly McKnight; 03 Jun 2018, 22:15.
 2 posts

Why If Else does not work?
I have some codes as follows (as you may know this is the result after many previous helps from forum):
Code:clear import excel "path_letter.xls",
 4 posts

Will Stata automatically set the range of data when running loop?
When I loop over many Excel sheets, I use "import" command to input the data. However, because each sheet has different number of rows, is it...
 5 posts

Sort country identifier according to ranking
Dear all,
I have the following data. I want to replace the entries of rank_y_628 by the country identifiers (icode_imf) according to the ranking...Last edited by Florian Schoner; 28 May 2018, 02:19.
 1 post

Giang Dao started a topic How to use loop to compute total of observations in the same group across alphabet variablesin GeneralHow to use loop to compute total of observations in the same group across alphabet variables
I want to create columns that sum up values along each column of the table according to their Invested type (EUR/CHF/USD/...). I was about to use the...
 4 posts

Matilde Biil started a topic Choose independent variables based on their correlation with the dependent variablein GeneralChoose independent variables based on their correlation with the dependent variable
Hi
I am trying to regress a y variable with a lot of x variables but I only want to include variables where the correlation between y and...Last edited by Matilde Biil; 22 May 2018, 08:57.
 4 posts

How to get the remaining letters of a variable
I have some variables named "x2000" "yz2001"... I want to transform them to "2000x", "2001yz"...
...
 3 posts