Hello! I'm somewhat new to Stata so please forgive my lack of knowledge. The project I'm working on involves my PI wanting to assign a points value to different sums of variable values. For example, >150 minutes of exercise is worth 100 points, 120-149 minutes is worth 90 points, etc.
I'm getting stuck in two places: 1) assigning points based on value ranges, and 2) in trying to quantify this based on categorical values across 13 variables.
For #1, my initial thought is to make an index and then add value labels, but I'm not sure if that's the best way to approach this.
For #2, here's an example of the kind of calculation I need to do across variables to approximate the amount of weekly moderate/vigorous physical activity (MVPA):
Based on my skill set, the only way I can think of attempting this is by generating dummy variables where values above a set amount equal 1 and the values below 0 and then adding those together to create the points value (ex. sport1d if sport1 = 0 and leisure4d if leisure4 = 1,2, or .m and then gen MVPA = sport1d + leisure4d + other variables), but that doesn't feel like the best way to approach this.
Any advice is much appreciated!
I'm getting stuck in two places: 1) assigning points based on value ranges, and 2) in trying to quantify this based on categorical values across 13 variables.
For #1, my initial thought is to make an index and then add value labels, but I'm not sure if that's the best way to approach this.
For #2, here's an example of the kind of calculation I need to do across variables to approximate the amount of weekly moderate/vigorous physical activity (MVPA):
If sport1 = 0 and leisure4 =1 or 2 or is missing, then MVPA = 0. If sport2 = 2 or 3, then calculate the expected minutes using sport3 item. If participant also has sport5 = 2 or 3, then add the number of minutes from sport6 to the MVPA total.
Any advice is much appreciated!
Comment