Gives periodogram-based analyses for replicated time series (R.P. Littlejohn).

### Options

`PRINT` = string token |
What to print (`pair` , `randomization` , `glm` ); default `*` i.e. none |
---|---|

`PLOT` = string token |
What graphs to plot (`group` , `mean` , `logmean` , `cumulative` , `cv` , `pair` ); default `mean` , `logm` |

`TITLE` = text |
Title for each page of graphs |

`REPRESENTATION` = string token |
Form of data in `SERIES` (`timeseries` , `meanperiodogram` ); default `time` |

`LENGTH` = scalar or variate |
Scalar specifying that the first `N` units of the series are to be used, or a variate specifying the first and last units of the series to be used |

`SEED` = scalar |
Seed for randomization; default 0 |

`NRANDOMIZATIONS` = scalar |
Number of randomizations; default 99 |

`TREATMENTS` = factor |
Contains ordered classification of `SERIES` |

`PAIR` = variates |
Treatment pair levels for pairwise comparisons |

`COLOUR` = text or variate |
Colours for each level of `TREATMENTS` ; default `*` sets suitable colours automatically |

`MEANPERIODOGRAM` = pointer |
Saves mean periodograms according if `REPRESENTATION=timeseries` |

`REPLICATION` = scalar or variate |
Inputs or saves number of replicate series if `REPRESENTATION=timeseries` ; scalar can be used for equal replication |

### Parameter

`SERIES` = variates |
Specify the time series to be analysed |
---|

### Description

`REPPERIODOGRAM`

gives periodogram-based analyses of replicated time series. The data are supplied in a list of variates using the `SERIES`

parameter, either as the original time series (option `REPRESENTATION`

set to `timeseries`

) with the level for each series given by the factor specified by the `TREATMENTS`

option, or as the mean periodograms for each treatment level (option `REPRESENTATION`

set to `meanperiodogram`

), with levels and labels optionally given by the `TREATMENTS`

factor and the multiplicity of each treatment defined by the `REPLICATION`

option. In the former case the `LENGTH`

option can specify that only part of each series is to be used, using either a scalar `N`

to indicate that the first `N`

values are to be used, or a variate of length two, holding the values of the first and last units of the required subseries. This may be used to eliminate missing values, which are otherwise not permitted. Further, when `REPRESENTATION=timeseries`

, periodogram means and the replication variate can be saved using the `MEANPERIODOGRAM`

and `REPLICATION`

options, respectively.

Graphical output is controlled by the `PLOT`

option. For the group (`REPRESENTATION=timeseries`

only), mean, logmean and cumulative periodogram and cv graphs, the `COLOUR`

option can be used to code for treatments; by default, the standard colours are used in the same order as for pens 2, 3… (see `PEN`

). The cv plot (`REPRESENTATION=timeseries`

only) gives a scatterplot of coefficients of variation for each treatment group at each frequency, together with lines for the means of these cvs at each frequency for those treatments with replication greater than one, and cv=1, the theoretical value if there is no subject-specific variation. For these graphs a title can be supplied using the `TITLE`

option. Graphs are also given for the differences between pairs of log periodograms as defined by `PAIR`

(see below), with 95% confidence intervals on the sample and null (equal periodograms) distribution.

Output of various test statistics for pairwise comparison of treatment levels described by Diggle (1990) and Diggle & Fisher (1991) is controlled by the `PRINT`

and `PAIR`

options. `PAIR`

is a list of 2-unit variates representing treatment levels, e.g.

`PAIR=!(1,2),!(3,4)`

gives tests comparing treatment levels 1 and 2, followed by tests for levels 3 and 4. With `PRINT=pair`

, the maximum absolute value and range of the difference of log periodograms give (weak) tests against the null hypotheses of equal and proportional spectra, respectively. With `PRINT=random`

, a randomization test is given for the equality of cumulative spectra, which is insensitive to the alternative of proportional spectra. The seed for the ramdomizations can be set using the `SEED`

option, and the number of randomizations is specified by `NRANDOMIZATIONS`

(default 99). This is available only if the treatments in the pair have equal replication.

When `PRINT=glm`

, a generalized linear model is fitted to the mean periodograms for all treatments, adjusting for frequency, and testing for differences with treatment in constant (proportional spectra), linear (power shift) and quadratic (power spread) contrasts with frequency (Diggle 1990). Results are presented in the accumulated analysis of deviance table and tables of parameter estimates, within which the Intercept-Difference, Slope-Difference and Curve-Difference estimates relate to the above hyptheses.

Options: `PRINT`

, `PLOT`

, `REPRESENTATION`

, `LENGTH`

, `TREATMENTS`

, `PAIR`

, `SEED`

, `NRANDOMIZATIONS`

