# Re: [R] Generating repeated measures data

From: Michael Dewey <info_at_aghmed.fsnet.co.uk>
Date: Sat, 19 Mar 2011 14:02:50 +0000

At 00:37 19/03/2011, John Sorkin wrote:
>How would one generate data to be used in a simulation of a repeated
>measures ANOVA given a known (1) within-person correlation with
>known (2) mean and SD of data obtained at each of three times of observation?

You do not say which distribution you want them to have but for normal the best choice seems to be to load MASS and use rmvtnorm.

Generating multivariate datasets from distributions other than the normal
can be more challenging.
In \R contributed packages provide the following among others: \begin{description}
\item[\pkg{corcount}]
Poisson, negative binomial, zero--inflated versions \item[\pkg{binarySimCLF}]
Generates binary variables, see \citet{qaqish03} for details
\item[\pkg{bindat}]
Generates binary by thresholding normal
\item[\pkg{mvtBinaryEP}]
Binary
\item[\pkg{sn}]
Skew normal and skew $t$
\end{description}

Apologies for all the LaTeX but I fear if I try to edit it I will delete something crucial.

>Thanks,
>John
>John Sorkin
>Chief Biostatistics and Informatics
>Univ. of Maryland School of Medicine
>Division of Gerontology and Geriatric Medicine
>JSorkin_at_grecc.umaryland.edu
>Confidentiality Statement:
>This email message, including any attachments, is for t...{{dropped:6}}

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sat 19 Mar 2011 - 14:06:14 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 19 Mar 2011 - 14:40:23 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.