# [R] generate bi-variate normal data

Shin, David david.shin at pearson.com
Wed Jul 5 16:59:28 CEST 2006

```Mark,

Thanks. I am still waiting for someone to help me with this matter. I will
appreciate for any insight from you or the others.

Thanks.

David

-----Original Message-----
From: markleeds at verizon.net [mailto:markleeds at verizon.net]
Sent: Saturday, July 01, 2006 12:27 AM
To: Shin, David
Cc: r-help at stat.math.ethz.ch
Subject: Re: [R] generate bi-variate normal data

>From: "Shin, David" <david.shin at pearson.com>
>Date: Sat Jul 01 00:15:21 CDT 2006
>To: "'r-help at stat.math.ethz.ch'" <r-help at stat.math.ethz.ch>
>Subject: [R] generate bi-variate normal data

it's an interesting question. someone else
on this list can answer more explicitly but
i think you have to use the result for the multivariate
normal distribution ( bivariate case ) where , if the
joint is normal , then the conditional is normal also
with parameters a function of the 2 means and the elements of
the covariance matrix. the result in any decent mathematical statistics such
as  casella berger. so, given the one column, generate the other column
conditionally using the formula  and then the joint dist will be bivariate
normal.

>Dear all,
>
>I would like to generate bi-variate normal data given that the first column
>of the data is known. for example:
>I first generate a set of data using the command,
>x <- rmvnorm(10, c(0, 0), matrix(c(1, 0, 0, 1), 2))
>
>then I would like to sum up the two columns of x:
>x.sum <- apply(x, 1, sum)
>
>now with x.sum I would like to generate another column of data, say y, that
>makes cbind(x.sum, y) follow a bi-variate normal distribution with mean =
>c(0, 0) and sigma = matrix(c(1, 0, 0, 1),2)
>
>I will appreciate for all insights.
>
>David s.
>
>***************************************************************************
*
>This email may contain confidential material.\ If you were n...{{dropped}}
>
>______________________________________________
>R-help at stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help