, `COLOUR`

, `TITLE`

, `MEANPERIODOGRAM`

, `REPLICATION`

.

Parameter: `SERIES`

.

### Method

The series are mean-corrected, but not trend corrected, before transformation, and are not smoothed. Critical values for the Range test are obtained from tables in Potscher & Reschenhofer (1988) and Coates & Diggle (1986). Random numbers are generated using `URAND`

. The analysis for `PRINT=glm`

is obtained from fitting a generalized linear model with `DISTRIBUTION=gamma`

, `LINK=log`

and `DISPERSION`

=1/*nr*, where *nr* is number of replicates of the treatments.

### Action with `RESTRICT`

The `SERIES`

may not be restricted; restriction of the input series to a contiguous set of units may be achieved by use of the `LENGTH`

parameter.

### References

Coates, D.S. & Diggle, P.J. (1986) Tests for comparing two estimated spectral densities. *Journal of Time Series Analysis*, 7, 7-20.

Diggle, P.J. (1990). *Time Series: A Biostatistical Introduction*. Oxford, Clarendon Press.

Diggle, P.J. & Fisher, N.I. (1991). Nonparametric comparisons of cumulative periodograms. *Applied Statistics*, 40, 423-434.

Potscher, B.M. & Reschenhofer, E. (1988). Discriminating between two spectral densities in case of replicated observations. *Journal of Time Series Analysis*, 9, 221-224.

### See also

Directive: `FOURIER`

.

Procedures: `DFOURIER`

, `MCROSSPECTRUM`

, `PERIODTEST`

, `SMOOTHSPECTRUM`

.

Commands for: Time series.

### Example

CAPTION 'REPPERIODOGRAM example',\ !t('Data from Diggle, P.J. (1990),',\ 'Time Series: A Biostatistical Introduction,',\ 'Clarendon Press, Oxford, Table A.1 Lutenizing hormone.');\ STYLE=meta,plain VARIATE [NVALUES=48] Number,lh[1...4] FACTOR [LEVELS=2; LABELS=!T(early,late); VALUES=(1,2)2] treat READ Number,lh[1...4] 1 2.2 5.5 2.4 4.3 2 2.2 4.5 2.4 4.6 3 2.3 5.1 2.4 4.7 4 2.0 5.5 2.2 4.1 5 1.6 5.7 2.1 4.1 6 1.4 5.1 1.5 5.2 7 1.8 4.3 2.3 5.0 8 2.2 4.8 2.3 4.4 9 2.9 5.6 2.5 4.2 10 2.6 5.9 2.0 5.1 11 2.4 6.0 1.9 5.1 12 2.1 5.1 1.7 4.7 13 3.0 5.2 2.2 4.4 14 2.5 4.4 1.8 3.9 15 2.7 5.5 3.2 5.4 16 2.2 5.4 3.2 5.9 17 2.4 4.1 2.7 4.2 18 2.7 4.4 2.2 4.1 19 3.1 4.7 2.2 4.1 20 2.5 4.6 1.9 3.6 21 2.4 6.0 1.9 3.1 22 2.3 5.6 1.8 4.8 23 2.4 5.1 2.7 5.1 24 1.9 4.7 3.0 5.1 25 3.3 4.8 2.3 4.5 26 3.8 5.5 2.0 4.6 27 3.7 5.1 2.0 5.8 28 3.5 5.2 2.9 5.0 29 3.1 5.0 2.9 5.1 30 2.7 4.0 2.7 4.5 31 4.1 3.7 2.7 4.2 32 4.0 4.8 2.3 6.0 33 3.4 5.9 2.6 5.6 34 3.2 5.5 2.4 5.4 35 3.7 4.9 1.8 5.0 36 3.6 4.4 1.7 4.4 37 4.1 4.7 1.5 4.6 38 2.0 4.2 1.4 5.7 39 4.6 5.5 2.1 5.2 40 4.1 4.9 3.3 5.0 41 3.2 4.8 3.5 4.4 42 2.9 4.5 3.5 5.7 43 2.7 4.9 3.1 5.7 44 3.0 4.9 2.6 4.8 45 * 4.5 2.1 3.4 46 * 4.2 3.4 5.5 47 * 4.9 3.0 5.5 48 * 5.9 2.9 5.6 : REPPERIODOGRAM [PRINT=pair,random,glm;\ PLOT=group,mean,logmean,cumulative,cv,pair;\ TITLE='Luteinizing hormone'; REPRESENTATION=timeseries;\ LENGTH=44; TREATMENTS=treat; SEED=376512; PAIR=!(1,2);\ COLOUR=!t(red,limegreen); MEANPERIODOGRAM=mPer;\ REPLICATION=rep] lh[1...4] PRINT mPer[] PRINT rep