Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down at the end of May, and its replacement, **statalist.org** is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
Richard Williams <richardwilliams.ndu@gmail.com> |

To |
statalist@hsphsun2.harvard.edu, statalist@hsphsun2.harvard.edu |

Subject |
Re: st: RES: generating a variable with pre-specified correlations with other two (given) variables |

Date |
Wed, 31 Aug 2011 13:59:05 -0500 |

At 07:41 AM 8/31/2011, fjc wrote:

Thanks, Tirthankar. This answers my question as originally posted. Now, something I didn't say in my earlier post (and I think I should have) is that after I generate the new variable (z) I would like to run a regression of y on x and z. But if I generate z in the way you propose, I will get perfect collinearity. ¿Is there any other way to generate z without getting this collinearity?

Slightly tweaking the earlier example, does this do what you want? mat mCorr = (1, .6, .4\ .6, 1, .5 \ .4, .5, 1) corr2data x y z, cstorage(full) corr(mCorr) n(100000) clear corr reg z x y

------------------------------------------- Richard Williams, Notre Dame Dept of Sociology OFFICE: (574)631-6668, (574)631-6463 HOME: (574)289-5227 EMAIL: Richard.A.Williams.5@ND.Edu WWW: http://www.nd.edu/~rwilliam * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**Re: st: RES: generating a variable with pre-specified correlations with other two (given) variables***From:*fjc <fjc120@gmail.com>

**References**:**st: generating a variable with pre-specified correlations with other two (given) variables***From:*fjc <fjc120@gmail.com>

**st: RES: generating a variable with pre-specified correlations with other two (given) variables***From:*"Henrique Neder" <hdneder@ufu.br>

**Re: st: RES: generating a variable with pre-specified correlations with other two (given) variables***From:*Tirthankar Chakravarty <tirthankar.chakravarty@gmail.com>

**Re: st: RES: generating a variable with pre-specified correlations with other two (given) variables***From:*fjc <fjc120@gmail.com>

- Prev by Date:
**Re: Re: st: Overidentification Tests** - Next by Date:
**Re: Re: st: atrho0() in mvprobit** - Previous by thread:
**Re: st: RES: generating a variable with pre-specified correlations with other two (given) variables** - Next by thread:
**Re: st: RES: generating a variable with pre-specified correlations with other two (given) variables** - Index(es):