Announcement

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

  • Finding difference

    Hi,
    I have the following structure:

    product_id week price
    55 1 10
    55 2 12
    55 3 11


    Task: Create two indicators (called "increased" and "decreased") that will be 1 if price has increased from previous week(week 2 - week 1 having a positive sign) and 0 otherwise for variable "increased". Same logic for variable "decreased" but with minus sign after subtraction(week 3 - week 2).

    Thank you.

  • #2
    Stefan:
    is task=https://www.statalist.org/forums/help#adviceextras #4?
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment

    Working...
    X