Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Assigning "points" to multiple variables?

    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):
    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.
    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!

  • #2
    Welcome to the Stata Forum. For such issues as yours it is always a good idea to present a small data example (please read the Stata Forum FAQ, especially #12). And by the way: Enclosing Stata code (as well as output) in code tags helps reading (and copying), this is explained in the FAQ, as well.

    Comment


    • #3
      Welcome to Stata and welcome to the forum! Leaving the technical aspect of this question aside, I wonder about validity. Is there any established scheme or procedure that tells you how many points something is "worth"? Currently this appears arbitrary. I understand that you have multiple measures of activity and want to build a single variable out of it. There are many possible solutions to this. As Prof. Enzmann has stated before, if we know more about the types of variables you are going to use, this can make things much clearer. Some variables are, apparently, metric (activity time in minutes). You could coarsen this variable into quantiles, quintiles or whatever. You could also use gsem and combine variables of different scaling into a single latent measurement (e.g. metric, ordinal, or binary). This gives a final variable where higher values represent "more training". Such a variable can easily be used in subsequent analyses, such as regression or prediction models.
      Best wishes

      Stata 18.0 MP | ORCID | Google Scholar

      Comment

      Working...
      X