Announcement

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

  • Create a new variable that is the absolute difference between the midpoints of two other variables

    Hello,

    I want to create a variable that calculates the absolute difference between the midpoints of two continuous variables var1 var2. I need the new variable to be categorised into 1=<1 2=≥1.

    Can anyone help?

    Many thanks.

  • #2
    I'm not certain of your intended reference for "midpoint" [ (max - min)/2 ?], but regardless, what you describe sounds like a scalar constant rather than a variable. That is, the midpoint of var1 is a single number, as is the midpoint for var2. The difference between two single numbers is also one number, i.e., not a list of values. Perhaps this single number is what you want? Also, I would wonder why you would want to categorize that value, since that discards information. Perhaps there is some other way to accomplish the goal you have in mind for this calculation.

    Comment


    • #3
      Yes I think I have confused myself, apologies. I have asked two separate questions but have now managed to answer it (calculate the two medians) and then recode a variable.

      Comment

      Working...
      X