search for: x0_3

Displaying 1 result from an estimated 1 matches for "x0_3".

Did you mean: x03
2013 Apr 18
1
select and do some calculations/manipulations on certain rows based on conditions in R
...;0 ? ? ?0 ? ? ?0 >> > >I want to create a Y column where Y = 1 if there is an observation for the >same ID right below it and if the Sum of the product of the X's =1 for the >two consecutive observations of the same ID. Y=0 otherwise. > >So for example, ?Y3=1 because Sum(x0_3*x0_4+x1_3*x1_4+...+x15_3*x15_4)=1. > >Can I create program that can do the calculation for Y conditioning on the >ID (i.e. if the ID changes then Y=0) and second conditioning on the sum of >the product of the X's for two consecutive rows if the ID condition is met, >i.e. ID stays...