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
generate variable: birth order of children (ages 0 to 17) in householdHello I am using the South African NIDS (National Income Dynamic Survey) wave 1 to wave 5. I have s…
New version of xtdcce2 and xtcd2. New package xtcse2Thanks to Kit Baum a new version of xtdcce2 and xtcd2 is available on SSC. In addition a new program…
Using the foreach commandHello, I am using STATA 15 and wide-format dataset. My aim is to create a new variable (my data is…
Create mean variables of a subgroup for the whole groupDear all, I have data on education attainment per year and state and I want to compute the percenta…
Error message when trying to run MIHi All I don't have too much experience running multiple imputation, but I've been running the foll…
Subscribe to:
Post Comments (Atom)
0 Response to Categorizing values within a single variable via loop
Post a Comment