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.
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.

Comment