
Last chance! 50% off unlimited learning
Sale ends in
*This function has been superseded by the much more versatile
transform.scdf
function.*
Shifting the values might be helpful in cases where the measurement time
is given as a time variable (see example below).
shift(data, value, var)
A scdf with shifted data
A single-case data frame. See scdf
to learn about
this format.
Number by which to shift the values
Character string with the name of the target variable. Defaults to the measurement time variable.
Other data manipulation functions:
as.data.frame.scdf()
,
fill_missing()
,
outlier()
,
ranks()
,
smooth_cases()
,
standardize()
,
truncate_phase()
### Shift the measurement time for a better estimation of the intercept
ex <- shift(example_A24, value = -1996)
plm(ex)
# Please use transform instead:
example_A24 %>%
transform(year = year - 1996) %>%
plm()
Run the code above in your browser using DataLab