Try this:
stack control case, into(control_case)
rename _stack status
replace status = status - 1
Tom
-----------------------------------
Thomas J. Steichen
[email protected]
-----------------------------------
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Natarajan, Raj
Sent: Friday, July 13, 2007 10:47 AM
To: [email protected]
Subject: st: RE: selecting random samples and run a simulation
I sent this e-mail yesterday but did not get any response. So I am resending hoiping it will come out.
________________________________
From: Natarajan, Raj
Sent: Thu 7/12/2007 8:26 AM
To: [email protected]
Subject: selecting random samples and run a simulation
I would like to draw a random sample of 500 controls and 500 cases and calculate the odds ratio; repeat the process for 1000 times.
Example: (draw random sample)
matrix means=(0, 1.4)
matrix stdev = (1, 1)
draw norm control case, n(500) m (means) sds(stdev)
the outcome for the first 5 observations will look like this:
control case
-1.315189 .1754738
-.6195259 -.4363556
-1.18018 .2124426
-.2960889 -.5825416
..4534519 -.1245893
PROBLEM: I would like the outcomes for controls and cases to be in one column and create a new variable called "status" which is 0
for control and 1 for case.
Control_case status
-1.315189 0
-.6195259 0
-1.18018 0
-.2960889 0
..4534519 0
..1754738 1
-.4363556 1
..2124426 1
-.5825416 1
-.1245893 1
I have to run the logistic regression to calculate the odds ratios; and repeat the process with different variances.
I would like to know how to make the outcomes arranged in one column with the creation of the variables "control_case" and "status".
Thank you for any suggestion.
Raj
This email message may contain legally privileged and/or confidential information. If you are not the intended recipient(s), or the
employee or agent responsible for the delivery of this message to the intended recipient(s), you are hereby notified that any
disclosure, copying, distribution, or use of this email message is prohibited. If you have received this message in error, please
notify the sender immediately by e-mail and delete this email message from your computer. Thank you.
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
-----------------------------------------
CONFIDENTIALITY NOTE: This e-mail message, including any
attachment(s), contains information that may be confidential,
protected by the attorney-client or other legal privileges, and/or
proprietary non-public information. If you are not an intended
recipient of this message or an authorized assistant to an intended
recipient, please notify the sender by replying to this message and
then delete it from your system. Use, dissemination, distribution,
or reproduction of this message and/or any of its attachments (if
any) by unintended recipients is not authorized and may be
unlawful.
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/