Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

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


From   "Henrique Neder" <hdneder@ufu.br>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RES: generating a variable with pre-specified correlations with other two (given) variables
Date   Wed, 31 Aug 2011 07:53:36 -0300

Try corr2data: 

matrix C = (1,0,.80,-.80\0,1,0,0\.80,0,1,-.80\-.80,0,-.80,1)
corr2data hsperc corzer1 corpos1 corneg1, n(4137) corr(C)

Henrique Neder


-----Mensagem original-----
De: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Em nome de fjc
Enviada em: terça-feira, 30 de agosto de 2011 23:00
Para: statalist@hsphsun2.harvard.edu
Assunto: st: generating a variable with pre-specified correlations with
other two (given) variables

Dear Statalisters:

I have a dataset with two variables, x and y.

I would like to generate a new artificial variable, z, with
pre-specified correlations with x and y (no particular distribution
required).

Any help would be greatly appreciated.

Best,

Francisco.

P.D. I'm using Stata 11 (on Windows XP)
*
*   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/

-----
Nenhum vírus encontrado nessa mensagem.
Verificado por AVG - www.avgbrasil.com.br
Versão: 10.0.1392 / Banco de dados de vírus: 1520/3868 - Data de Lançamento:
08/30/11


*
*   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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index