Hi stata users,
i´m using sine and cosine terms as predictors in modeling periodic time series.
My aim is to extract the MESOR, Amplitude and Acrophase of an individual 24hour recording.
For those interested in the contend / meaning of the data: The time series consists of RMSSD values (an expression of ones heart rate variability) of a single individual collapsed to ever 5.35minute intervals but with gaps (e.g. if the recording went not very well during a 5.35 min interval). The recording started at 10:37 for 24hours.
So I ran the following syntax on my 288 data points (4 missing resulting in 284 analyzed segments)
But when inspecting the results in a graph using the "twoway function" graph command one can see that the acrophase of the long-dashed curve (As is) is not corresponding to the yhat curve (solid line) (although MESOR and Amplitude do so).
In my example here, the appropriate acrophase value would be -10.6 (as opposed to -.036787) to match the yhat curve (short dashed line labeled "Expected" bc i expected the function to fit the yhat line).
What is it that I am missing here? Do i have an error in calculating the Acrophase value?
In addition, one can see that the data contain ultradian rhythms, which can be captured by e.g. doubling the amount of cycles.
But how would the amplitude & acrophase be calculated in that case?

Thanks for your help & time!
Marc
i´m using sine and cosine terms as predictors in modeling periodic time series.
My aim is to extract the MESOR, Amplitude and Acrophase of an individual 24hour recording.
For those interested in the contend / meaning of the data: The time series consists of RMSSD values (an expression of ones heart rate variability) of a single individual collapsed to ever 5.35minute intervals but with gaps (e.g. if the recording went not very well during a 5.35 min interval). The recording started at 10:37 for 24hours.
So I ran the following syntax on my 288 data points (4 missing resulting in 284 analyzed segments)
Code:
. reg rmssd sintimeA costimeA Source | SS df MS Number of obs = 284 -------------+------------------------------ F( 2, 281) = 38.24 Model | 30413.6508 2 15206.8254 Prob > F = 0.0000 Residual | 111745.603 281 397.671186 R-squared = 0.2139 -------------+------------------------------ Adj R-squared = 0.2083 Total | 142159.254 283 502.32952 Root MSE = 19.942 ------------------------------------------------------------------------------ rmssd | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- sintimeA | -5.174174 1.769928 -2.92 0.004 -8.658175 -1.690173 costimeA | -13.42496 1.616504 -8.30 0.000 -16.60696 -10.24297 _cons | 29.10342 1.201788 24.22 0.000 26.73777 31.46907 ------------------------------------------------------------------------------ . predict yhatA , xb . gen mesorA=_b[_cons] . gen ampA = sqrt(_b[costimeA]^2 + _b[sintimeA]^2) . gen acrA = atan(-_b[sintimeA] / _b[costimeA]) . list ampA mesorA acrA in 1/1 +---------------------------------+ | ampA mesorA acrA | |---------------------------------| 1. | 14.38755 29.10342 -.3678697 | +---------------------------------+
But when inspecting the results in a graph using the "twoway function" graph command one can see that the acrophase of the long-dashed curve (As is) is not corresponding to the yhat curve (solid line) (although MESOR and Amplitude do so).
In my example here, the appropriate acrophase value would be -10.6 (as opposed to -.036787) to match the yhat curve (short dashed line labeled "Expected" bc i expected the function to fit the yhat line).
What is it that I am missing here? Do i have an error in calculating the Acrophase value?
In addition, one can see that the data contain ultradian rhythms, which can be captured by e.g. doubling the amount of cycles.
But how would the amplitude & acrophase be calculated in that case?
Thanks for your help & time!
Marc
Comment