stata2r / stata2r.github.io

Stata -> R guide
https://stata2r.github.io
88 stars 19 forks source link

Error on R side in leads and lags #27

Closed simon-lowe closed 2 years ago

simon-lowe commented 2 years ago

Hi,

Thanks a lot for this (even though I'm an R user)! I think there is an error in the leads and lag sections for R, you inverted the leads and lags.

Thanks, Simon

simon-lowe commented 2 years ago

Second tiny thing (and I'm not sure whether this is a version problem, though I think I have the latest version of data.table): dat[, index_within_carrier := .I, by = carrier] For me this does not create an index by group.

Thanks again, Simon

grantmcdermott commented 2 years ago

Both are errors and should be corrected now. Thanks for flagging @simon-lowe!

simon-lowe commented 2 years ago

Thanks a lot for all your amazing work!