Hello!
I'm working with a long panel dataset I created that contains a variable for price that is either a number or "." if the product wasn't ordered in that year over 10 years. I want to determine if the fact that a product was ordered (therefore price !=.) in any year between the 10 is correlated with the fact that the product was ordered in the year directly following. For example
product year price
1 1 .
1 2 6
1 3 .
2 1 4
2 2 5
2 3 5
3 1 .
3 2 .
3 3 3
So, I'd like to find out whether being ordered in one year is associated with being ordered the next year. I don't care about a particular year in the 10, so it could be ordered in years 1 and 2 or years 9 and 10 and we'd treat them the same. I also don't care if the product was ordered all of the years or just 3, as long as at least two of the years are consecutive.
I'm not sure how to create a dummy or run a test to see if the probability that price(year n+1) != 0 is associated with price(year n) != 0.
I'm working with a long panel dataset I created that contains a variable for price that is either a number or "." if the product wasn't ordered in that year over 10 years. I want to determine if the fact that a product was ordered (therefore price !=.) in any year between the 10 is correlated with the fact that the product was ordered in the year directly following. For example
product year price
1 1 .
1 2 6
1 3 .
2 1 4
2 2 5
2 3 5
3 1 .
3 2 .
3 3 3
So, I'd like to find out whether being ordered in one year is associated with being ordered the next year. I don't care about a particular year in the 10, so it could be ordered in years 1 and 2 or years 9 and 10 and we'd treat them the same. I also don't care if the product was ordered all of the years or just 3, as long as at least two of the years are consecutive.
I'm not sure how to create a dummy or run a test to see if the probability that price(year n+1) != 0 is associated with price(year n) != 0.
Comment