Good evening,
I am new to Stata and have been researching and consulting the help command on a problem with no luck.
I am trying to create a new variable "hour_groups" that categorizes the "hour" variable into 4 groups, e.g. 0 to 6 (a.m.) is assigned the number 1, 7 to 12 is assigned 2 and so on. I'm trying the foreach and and forvalues command. Any help is appreciated. Is it possible to generate a new variable while categorizing in the same command?
Related Posts with Categorizing values within a single variable via loop
Setting up variables for a Venn DiagramHi- trying to set up variables for a Venn Diagram; essentially I need a count across three categorie…
Merging multiple panel data filesHello all, I have individual panel data and two state-level panels I seek to merge together. I have…
Panel data- setting id using group variableI am beginner in panel data. Please pardon if its a basic question. If I have 100 countries for whic…
What does "log using 'filename', replace" do? To create logs or to replace the existing ones?Dumb question, but in my professor's notes it's to "create log in current folder." But isn't it foll…
Movestay questionHi there, I am using movestay to examine the impact of innovation (Innovation) on capital structure…
Subscribe to:
Post Comments (Atom)
0 Response to Categorizing values within a single variable via loop
Post a Comment