Description Usage Arguments Value Author(s) Examples
Suppose you have longitudinal response y and it's subject id. This function generates lagged y for each subject.
1 |
id |
subject id |
y |
response |
lag |
how many lags for y |
na |
logical; whether remain NAs in the response when lag >1. Default to FALSE and output 0s instead of NAs. |
return a vector of lagged y
Cong Xu, Zheng Li and Ming Wang
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.