Skip to main content
Post Closed as "Duplicate" by whuber r

In R, I like to create a set of variables that are correlated with a given variable.I scanned related questions but failed to find the same issue i have.

Here is instance.

x<-rnorm(100, mean=3,sd=1.2)

x<-rnorm(100, mean=3,sd=1.2)

Assuming x$x$ is an exiting variable, I like to generate z, y, t$z, y, t$ correlated variables with 4$4$ by 4$4$ correlation matrix.

So, variables y, t, z$y, t, z$ would correlate x$x$ according to predefined correlation matrix iI will use as an input. It would be grateful if you leave a comment on me with a specific code.

In R, I like to create a set of variables that are correlated with a given variable.I scanned related questions but failed to find the same issue i have.

Here is instance.

x<-rnorm(100, mean=3,sd=1.2)

Assuming x is an exiting variable, I like to generate z, y, t correlated variables with 4 by 4 correlation matrix.

So, variables y, t, z would correlate x according to predefined correlation matrix i will use as an input. It would be grateful if you leave a comment on me with a specific code.

In R, I like to create a set of variables that are correlated with a given variable.I scanned related questions but failed to find the same issue i have.

Here is instance.

x<-rnorm(100, mean=3,sd=1.2)

Assuming $x$ is an exiting variable, I like to generate $z, y, t$ correlated variables with $4$ by $4$ correlation matrix.

So, variables $y, t, z$ would correlate $x$ according to predefined correlation matrix I will use as an input. It would be grateful if you leave a comment on me with a specific code.

Post Reopened by Glen_b
Post Closed as "Not suitable for this site" by Peter Flom
Source Link

I like to generate correlated variables with a existing variable in R

In R, I like to create a set of variables that are correlated with a given variable.I scanned related questions but failed to find the same issue i have.

Here is instance.

x<-rnorm(100, mean=3,sd=1.2)

Assuming x is an exiting variable, I like to generate z, y, t correlated variables with 4 by 4 correlation matrix.

So, variables y, t, z would correlate x according to predefined correlation matrix i will use as an input. It would be grateful if you leave a comment on me with a specific code.