#### Tpsim: A program for generating longitudinal panel data with known structure. David Rogosa and Ghassan Ghandour Stanford University, 1986.

The DOS program tpsim.exe creates longitudinal panel data with known structure. Appendix A of Rogosa-Saner 1995 (pp. 165-6) describes the technical formulation for the data construction. Additional details for the construction of the artificial data used in Table 2 are found on pages 153-4, and the rectangular data structure is shown in Exhibit 1.

Tpsim creates 4 output files (locations for which are requested first by the program):

• eta output file
• Y output file
In the eta and Y output files, each individual is a row with column 1 the ID, columns 2 through T+1 the eta or Y values, and the rightmost column the values of the exogenous variable (called Z or W)
• parameter values file (first column values of theta, second column values of eta(t^o))
• theoretical results file (population values of parameters and moments defined by the program input)
Next the program requests input for:
• number of individuals (not to exceed 10000)
• number of time observations (not to exceed 8)
• the observation times (same for all individuals in tpsim)
Distributions for theta and eta(t^o)
Next the distributions for the uncorrelated random variables theta and eta(t^o) are requested. If Uniform is chosen, the program asks for lower and upper endpoints for each of the Uniform distributions. If Normal is chosen, the program asks for mean and variance for each of the Gaussian distributions.

Exogenous variable Z
Next the mean and variance for the exogenous variable (called Z or W) is requested, followed by values for the correlations of Z with theta and with eta(t^o).

Simulation Constraints
If the program is being used to create a small data set to exemplify the structure in a population, it is useful to set tolerances for how far some sample quantities can differ from their population values. Setting these tolerances large (e.g. = 1) will remove any constraint. After implementing any constraints that are set (by rejecting samples not in compliance), the program presents the values of the correlations involved for user approval.

Error Variance
Lastly the program requests a value for the error variance--variance(epsilon) on p.165--for the measurement error that is added to each eta(t) to determine the value of Y.

A similar program tpsimsmr.exe can be used for creating the longitudinal data structures (such as the data in the Reply) where each individual has different observation times. This program created the data arrayed in yfzfsm.dat. The program produces two data files, the first containing the Y-observations and the second the individual times of observations. (note: notation and format of tpsimsmr has not be updated/cleaned.)