Dear all,
I wonder if there is any easy solution available in Mata for calculating the difference between adjacent elements of a (column) vector? For example, the difference of vector Y should return (Y[2]-Y[1], Y[3]-Y[2], ..., Y[n]-Y[n-1]).
Thank you,
Eilya.
Related Posts with Calculating differences between adjacent elements
Interpretation of the interaction term when the relevant dummy variable is insignificantDear all, In the model that I have run to analyse the effect of currency swaps on the gross capital…
Mixed or reg i.country i.year for repeated cross-section dataDear all, I am doing a time-series cross-sectional data from 4 waves and around 25 countries and I …
destring numbers in scientific notationDear community, I was inattentive when pasting data into a new stata-file and now the following pro…
Droping observations with x amount of missing valuesDear all, I'm working with a messy data set with approximately 870 observations at the moment. After…
categorizing dataHi all, I have a dataset includes up to 30 string variables. Some of them are dummy variables and th…
Subscribe to:
Post Comments (Atom)
0 Response to Calculating differences between adjacent elements
Post a Comment