[R] Data Simulation

peter dalgaard pdalgd at gmail.com
Mon Jul 9 08:38:20 CEST 2012

On Jul 8, 2012, at 23:39 , ycyi121 wrote:

> Hi,
> I have great difficulty in simulation the a dataset based in a loading
> matrix [c(1,1,1,2,3,3,3,4,4,3,2,2,1,1), 7, 2) and an error covariance matrix
> is 2*I. I have to simulate a dataset with 7 variables and 50 rows. I search
> a lot and did find some information on this, for example, using rmvnorm().
> But I could do it.
> Please help!

This looks like homework, and we don't do people's homework on this list. One hint though: You have in your textbook a formula that connects your loadings and errors to the 7x7 covariance matrix for observations. This is what you need in order to use rmvnorm().

> --
> View this message in context: http://r.789695.n4.nabble.com/Data-Simulation-tp4635803.html
> Sent from the R help mailing list archive at Nabble.com.
> ______________________________________________
> 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.

Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com

More information about the R-help mailing list