Displaying 1 result from an estimated 1 matches for "hometaz".
2012 Apr 03
1
Compare by row and insert previous row value (Or non Time Series Lag)
...s.
For each person in a household I want to create two new variables OrigTAZ
and DestTAZ. It should take the value in TripendTAZ and put that in
DestTAZ. For OrigTAZ it should put value of TripendTAZ from the previous
row. For the first trip of every person in a household (Tripid = 1) the
OrigTAZ = hometaz. For each person in a household, from the second trip
OrigTAZ = TripendTAZ_(n-1) (the value of TripendTAZ from the previous row)
and DestTAZ = TripEndTAZ. The sample input and output data are shown in the
links above. I tried the suggestions shown here: Basic lag in R
vector/dataframe<http://sta...