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.
121 results in 0.0094 seconds.
foreach
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

Categorising numerous variables with different ranges
Hi all,
I have a range of test results & need to categorise them as low, normal, high, according to their normal ranges. I am looking...
 5 posts

Local variables with mutiple loops
Hello everyone,
I am currently struggling with a foreach command. I would like to make several regression with different variables, where...
 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

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 over variables to see who left the firm
Dear all,
I'm struggling with creating a code that loops over variables values (row) to create a dummy variable to indicate whether a person...
 4 posts

Nomin Byambaa started a topic how to rename variable name through all .dta files using loop function?in Generalhow to rename variable name through all .dta files using loop function?
So I have 20 .dta files on test score of 912 graders during years 20082012 (4*5=20). I want to rename v1 and v2 to id and score. Followings are what...
 3 posts

Regression by stocks and output variables and tvalues
Hi all,
I am running simple timeseries regression to exam stock liquidity in financial market. This is a panel dataset and each stock has...
 10 posts

Replace values for missing data
Hi everyone. It is my first time I use this forum.
I am working on a dataset and I have a question. I would like to replace missing values with...
 3 posts

Nested foreach loops
Dear Statalists,
I am fairly new to Stata and am facing some issues regarding nested foreach loops.
My aim is to calculate...
 9 posts

Panel data deleting missing observations
For each country and each indicator, I want to compute the simple average across time period. But before I do this I have to clean data. This process...
 2 posts

Procedure to group variable with minimum number of observations
Dear Statalists,
I have a discrete variable, that takes integer values larger or equal to zero. I want to cut the values into categories...
 3 posts

Foreach question
Hi, I have the following data structure (although more data points). How can I instruct Stata to replace x with 1 for wave 2, if the data has the...
 5 posts