I'm having trouble finding guidance on this. I want to create a dataset that has a variable called "location" and contains the values 1, 3, 4, 6, 7 with another variable called "action" that contains values1, 2, 3, 4, 5. I want my dataset to contain every combination of these, but I do not want to input manually. Any ideas?
location action
1 1
1 2
1 3
1 4
1 5
3 1
3 2
...
Related Posts with Create Dataset in Stata using a Loop
How can I modify the variable label of a table output?Hi masters, I use table command to create a table, but I'm not satisfied with the table's output. T…
using stabilized weights and teffects RAIm using manually calculated IPW, stabilized by prevalence of exposure (stabIPW) to achieve adequate…
Reverse Command Lookup for .gph File?Hi Everyone, I'm new to Stata, so apologies for the newbie question here. I'm wondering if there's …
Summation of several rows using the if conditionHello, I want to write a code that creates a value which is the summation of several rows. I have n…
fillin or expand?Dear All, The question is related to a previous post here. Now, the expanded data is Code: * Exampl…
Subscribe to:
Post Comments (Atom)
0 Response to Create Dataset in Stata using a Loop
Post a Comment